CFugue
|
MIDI Driver for Linux Alsa based machines More...
#include <AlsaDriver.h>
Inherits MIDIDriver.
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
Definition at line 30 of file AlsaDriver.h.
Enumerator | |
---|---|
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. |
Definition at line 79 of file AlsaDriver.h.
bool CFugue::MIDIDriverAlsa::OpenMIDIInPort | ( | int | id | ) |
Opens the MIDI input port with the given ID
Definition at line 35 of file AlsaDriver.cpp.
bool CFugue::MIDIDriverAlsa::OpenMIDIOutPort | ( | int | id | ) |
Opens the MIDI output port with the given ID
Definition at line 70 of file AlsaDriver.cpp.
bool CFugue::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 |
Definition at line 151 of file AlsaDriver.cpp.
void CFugue::MIDIDriverAlsa::StopTimer | ( | ) |
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.
Definition at line 173 of file AlsaDriver.cpp.
void CFugue::MIDIDriverAlsa::WaitTillDone | ( | ) |
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.
Definition at line 161 of file AlsaDriver.cpp.
CFugue, the C++ Music Programming Library | © Copyright 2009 Cenacle Research India Private Limited | Gopalakrishna Palem |