Class: Clef::Layout::SystemLayout::System
- Inherits:
-
Struct
- Object
- Struct
- Clef::Layout::SystemLayout::System
- Defined in:
- lib/clef/layout/system_layout.rb
Instance Attribute Summary collapse
-
#end_moment ⇒ Object
Returns the value of attribute end_moment.
-
#line_index ⇒ Object
Returns the value of attribute line_index.
-
#line_top ⇒ Object
Returns the value of attribute line_top.
-
#page_index ⇒ Object
Returns the value of attribute page_index.
-
#position_offset ⇒ Object
Returns the value of attribute position_offset.
-
#staff_offsets ⇒ Object
Returns the value of attribute staff_offsets.
-
#start_moment ⇒ Object
Returns the value of attribute start_moment.
-
#x_origin ⇒ Object
Returns the value of attribute x_origin.
-
#y_origin ⇒ Object
Returns the value of attribute y_origin.
Instance Method Summary collapse
- #include_moment?(moment) ⇒ Boolean
- #staff_offset(staff_id) ⇒ Object
- #staff_origin(staff_id) ⇒ Object
Instance Attribute Details
#end_moment ⇒ Object
Returns the value of attribute end_moment
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def end_moment @end_moment end |
#line_index ⇒ Object
Returns the value of attribute line_index
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def line_index @line_index end |
#line_top ⇒ Object
Returns the value of attribute line_top
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def line_top @line_top end |
#page_index ⇒ Object
Returns the value of attribute page_index
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def page_index @page_index end |
#position_offset ⇒ Object
Returns the value of attribute position_offset
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def position_offset @position_offset end |
#staff_offsets ⇒ Object
Returns the value of attribute staff_offsets
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def staff_offsets @staff_offsets end |
#start_moment ⇒ Object
Returns the value of attribute start_moment
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def start_moment @start_moment end |
#x_origin ⇒ Object
Returns the value of attribute x_origin
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def x_origin @x_origin end |
#y_origin ⇒ Object
Returns the value of attribute y_origin
6 7 8 |
# File 'lib/clef/layout/system_layout.rb', line 6 def y_origin @y_origin end |
Instance Method Details
#include_moment?(moment) ⇒ Boolean
16 17 18 19 |
# File 'lib/clef/layout/system_layout.rb', line 16 def include_moment?(moment) value = moment.is_a?(Clef::Ir::Moment) ? moment.value : Rational(moment) value.between?(start_moment.value, end_moment.value) end |
#staff_offset(staff_id) ⇒ Object
8 9 10 |
# File 'lib/clef/layout/system_layout.rb', line 8 def staff_offset(staff_id) staff_offsets.fetch(staff_id) end |
#staff_origin(staff_id) ⇒ Object
12 13 14 |
# File 'lib/clef/layout/system_layout.rb', line 12 def staff_origin(staff_id) [x_origin, y_origin + staff_offset(staff_id)] end |