Class: Topaz::Events
- Inherits:
-
Object
- Object
- Topaz::Events
- Defined in:
- lib/topaz/events.rb
Overview
User defined callbacks for tempo events
Instance Attribute Summary collapse
-
#midi_clock ⇒ Object
Returns the value of attribute midi_clock.
-
#midi_start ⇒ Object
Returns the value of attribute midi_start.
-
#midi_stop ⇒ Object
Returns the value of attribute midi_stop.
-
#start ⇒ Object
Returns the value of attribute start.
-
#stop ⇒ Object
Returns the value of attribute stop.
-
#stop_when ⇒ Object
Returns the value of attribute stop_when.
-
#tick ⇒ Object
readonly
Returns the value of attribute tick.
Instance Method Summary collapse
- #do_midi_clock ⇒ Object
- #do_start ⇒ Object
- #do_stop ⇒ Object
- #do_tick ⇒ Object
-
#initialize ⇒ Events
constructor
A new instance of Events.
- #stop? ⇒ Boolean
Constructor Details
#initialize ⇒ Events
Returns a new instance of Events.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/topaz/events.rb', line 9 def initialize() @start = [] @stop = [] @tick = [] @midi_clock = nil @midi_start = nil @midi_stop = nil @stop_when = nil end |
Instance Attribute Details
#midi_clock ⇒ Object
Returns the value of attribute midi_clock.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def midi_clock @midi_clock end |
#midi_start ⇒ Object
Returns the value of attribute midi_start.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def midi_start @midi_start end |
#midi_stop ⇒ Object
Returns the value of attribute midi_stop.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def midi_stop @midi_stop end |
#start ⇒ Object
Returns the value of attribute start.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def start @start end |
#stop ⇒ Object
Returns the value of attribute stop.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def stop @stop end |
#stop_when ⇒ Object
Returns the value of attribute stop_when.
7 8 9 |
# File 'lib/topaz/events.rb', line 7 def stop_when @stop_when end |
#tick ⇒ Object (readonly)
Returns the value of attribute tick.
6 7 8 |
# File 'lib/topaz/events.rb', line 6 def tick @tick end |
Instance Method Details
#do_midi_clock ⇒ Object
20 21 22 |
# File 'lib/topaz/events.rb', line 20 def do_midi_clock @midi_clock.call end |
#do_start ⇒ Object
24 25 26 27 |
# File 'lib/topaz/events.rb', line 24 def do_start @midi_start.call @start.each(&:call) end |
#do_stop ⇒ Object
29 30 31 32 |
# File 'lib/topaz/events.rb', line 29 def do_stop @midi_stop.call @stop.each(&:call) end |
#do_tick ⇒ Object
34 35 36 |
# File 'lib/topaz/events.rb', line 34 def do_tick @tick.each(&:call) end |
#stop? ⇒ Boolean
38 39 40 |
# File 'lib/topaz/events.rb', line 38 def stop? @stop_when.call unless @stop_when.nil? end |