Class: TEF::ProgramSelection::ProgramSheet
- Inherits:
-
Sequencing::Sheet
- Object
- Sequencing::Sheet
- TEF::ProgramSelection::ProgramSheet
- Defined in:
- lib/tef/ProgramSelection/SequenceCollection.rb
Overview
Convenience class. Mainly extends Sequencing::Sheet with an #add_key function, which self-registers this program under the last created SequenceCollection.
Instance Attribute Summary collapse
-
#program_key ⇒ Object
Optional key to use when passing to Sequencing::Player#[]=.
Attributes inherited from Sequencing::Sheet
#end_time, #fill_block, #repeat_time, #setup_block, #start_time, #teardown_block, #tempo
Instance Method Summary collapse
-
#add_key(title, groups = [], variation = '.mp3', options = nil) ⇒ Object
Register this sheet under a given key.
-
#initialize {|_self| ... } ⇒ ProgramSheet
constructor
A new instance of ProgramSheet.
Methods inherited from Sequencing::Sheet
Constructor Details
#initialize {|_self| ... } ⇒ ProgramSheet
Returns a new instance of ProgramSheet.
119 120 121 122 123 |
# File 'lib/tef/ProgramSelection/SequenceCollection.rb', line 119 def initialize() super() yield(self) if block_given? end |
Instance Attribute Details
#program_key ⇒ Object
Optional key to use when passing to Sequencing::Player#[]=. Different keys are necessary to not overwrite the previous running program.
117 118 119 |
# File 'lib/tef/ProgramSelection/SequenceCollection.rb', line 117 def program_key @program_key end |
Instance Method Details
#add_key(title, groups = [], variation = '.mp3', options = nil) ⇒ Object
Register this sheet under a given key. Syntax is the same as Selector#register_ID, with a default variant of ‘.mp3’ to comply with the default variant set by SoundCollection.
129 130 131 132 133 134 135 136 137 138 |
# File 'lib/tef/ProgramSelection/SequenceCollection.rb', line 129 def add_key(title, groups = [], variation = '.mp3', = nil) prog_collection = SequenceCollection.current_collection raise "No program collection was instantiated yet!" unless prog_collection id = ID.new(title, groups, variation) prog_collection[id] = self prog_collection.sheet_opts[id] = if .is_a? Hash end |