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.
170 171 172 173 174 175 176 177 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 170 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.
160 161 162 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 160 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.
158 159 160 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 158 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).
203 204 205 206 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 203 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).
186 187 188 |
# File 'lib/musa-dsl/sequencer/base-sequencer-implementation-play-timed.rb', line 186 def on_stop(&block) @do_on_stop << block end |