Takes care of Rendering MIDI Output either to a file or to a MIDI out Port More...
#include <MIDIRenderer.h>
Inherits MusicNoteLib::MIDIEventManager, and MusicNoteLib::CParserListener.
Public Member Functions | |
void | Clear () |
bool | BeginPlayAsync (int nMIDIOutPortID=MIDI_MAPPER, unsigned int nTimerResolutionMS=20) |
void | EndPlayAsync () |
void | WaitTillDone () |
bool | IsPlaying () const |
bool | SaveToFile (const char *szOutputFilePath) |
Takes care of Rendering MIDI Output either to a file or to a MIDI out Port
bool MusicNoteLib::MIDIRenderer::BeginPlayAsync | ( | int | nMIDIOutPortID = MIDI_MAPPER , |
unsigned int | nTimerResolutionMS = 20 |
||
) |
Starts Rendering the MIDI output to MIDI port. Each BeingPlayAsync call should have a matching EndPlayAsync call (no matter success or failure).
nMIDIOutPortID | is the ID of the MIDI output port to open for play. |
nTimerResolutionMS | is the required minimum resolution for the MIDI timer (in MilliSeconds). |
References MusicNoteLib::MidiTimer::CurrentTimeOffset(), MusicNoteLib::MIDIDriverAlsa::OpenMIDIOutPort(), and MusicNoteLib::MIDIDriverAlsa::StartTimer().
Referenced by MusicNoteLib::Player::PlayAsync().
void MusicNoteLib::MIDIRenderer::Clear | ( | ) |
Clears the current state of the Renderer. Empties all the stored tracks and notes.
Reimplemented from MusicNoteLib::MIDIEventManager.
References EndPlayAsync().
Referenced by MusicNoteLib::Player::PlayAsync(), and MusicNoteLib::Player::SaveAsMidiFile().
Stops Rendering the MIDI output to MIDI port. Each BeingPlayAsync call should have a matching EndPlayAsync call.
References MusicNoteLib::MIDIDriverAlsa::CloseMIDIOutPort(), and MusicNoteLib::MIDIDriverAlsa::StopTimer().
Referenced by Clear(), and MusicNoteLib::Player::StopPlay().
bool MusicNoteLib::MIDIRenderer::IsPlaying | ( | ) | const |
Indicates if the MIDI output is still being rendered (to MIDI Port) or finished.
Referenced by MusicNoteLib::Player::IsPlaying(), and WaitTillDone().
bool MusicNoteLib::MIDIRenderer::SaveToFile | ( | const char * | szOutputFilePath | ) |
Saves the current track/sequencer content to a MIDI Output file
Referenced by MusicNoteLib::Player::SaveAsMidiFile(), and MusicNoteLib::Player::SaveToMidiFile().
After starting MIDI play with BeginPlayAsync(), use WaitTillDone() to wait till the play is done. Caller gets blocked until completion. Returns immediately if no play is in progress. After WaitTillDone() returns, use EndPlayAsync() to release the resources. In case you do want to know the status without geting blocked, use IsPlaying() method.
References IsPlaying(), and MusicNoteLib::MIDIDriverAlsa::WaitTillDone().
Referenced by MusicNoteLib::Player::Play(), and MusicNoteLib::Player::WaitTillDone().
CFugue, the C++ Music Programming Library | © Copyright 2009 CineFx Digital Media Pvt Ltd. | Gopalakrishna Palem |