Class: JSound::Midi::Devices::InputDevice::Bridge
- Inherits:
-
JSound::Midi::Device
- Object
- JSound::Midi::Device
- JSound::Midi::Devices::InputDevice::Bridge
- Defined in:
- lib/jsound/midi/devices/input_device.rb
Overview
A subcomponent of JSound::Midi::Devices::InputDevice that implements javax.sound.midi.Receiver by translating incoming Java MIDI Messages to Ruby Messages.
Instance Method Summary collapse
-
#initialize(source_device) ⇒ Bridge
constructor
A new instance of Bridge.
-
#send(java_message, timestamp = -1)) ⇒ Object
Receives incoming Java MIDI Messages, converts them to Ruby Messages, and sends them to any connected devices.
Methods inherited from JSound::Midi::Device
#<=, #>>, #close, #message, #open, #open?, #output, #output=, #to_s, #type
Methods included from TypeFromClassName
Constructor Details
#initialize(source_device) ⇒ Bridge
Returns a new instance of Bridge.
32 33 34 |
# File 'lib/jsound/midi/devices/input_device.rb', line 32 def initialize(source_device) @source_device = source_device end |
Instance Method Details
#send(java_message, timestamp = -1)) ⇒ Object
Receives incoming Java MIDI Messages, converts them to Ruby Messages, and sends them to any connected devices.
38 39 40 41 42 43 |
# File 'lib/jsound/midi/devices/input_device.rb', line 38 def send(, =-1) self. Message.from_java(, :source => @source_device) rescue STDERR.puts $! if $DEBUG # otherwise this can get swallowed raise end |