-
Notifications
You must be signed in to change notification settings - Fork 2
/
PSpeaker.h
34 lines (25 loc) · 888 Bytes
/
PSpeaker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//==============================================================================
// File: PSpeaker.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __PSpeaker_h__
#define __PSpeaker_h__
#include "messages.h"
// special speaker message sent before the speaker dies
const unsigned long kMessageSpeakerDying = 0xdead;
class PListener;
class PSpeaker {
public:
PSpeaker();
virtual ~PSpeaker();
void Speak(int message, void *dataPt=0);
void AddListener(PListener *aListener);
void RemoveListener(PListener *aListener);
int GetNumListeners() { return mNumListeners; }
private:
PListener ** mListeners;
int mNumListeners;
int mMaxListeners;
};
#endif // __PSpeaker_h__