Public Member Functions
MusicNoteLib::MIDIRenderer Class Reference

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.

List of all members.

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)

Detailed Description

Takes care of Rendering MIDI Output either to a file or to a MIDI out Port


Member Function Documentation

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).

Parameters:
nMIDIOutPortIDis the ID of the MIDI output port to open for play.
nTimerResolutionMSis the required minimum resolution for the MIDI timer (in MilliSeconds).
Returns:
false if Unable to open MIDI port or unable to create timer with specified resolution.

References MusicNoteLib::MidiTimer::CurrentTimeOffset(), MusicNoteLib::MIDIDriverAlsa::OpenMIDIOutPort(), and MusicNoteLib::MIDIDriverAlsa::StartTimer().

Referenced by MusicNoteLib::Player::PlayAsync().

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().

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().


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

CFugue, the C++ Music Programming Library © Copyright 2009 CineFx Digital Media Pvt Ltd. Gopalakrishna Palem