MidiDevice
class MidiDevice : Closeable
This class is used for sending and receiving data to and from a MIDI device Instances of this class are created by MidiManager#openDevice
.
Summary
Nested classes |
|
This class represents a connection between the output port of one device and the input port of another.
|
Public methods
close
fun close(): Unit
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
java.io.IOException |
if an I/O error occurs |
connectPorts
fun connectPorts(
inputPort: MidiInputPort!,
outputPortNumber: Int
): MidiDevice.MidiConnection!
Connects the supplied MidiInputPort
to the output port of this device with the specified port number. Once the connection is made, the MidiInput port instance can no longer receive data via its MidiReceiver#onSend
method. This method returns a MidiDevice.MidiConnection
object, which can be used to close the connection.
Parameters |
inputPort |
MidiInputPort!: the inputPort to connect |
outputPortNumber |
Int: the port number of the output port to connect inputPort to. |
fun openInputPort(portNumber: Int): MidiInputPort!
Called to open a MidiInputPort
for the specified port number. An input port can only be used by one sender at a time. Opening an input port will fail if another application has already opened it for use. A MidiDeviceStatus
can be used to determine if an input port is already open.
Parameters |
portNumber |
Int: the number of the input port to open |
openOutputPort
fun openOutputPort(portNumber: Int): MidiOutputPort!
Called to open a MidiOutputPort
for the specified port number. An output port may be opened by multiple applications.
Parameters |
portNumber |
Int: the number of the output port to open |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Protected methods
finalize
protected fun finalize(): Unit
Exceptions |
java.lang.Throwable |
the Exception raised by this method |