Jack2  1.9.10
Public Member Functions
Jack::JackMidiAsyncQueue Class Reference

#include <JackMidiAsyncQueue.h>

Inheritance diagram for Jack::JackMidiAsyncQueue:
Jack::JackMidiReadQueue Jack::JackMidiWriteQueue Jack::JackMidiAsyncWaitQueue

List of all members.

Public Member Functions

 JackMidiAsyncQueue (size_t max_bytes=4096, size_t max_messages=1024)
virtual jack_midi_event_tDequeueEvent ()
virtual EnqueueResult EnqueueEvent (jack_nframes_t time, size_t size, jack_midi_data_t *buffer)
size_t GetAvailableSpace ()

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Jack::JackMidiWriteQueue::EnqueueResult JackMidiAsyncQueue::EnqueueEvent ( jack_nframes_t  time,
size_t  size,
jack_midi_data_t *  buffer 
) [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.

Returns the maximum size event that can be enqueued right *now*.

Definition at line 92 of file JackMidiAsyncQueue.cpp.


The documentation for this class was generated from the following files: