A static class that manages computer hardware resources (in and out MIDI ports) and timing.
More...
#include <manager.h>
|
static void | TickProc (tMsecs sys_time_, void *p) |
| This is the main callback, called at every tick of the MIDITimer. More...
|
|
static void | Init () |
| This is the initialization function, called the first time a class method is accessed. More...
|
|
A static class that manages computer hardware resources (in and out MIDI ports) and timing.
It controls the MIDITimer object and embeds a MIDIInDriver or MIDIOutDriver for every hardware port; moreover it manages a queue of MIDITickComponent (objects with a callback procedure to be called at regular pace). When the timer is started the MIDIManager begins to call its main tick procedure at every timer tick; this in turn calls the callback procedure of all the MIDITickComponent objects in the queue; typically one of the MIDITickComponent is a sequencer, which can in this way pick the MIDI messages stored in its internal MIDIMultiTrack object and send them to the out ports. You can add and remove other MIDITickComponent objects with the AddMIDITick() and RemoveMIDITick() methods (for example you could add a MIDIThru or a MIDIRecorder).
◆ MIDIManager()
MIDIManager::MIDIManager |
( |
| ) |
|
|
delete |
The constructor is deleted.
◆ Reset()
static void MIDIManager::Reset |
( |
| ) |
|
|
static |
Stops the timer if it is running, resets all the MIDI in and out ports and flushes the MIDITickComponent queue.
◆ GetNumMIDIIns()
static unsigned int MIDIManager::GetNumMIDIIns |
( |
| ) |
|
|
static |
◆ GetMIDIInName()
static const std::string & MIDIManager::GetMIDIInName |
( |
unsigned int |
n | ) |
|
|
static |
◆ GetInDriver()
static MIDIInDriver * MIDIManager::GetInDriver |
( |
unsigned int |
n | ) |
|
|
static |
◆ IsValidInPortNumber()
static bool MIDIManager::IsValidInPortNumber |
( |
unsigned int |
n | ) |
|
|
static |
Returns true if n is a valid MIDI in port number.
If you call this with 0 as argument and it returns false no MIDI in port is present in the system.
◆ GetNumMIDIOuts()
static unsigned int MIDIManager::GetNumMIDIOuts |
( |
| ) |
|
|
static |
◆ GetMIDIOutName()
static const std::string & MIDIManager::GetMIDIOutName |
( |
unsigned int |
n | ) |
|
|
static |
◆ GetOutDriver()
static MIDIOutDriver * MIDIManager::GetOutDriver |
( |
unsigned int |
n | ) |
|
|
static |
◆ IsValidOutPortNumber()
static bool MIDIManager::IsValidOutPortNumber |
( |
unsigned int |
n | ) |
|
|
static |
Returns true if n is a valid MIDI out port number.
If you call this with 0 as argument and it returns false no MIDI out port is present in the system.
◆ GetSequencer()
Returns the pointer to the (unique) MIDITickComponent in the queue with tPriority PR_SEQ (0 if not found).
◆ OpenInPorts()
static void MIDIManager::OpenInPorts |
( |
| ) |
|
|
static |
◆ CloseInPorts()
static void MIDIManager::CloseInPorts |
( |
| ) |
|
|
static |
◆ OpenOutPorts()
static void MIDIManager::OpenOutPorts |
( |
| ) |
|
|
static |
◆ CloseOutPorts()
static void MIDIManager::CloseOutPorts |
( |
| ) |
|
|
static |
◆ AllNotesOff()
static void MIDIManager::AllNotesOff |
( |
| ) |
|
|
static |
Sends a MIDI AllNotesOff message to all open out ports.
◆ AddMIDITick()
Inserts a MIDITickComponent object into the queue.
The objects are queued according to their tPriority parameter; you can add only one of them with PR_SEQ priority (i.e. a sequencer). Advanced classes (as AdvancedSequencer) auto add themselves to the manager queue when they are created, so they are ready to play. For other MIDITickComponent derived classes you must do this by this method if you want their callback become effective.
◆ RemoveMIDITick()
Removes the given MIDITickComponent pointer from the queue.
It does nothing if the pointer is not in the queue. The destructor of a MIDITickComponent call this before destroying the object, preventing the manager from using an invalid pointer, so usually you don't need to call this.
◆ TickProc()
static void MIDIManager::TickProc |
( |
tMsecs |
sys_time_, |
|
|
void * |
p |
|
) |
| |
|
staticprotected |
This is the main callback, called at every tick of the MIDITimer.
It calls in turn the StaticTickProc() method of every queued MIDITickComponent object with running status. The user must not call it directly.
◆ Init()
static void MIDIManager::Init |
( |
| ) |
|
|
staticprotected |
This is the initialization function, called the first time a class method is accessed.
It creates
The documentation for this class was generated from the following file: