Class: MicroMIDI::Instructions::Output
- Inherits:
-
Object
- Object
- MicroMIDI::Instructions::Output
- Extended by:
- Forwardable
- Defined in:
- lib/micromidi/instructions/output.rb,
lib/micromidi/instructions/shorthand.rb
Overview
Commands that deal with MIDI output
Instance Method Summary collapse
-
#initialize(state) ⇒ Output
constructor
A new instance of Output.
-
#output(message) ⇒ MIDIMessage
(also: #out)
Output a message or toggle the auto output mode.
-
#set_auto_output(is_on) ⇒ Boolean
Set mode where messages are automatically outputted.
Constructor Details
#initialize(state) ⇒ Output
Returns a new instance of Output.
14 15 16 |
# File 'lib/micromidi/instructions/output.rb', line 14 def initialize(state) @state = state end |
Instance Method Details
#output(message) ⇒ MIDIMessage Also known as: out
Output a message or toggle the auto output mode
21 22 23 24 25 26 27 |
# File 'lib/micromidi/instructions/output.rb', line 21 def output() set_auto_output() if !! === # check for boolean unless .nil? @state.outputs.each { |output| output.puts() } end end |
#set_auto_output(is_on) ⇒ Boolean
Set mode where messages are automatically outputted
32 33 34 |
# File 'lib/micromidi/instructions/output.rb', line 32 def set_auto_output(is_on) @state.auto_output = is_on end |