Class: Musa::Sequencer::BaseSequencer::PlayTimedControl Private
- Inherits:
-
EventHandler
- Object
- EventHandler
- Musa::Sequencer::BaseSequencer::PlayTimedControl
- Defined in:
- lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Control object for play_timed operations.
Manages lifecycle of timed series playback with callbacks. Simpler than PlayControl - no pause/continue support.
Instance Attribute Summary collapse
-
#do_after ⇒ Array<Hash>
readonly
private
After callbacks with delays.
-
#do_on_stop ⇒ Array<Proc>
readonly
private
Stop callbacks.
Instance Method Summary collapse
-
#after(bars = nil) { ... } ⇒ void
private
Registers callback to execute after playback terminates naturally (series exhausted).
-
#initialize(parent, on_stop: nil, after_bars: nil, after: nil) ⇒ PlayTimedControl
constructor
private
Creates play_timed control with callbacks.
-
#on_stop { ... } ⇒ void
private
Registers callback for when playback stops (any reason, including manual stop).
Constructor Details
#initialize(parent, on_stop: nil, after_bars: nil, after: nil) ⇒ PlayTimedControl
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates play_timed control with callbacks.
164 165 166 167 168 169 170 171 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 164 def initialize(parent, on_stop: nil, after_bars: nil, after: nil) super parent @do_on_stop = [] @do_after = [] @do_on_stop << on_stop if on_stop self.after , &after if after end |
Instance Attribute Details
#do_after ⇒ Array<Hash> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns after callbacks with delays.
154 155 156 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 154 def do_after @do_after end |
#do_on_stop ⇒ Array<Proc> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns stop callbacks.
152 153 154 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 152 def do_on_stop @do_on_stop end |
Instance Method Details
#after(bars = nil) { ... } ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Registers callback to execute after playback terminates naturally (series exhausted). NOT called on manual stop (.stop).
196 197 198 199 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 196 def after( = nil, &block) ||= 0 @do_after << { bars: .rationalize, block: block } end |
#on_stop { ... } ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Registers callback for when playback stops (any reason, including manual stop).
180 181 182 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 180 def on_stop(&block) @do_on_stop << block end |