Jack2
1.9.9
|
#include <JackMidiAsyncQueue.h>
Public Member Functions | |
JackMidiAsyncQueue (size_t max_bytes=4096, size_t max_messages=1024) | |
virtual jack_midi_event_t * | DequeueEvent () |
virtual EnqueueResult | EnqueueEvent (jack_nframes_t time, size_t size, jack_midi_data_t *buffer) |
size_t | GetAvailableSpace () |
![]() | |
EnqueueResult | EnqueueEvent (jack_midi_event_t *event, jack_nframes_t frame_offset=0) |
Additional Inherited Members | |
![]() | |
enum | EnqueueResult { BUFFER_FULL, BUFFER_TOO_SMALL, EVENT_EARLY, EN_ERROR, OK } |
This is a MIDI message queue designed to allow one thread to pass MIDI messages to another thread (though it can also be used to buffer events internally). This is especially useful if the MIDI API you're attempting to interface with doesn't provide the ability to schedule MIDI events ahead of time and/or has blocking send/receive calls, as it allows a separate thread to handle input/output while the JACK process thread copies events from a MIDI buffer to this queue, or vice versa.
Definition at line 40 of file JackMidiAsyncQueue.h.
JackMidiAsyncQueue::JackMidiAsyncQueue | ( | size_t | max_bytes = 4096 , |
size_t | max_messages = 1024 |
||
) |
Creates a new asynchronous MIDI message queue. The queue can store up to max_messages
MIDI messages and up to max_bytes
of MIDI data before it starts rejecting messages.
Definition at line 26 of file JackMidiAsyncQueue.cpp.
|
virtual |
Dequeues and returns a MIDI event. Returns '0' if there are no MIDI events available. This method may be overridden.
Implements Jack::JackMidiReadQueue.
Reimplemented in Jack::JackMidiAsyncWaitQueue.
Definition at line 53 of file JackMidiAsyncQueue.cpp.
|
virtual |
Enqueues the MIDI event specified by the arguments. The return value indiciates whether or not the event was successfully enqueued. This method may be overridden.
Implements Jack::JackMidiWriteQueue.
Reimplemented in Jack::JackMidiAsyncWaitQueue.
Definition at line 72 of file JackMidiAsyncQueue.cpp.
size_t JackMidiAsyncQueue::GetAvailableSpace | ( | ) |
Returns the maximum size event that can be enqueued right now.
Definition at line 92 of file JackMidiAsyncQueue.cpp.