class MidiInputPort : MidiReceiver, Closeable
This class is used for sending data to a port on a MIDI device
Summary
Inherited functions |
From class MidiReceiver
Unit |
flush()
Instructs the receiver to discard all pending MIDI data.
|
Int |
getMaxMessageSize()
Returns the maximum size of a message this receiver can receive.
|
Unit |
send(msg: ByteArray!, offset: Int, count: Int)
Called to send MIDI data to the receiver without a timestamp. Data will be processed by receiver in the order sent. Data will get split into multiple calls to onSend if count exceeds getMaxMessageSize . Blocks until all the data is sent or an exception occurs. In the latter case, the amount of data sent prior to the exception is not provided to caller. The communication should be considered corrupt. The sender should reestablish communication, reset all controllers and send all notes off.
|
Unit |
send(msg: ByteArray!, offset: Int, count: Int, timestamp: Long)
Called to send MIDI data to the receiver with a specified timestamp. Data will be processed by receiver in order first by timestamp, then in the order sent. Data will get split into multiple calls to onSend if count exceeds getMaxMessageSize . Blocks until all the data is sent or an exception occurs. In the latter case, the amount of data sent prior to the exception is not provided to caller. The communication should be considered corrupt. The sender should reestablish communication, reset all controllers and send all notes off.
|
|
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 |
getPortNumber
fun getPortNumber(): Int
Returns the port number of this port
Return |
Int |
the port's port number |
onFlush
fun onFlush(): Unit
Exceptions |
java.io.IOException |
|
onSend
fun onSend(
msg: ByteArray!,
offset: Int,
count: Int,
timestamp: Long
): Unit
Parameters |
msg |
ByteArray!: a byte array containing the MIDI data |
offset |
Int: the offset of the first byte of the data in the array to be processed |
count |
Int: the number of bytes of MIDI data in the array to be processed |
timestamp |
Long: the timestamp of the message (based on java.lang.System#nanoTime |
Exceptions |
java.io.IOException |
|
Protected methods
finalize
protected fun finalize(): Unit
Exceptions |
java.lang.Throwable |
the Exception raised by this method |