Class: MIDIMessage::SystemExclusive::Node
- Inherits:
-
Object
- Object
- MIDIMessage::SystemExclusive::Node
- Defined in:
- lib/midi-message/system_exclusive.rb
Overview
The SystemExclusive::Node represents a destination for a message. For example a hardware synthesizer or sampler
Instance Attribute Summary collapse
-
#device_id ⇒ Object
Returns the value of attribute device_id.
-
#manufacturer_id ⇒ Object
readonly
Returns the value of attribute manufacturer_id.
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
Instance Method Summary collapse
-
#command(*a) ⇒ Object
create a new Command message associated with this node.
-
#initialize(manufacturer, options = {}) ⇒ Node
constructor
A new instance of Node.
-
#new_message_from(prototype_message) ⇒ Object
this message takes a prototype message, copies it, and returns the copy with its node set to this node.
-
#request(*a) ⇒ Object
create a new Request message associated with this node.
- #to_a(options = {}) ⇒ Object
Constructor Details
#initialize(manufacturer, options = {}) ⇒ Node
Returns a new instance of Node.
170 171 172 173 174 |
# File 'lib/midi-message/system_exclusive.rb', line 170 def initialize(manufacturer, = {}) @device_id = [:device_id] @model_id = [:model_id] @manufacturer_id = manufacturer.kind_of?(Numeric) ? manufacturer : Constant.find("Manufacturer", manufacturer).value end |
Instance Attribute Details
#device_id ⇒ Object
Returns the value of attribute device_id.
167 168 169 |
# File 'lib/midi-message/system_exclusive.rb', line 167 def device_id @device_id end |
#manufacturer_id ⇒ Object (readonly)
Returns the value of attribute manufacturer_id.
168 169 170 |
# File 'lib/midi-message/system_exclusive.rb', line 168 def manufacturer_id @manufacturer_id end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
168 169 170 |
# File 'lib/midi-message/system_exclusive.rb', line 168 def model_id @model_id end |
Instance Method Details
#command(*a) ⇒ Object
create a new Command message associated with this node
194 195 196 197 198 |
# File 'lib/midi-message/system_exclusive.rb', line 194 def command(*a) command = Command.new(*a) command.node = self command end |
#new_message_from(prototype_message) ⇒ Object
this message takes a prototype message, copies it, and returns the copy with its node set to this node
187 188 189 190 191 |
# File 'lib/midi-message/system_exclusive.rb', line 187 def () copy = .clone copy.node = self copy end |
#request(*a) ⇒ Object
create a new Request message associated with this node
201 202 203 204 205 |
# File 'lib/midi-message/system_exclusive.rb', line 201 def request(*a) request = Request.new(*a) request.node = self request end |
#to_a(options = {}) ⇒ Object
176 177 178 179 180 181 182 183 |
# File 'lib/midi-message/system_exclusive.rb', line 176 def to_a( = {}) omit = [:omit] || [] [ (@manufacturer_id unless omit.include?(:manufacturer) || omit.include?(:manufacturer_id)), (@device_id unless omit.include?(:device) || omit.include?(:device_id)), (@model_id unless omit.include?(:model) || omit.include?(:model_id)) ].compact end |