/**@class android.media.midi.MidiReceiver @extends java.lang.Object Interface for sending and receiving data to and from a MIDI device. */ var MidiReceiver = { /**Called whenever the receiver is passed new MIDI data. Subclasses override this method to receive MIDI data. May fail if count exceeds {@link #getMaxMessageSize}. NOTE: the msg array parameter is only valid within the context of this call. The msg bytes should be copied by the receiver rather than retaining a reference to this parameter. Also, modifying the contents of the msg array parameter may result in other receivers in the same application receiving incorrect values in their {link #onSend} method. @param {Object {byte[]}} msg a byte array containing the MIDI data @param {Number} offset the offset of the first byte of the data in the array to be processed @param {Number} count the number of bytes of MIDI data in the array to be processed @param {Number} timestamp the timestamp of the message (based on {@link java.lang.System#nanoTime} @throws IOException */ onSend : function( ) {}, /**Instructs the receiver to discard all pending MIDI data. @throws IOException */ flush : function( ) {}, /**Called when the receiver is instructed to discard all pending MIDI data. Subclasses should override this method if they maintain a list or queue of MIDI data to be processed in the future. @throws IOException */ onFlush : function( ) {}, /**Returns the maximum size of a message this receiver can receive. @return {Number} maximum message size */ getMaxMessageSize : function( ) {}, /**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 {@link #onSend} if count exceeds {@link #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. @param {Object {byte[]}} msg a byte array containing the MIDI data @param {Number} offset the offset of the first byte of the data in the array to be sent @param {Number} count the number of bytes of MIDI data in the array to be sent @throws IOException if the data could not be sent in entirety */ send : function( ) {}, /**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 {@link #onSend} if count exceeds {@link #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. @param {Object {byte[]}} msg a byte array containing the MIDI data @param {Number} offset the offset of the first byte of the data in the array to be sent @param {Number} count the number of bytes of MIDI data in the array to be sent @param {Number} timestamp the timestamp of the message, based on {@link java.lang.System#nanoTime} @throws IOException if the data could not be sent in entirety */ send : function( ) {}, };