CFugue
Parser.cpp
1 /*
2  This is part of CFugue, a C++ Runtime for MIDI Score Programming
3  Copyright (C) 2009 Gopalakrishna Palem
4 
5  For links to further information, or to contact the author,
6  see <http://cfugue.sourceforge.net/>.
7 */
8 
9 #include "stdafx.h"
10 
11 #include "ParserListener.h"
12 #include "Parser.h"
13 
14 namespace CFugue
15 {
17  {
18  //TODO: Add All Listeners
19  //evController;
20  //evMeasure;
21  //evChannelPressure;
22  //evPolyphonicPressure;
23  //evPitchBend;
24  evInstrument.Subscribe(pListener, &CParserListener::OnInstrumentEvent);
25  evKeySignature.Subscribe(pListener, &CParserListener::OnKeySignatureEvent);
26  evLayer.Subscribe(pListener, &CParserListener::OnLayerEvent); // Parser encountered a Layer command
27  evTempo.Subscribe(pListener, &CParserListener::OnTempoEvent); // Parser encountered a Tempo command
28  evTime.Subscribe(pListener, &CParserListener::OnTimeEvent); // Parser encountered a Time command
29  evVoice.Subscribe(pListener, &CParserListener::OnVoiceEvent); // Parser encountered a Voice command
30  evNote.Subscribe(pListener, &CParserListener::OnNoteEvent);
31  //evSequentialNote; // Encountered a Sequential note after a first note
32  //evParalleNote; // Encountered a Parallel note after a first note
33  }
34 
36  {
37  //evController;
38  //evMeasure;
39  //evChannelPressure;
40  //evPolyphonicPressure;
41  //evPitchBend;
42  evInstrument.UnSubscribe(pListener);
43  evKeySignature.UnSubscribe(pListener);
44  evLayer.UnSubscribe(pListener);
45  evTempo.UnSubscribe(pListener);
46  evTime.UnSubscribe(pListener);
47  evVoice.UnSubscribe(pListener);
48  evNote.UnSubscribe(pListener);
49  //evSequentialNote; // Encountered a Sequential note after a first note
50  //evParalleNote; // Encountered a Parallel note after a first note
51  }
52 
53 } // namespace
OIL::CEventT< const CParser, const Voice > evVoice
Event Raised when Parser encounters a Voice command.
Definition: Parser.h:77
void AddListener(CParserListener *pListener)
Subscribes a Listener object for all events
Definition: Parser.cpp:16
void RemoveListener(CParserListener *pListener)
UnSubscribes the Listener Object from the events
Definition: Parser.cpp:35
OIL::CEventT< const CParser, const Tempo > evTempo
Event Raised when Parser encounters a Tempo command.
Definition: Parser.h:75
OIL::CEventT< const CParser, const KeySignature > evKeySignature
Event Raised when Parser encounters a Key Signature command.
Definition: Parser.h:69
OIL::CEventT< const CParser, const Note > evNote
Event Raised when Parser encounters a Note.
Definition: Parser.h:78
OIL::CEventT< const CParser, const Time > evTime
Event Raised when Parser encounters a Time command.
Definition: Parser.h:76
Base class that represents a Renderer Object
OIL::CEventT< const CParser, const Instrument > evInstrument
Event Raised when Parser encounters an Instrument command.
Definition: Parser.h:68
OIL::CEventT< const CParser, const Layer > evLayer
Event Raised when Parser encounters a Layer command.
Definition: Parser.h:70

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