MIDI Driver for Linux Alsa based machines More...
#include <AlsaDriver.h>
Public Types | |
enum | BGThreadStatus { RUNNING, COMPLETED, INVALID } |
Public Member Functions | |
MIDIDriverAlsa (int queue_size) | |
void | ResetMIDIOut () |
bool | StartTimer (int resolution_ms) |
void | WaitTillDone () |
void | StopTimer () |
bool | OpenMIDIInPort (int id) |
bool | OpenMIDIOutPort (int id) |
void | CloseMIDIInPort () |
Closed any previously opened MIDI Input port. | |
void | CloseMIDIOutPort () |
Closed any previously opened MIDI Output port. | |
Protected Member Functions | |
bool | HardwareMsgOut (const jdkmidi::MIDITimedBigMessage &msg) |
Protected Attributes | |
std::thread * | m_pThread |
int | timer_id |
int | timer_res |
MIDI Driver for Linux Alsa based machines
RUNNING |
Async procedure is running - use WaitTillDone() to wait for completion. |
COMPLETED |
Async procedure completed running - use StopTimer() to finish. |
INVALID |
No background procedure running - use StartTimer() to start one. |
bool MusicNoteLib::MIDIDriverAlsa::OpenMIDIInPort | ( | int | id | ) |
Opens the MIDI input port with the given ID
bool MusicNoteLib::MIDIDriverAlsa::OpenMIDIOutPort | ( | int | id | ) |
Opens the MIDI output port with the given ID
Referenced by MusicNoteLib::MIDIRenderer::BeginPlayAsync().
bool MusicNoteLib::MIDIDriverAlsa::StartTimer | ( | int | resolution_ms | ) |
Creates a background thread to pump MIDI events at the supplied timer resolution. Use WaitTillDone() to wait till the background processing completes. Use StopTimer() after the background processing is completed, to release resources.
resolution_ms | MIDI Timer resolution in milliseconds |
Referenced by MusicNoteLib::MIDIRenderer::BeginPlayAsync().
Call StopTimer() to release the resources used by the background procedure created with StartTimer(). StopTimer() Should be called after the background procedure is done (indicated by BGThreadStatus::COMPLETED). If background procedure is still running while StopTimer() is called, caller gets blocked till the background procedure completes. If no background procedure exists, returns immediately.
Referenced by MusicNoteLib::MIDIRenderer::EndPlayAsync().
Waits (blocks) till the background thread created with StartTimer() completes its processing. After StartTimer() succeeds, use WaitTillDone() followed by StopTimer(). Returns immediately if no background thread is running.
Referenced by MusicNoteLib::MIDIRenderer::WaitTillDone().
CFugue, the C++ Music Programming Library | © Copyright 2009 CineFx Digital Media Pvt Ltd. | Gopalakrishna Palem |