Jack2: Jack::JackMidiAsyncWaitQueue Class Reference

Jack2 1.9.12

Public Member Functions | List of all members
Jack::JackMidiAsyncWaitQueue Class Reference

`#include <JackMidiAsyncWaitQueue.h>`

Inheritance diagram for Jack::JackMidiAsyncWaitQueue:

## Public Member Functions
| JackMidiAsyncWaitQueue (size_t max_bytes=4096, size_t max_messages=1024)
jack_midi_event_t * | DequeueEvent ()
jack_midi_event_t * | DequeueEvent (long usecs)
jack_midi_event_t * | DequeueEvent (jack_nframes_t frame)
EnqueueResult | EnqueueEvent (jack_nframes_t time, size_t size, jack_midi_data_t *buffer)
Public Member Functions inherited from Jack::JackMidiAsyncQueue
| JackMidiAsyncQueue (size_t max_bytes=4096, size_t max_messages=1024)
size_t | GetAvailableSpace ()
Public Member Functions inherited from Jack::JackMidiWriteQueue
EnqueueResult | EnqueueEvent (jack_midi_event_t *event, jack_nframes_t frame_offset=0)

## Additional Inherited Members
Public Types inherited from Jack::JackMidiWriteQueue
enum | EnqueueResult { BUFFER_FULL, BUFFER_TOO_SMALL, EVENT_EARLY, EN_ERROR, OK }

## Detailed Description

This is an asynchronous wait queue that allows a thread to wait for a message, either indefinitely or for a specified time. This is one example of a way that the `JackMidiAsyncQueue` class can be extended so that process threads can interact with non-process threads to send MIDI events.

XXX: As of right now, this code hasn't been tested. Also, note the warning in the JackMidiAsyncWaitQueue.cpp about semaphore wait resolution.

Definition at line 39 of file JackMidiAsyncWaitQueue.h.

## Constructor & Destructor Documentation

## ◆ JackMidiAsyncWaitQueue()

JackMidiAsyncWaitQueue::JackMidiAsyncWaitQueue | ( | size_t | max_bytes = `4096`,
|  | size_t | max_messages = `1024`
| ) |  |

Creates a new asynchronous MIDI wait 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 28 of file JackMidiAsyncWaitQueue.cpp.

## Member Function Documentation

## ◆ DequeueEvent() [1/3]

jack_midi_event_t * JackMidiAsyncWaitQueue::DequeueEvent | ( |  | ) |
| virtual

Dequeues and returns a MIDI event. Returns '0' if there are no MIDI events available right now.

Reimplemented from Jack::JackMidiAsyncQueue.

Definition at line 43 of file JackMidiAsyncWaitQueue.cpp.

## ◆ DequeueEvent() [2/3]

jack_midi_event_t * JackMidiAsyncWaitQueue::DequeueEvent | ( | long | usecs | ) |

Waits a specified time for a MIDI event to be available, or indefinitely if the time is negative. Returns the MIDI event, or '0' if time runs out and no MIDI event is available.

Definition at line 69 of file JackMidiAsyncWaitQueue.cpp.

## ◆ DequeueEvent() [3/3]

jack_midi_event_t * JackMidiAsyncWaitQueue::DequeueEvent | ( | jack_nframes_t | frame | ) |

Waits until the specified frame for a MIDI event to be available. Returns the MIDI event, or '0' if time runs out and no MIDI event is available.

Definition at line 49 of file JackMidiAsyncWaitQueue.cpp.

## ◆ EnqueueEvent()

Jack::JackMidiWriteQueue::EnqueueResult JackMidiAsyncWaitQueue::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.

Reimplemented from Jack::JackMidiAsyncQueue.

Definition at line 76 of file JackMidiAsyncWaitQueue.cpp.

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

- JackMidiAsyncWaitQueue.h
- JackMidiAsyncWaitQueue.cpp