Class: JSound::Midi::Devices::InputDevice

Inherits:
JDevice show all
Defined in:
lib/jsound/midi/devices/input_device.rb

Overview

A device that receives messages from a system MIDI input port, and passes the messages to any connected device.

Available inputs are contained in the INPUTS list in the JSound::Midi module.

Defined Under Namespace

Classes: Bridge

Instance Attribute Summary

Attributes inherited from JDevice

#description, #info, #type

Instance Method Summary collapse

Methods inherited from JDevice

#[], #close, from_java, #inspect, #method_missing, #open, open_devices, #respond_to?, #to_s

Methods inherited from JSound::Midi::Device

#<=, #>>, #close, #message, #open, #open?, #output, #to_s, #type

Methods included from TypeFromClassName

included

Constructor Details

#initialize(java_device) ⇒ InputDevice

Note:

Typically you won’t instantiate these directly. Instead, find an input via the INPUTS list in the JSound::Midi module.

Wrap a javax.sound.midi.MidiDevice receiver to provide MIDI output.



16
17
18
19
20
# File 'lib/jsound/midi/devices/input_device.rb', line 16

def initialize(java_device)
  super(java_device, :input)
  @bridge = Bridge.new(self)
  java_device.transmitter.receiver = @bridge
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class JSound::Midi::Devices::JDevice

Instance Method Details

#output=(device) ⇒ Object



22
23
24
25
# File 'lib/jsound/midi/devices/input_device.rb', line 22

def output=(device)
  super
  @bridge.output= device
end