From e9269257f3da947eca3fb167b279fbe91650157a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 24 Dec 2003 00:25:18 +0000 Subject: turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them svn-id: r11881 --- sound/mixer.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sound/mixer.h') diff --git a/sound/mixer.h b/sound/mixer.h index 3ed2cd798f..d1bd379408 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -35,12 +35,22 @@ #endif -typedef uint32 PlayingSoundHandle; - class AudioInputStream; class Channel; class File; +class PlayingSoundHandle { + friend class Channel; + friend class SoundMixer; + int val; + int getIndex() const { return val - 1; } + void setIndex(int i) { val = i + 1; } + void resetIndex() { val = 0; } +public: + PlayingSoundHandle() { resetIndex(); } + bool isActive() const { return val > 0; } +}; + class SoundMixer { public: typedef void PremixProc (void *param, int16 *data, uint len); -- cgit v1.2.3