CFugue
Public Member Functions | List of all members
CFugue::MIDIRenderer Class Reference

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

#include <MidiRenderer.h>

Inherits CFugue::MIDIEventManager, and CFugue::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)
 
- Public Member Functions inherited from CFugue::CParserListener
virtual void OnMeasureEvent (const CParser *pParser, OIL::CEventHandlerArgs *pArgs)
 

Detailed Description

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

Definition at line 31 of file MidiRenderer.h.

Member Function Documentation

bool CFugue::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.

Definition at line 55 of file MidiRenderer.cpp.

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

void CFugue::MIDIRenderer::Clear ( )

Clears the current state of the Renderer. Empties all the stored tracks and notes.

Definition at line 48 of file MidiRenderer.cpp.

Referenced by CFugue::Player::PlayAsync(), and CFugue::Player::SaveAsMidiFile().

void CFugue::MIDIRenderer::EndPlayAsync ( )

Stops Rendering the MIDI output to MIDI port. Each BeingPlayAsync call should have a matching EndPlayAsync call.

Definition at line 73 of file MidiRenderer.cpp.

Referenced by CFugue::Player::StopPlay().

bool CFugue::MIDIRenderer::IsPlaying ( ) const

Indicates if the MIDI output is still being rendered (to MIDI Port) or finished.

Definition at line 118 of file MidiRenderer.h.

Referenced by CFugue::Player::IsPlaying().

bool CFugue::MIDIRenderer::SaveToFile ( const char *  szOutputFilePath)

Saves the current track/sequencer content to a MIDI Output file

Definition at line 89 of file MidiRenderer.cpp.

Referenced by CFugue::Player::SaveAsMidiFile(), and CFugue::Player::SaveToMidiFile().

void CFugue::MIDIRenderer::WaitTillDone ( )

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.

Definition at line 80 of file MidiRenderer.cpp.

Referenced by CFugue::Player::Play(), and CFugue::Player::WaitTillDone().


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

CFugue, the C++ Music Programming Library © Copyright 2009 Cenacle Research India Private Limited Gopalakrishna Palem