|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jack4j.JackMidiPortBuffer
public class JackMidiPortBuffer
MIDI buffer for JackLocalMidiPort
.
The instance may be obtained with
JackLocalMidiPort.initializeMidiBuffer(int)
, and is only valid
during the current process cycle.
Constructor Summary | |
---|---|
JackMidiPortBuffer(long bufferPointer)
|
Method Summary | |
---|---|
void |
clearBuffer()
Clears an event buffer. |
long |
eventReserve(int time,
int dataSize)
Allocate space for an event to be written to an event port buffer. |
void |
eventWrite(int time,
byte[] data)
Write an event into an event port buffer. |
long |
getBufferPointer()
Native pointer to buffer data. |
JackMidiEvent |
getEvent(int index)
Returns MIDI event from the (input) buffer. |
int |
getEventCount()
Returns current number of MIDI events in the buffer. |
int |
getLostEventsCount()
Returns the number of events that could not be written to port. |
int |
getMaxEventSize()
Returns the size of the largest event that can be stored by the port. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JackMidiPortBuffer(long bufferPointer)
Method Detail |
---|
public long getBufferPointer()
The pointer is packed as long
value.
public int getEventCount()
public JackMidiEvent getEvent(int index) throws JackException
index
- event number, must be non-negative and lower than
getEventCount()
JackException
- if native Jack API failspublic void clearBuffer()
May be called only during client's process callback.
This should be called at the beginning of each process cycle before
calling eventReserve(int, int)
or
eventWrite(int, byte[])
. This function may not be called on an
input port.
public long eventReserve(int time, int dataSize) throws JackException
May be called only during client's process callback.
There's probably no good reason to use this method in Java; use
eventWrite(int, byte[])
instead.
The returned value is a native pointer of type
jack_midi_data_t*
. packed as long.
Clients are to write the actual event data to be written starting at the pointer returned by this function. Clients must not write more than dataSize bytes into this buffer. Clients must write normalized MIDI data to the port - no running status and no (1-byte) realtime messages interspersed with other messages (realtime messages are fine when they occur on their own, like other messages).
time
- sample offset of the event (number of frames since cycle
start)dataSize
- length of event's raw data in bytes
jack_midi_data_t*
packed as long
JackException
- if the error occurrs (native function
jack_midi_event_reserve
returns NULL)public void eventWrite(int time, byte[] data) throws JackException
May be called only during client's process callback.
The data
must be normalized MIDI data - no running status
and no (1-byte) realtime messages interspersed with other messages
(realtime messages are fine when they occur on their own, like other
messages).
time
- sample offset of the event (number of frames since cycle
start)data
- raw MIDI data
JackException
- if error occurrspublic int getMaxEventSize()
May be called only during client's process callback.
public int getLostEventsCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |