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.
132 133 134 135 136 |
# File 'lib/midi-message/system_exclusive.rb', line 132 def initialize(manufacturer, = {}) @device_id = [:device_id] @model_id = [:model_id] @manufacturer_id = get_manufacturer_id(manufacturer) end |
Instance Attribute Details
#device_id ⇒ Object
Returns the value of attribute device_id.
129 130 131 |
# File 'lib/midi-message/system_exclusive.rb', line 129 def device_id @device_id end |
#manufacturer_id ⇒ Object (readonly)
Returns the value of attribute manufacturer_id.
130 131 132 |
# File 'lib/midi-message/system_exclusive.rb', line 130 def manufacturer_id @manufacturer_id end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
130 131 132 |
# File 'lib/midi-message/system_exclusive.rb', line 130 def model_id @model_id end |
Instance Method Details
#command(*a) ⇒ Object
create a new Command message associated with this node
157 158 159 160 161 |
# File 'lib/midi-message/system_exclusive.rb', line 157 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
150 151 152 153 154 |
# File 'lib/midi-message/system_exclusive.rb', line 150 def () copy = .clone copy.node = self copy end |
#request(*a) ⇒ Object
create a new Request message associated with this node
164 165 166 167 168 |
# File 'lib/midi-message/system_exclusive.rb', line 164 def request(*a) request = Request.new(*a) request.node = self request end |
#to_a(options = {}) ⇒ Object
138 139 140 141 142 143 144 145 146 |
# File 'lib/midi-message/system_exclusive.rb', line 138 def to_a( = {}) omit = [:omit] || [] properties = [:manufacturer, :device, :model].map do |property| unless omit.include?(property) || omit.include?("#{property.to_s}_id") instance_variable_get("@#{property.to_s}_id") end end properties.compact end |