From b99153050a8bb909c6d20b01cb6b5e8ba3224483 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Wed, 15 Aug 2007 18:37:52 +0000 Subject: [PATCH] Moved AgiSound definition around and also changed it from a struct to a class. svn-id: r28629 --- engines/agi/agi.cpp | 2 +- engines/agi/sound.h | 40 ++++++++++++++++------------------------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 1c1c53dee7f..ee3e2f36e07 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -370,7 +370,7 @@ int AgiEngine::agiInit() { memset(&_game.views[i], 0, sizeof(struct AgiView)); memset(&_game.pictures[i], 0, sizeof(struct AgiPicture)); memset(&_game.logics[i], 0, sizeof(struct AgiLogic)); - memset(&_game.sounds[i], 0, sizeof(struct AgiSound)); + memset(&_game.sounds[i], 0, sizeof(class AgiSound)); memset(&_game.dirView[i], 0, sizeof(struct AgiDir)); memset(&_game.dirPic[i], 0, sizeof(struct AgiDir)); memset(&_game.dirLogic[i], 0, sizeof(struct AgiDir)); diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 2b5c045969c..ccc63d2fdc4 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -47,30 +47,6 @@ namespace Agi { #define ENV_RELEASE 7500 /**< envelope release rate */ #define NUM_CHANNELS 7 /**< number of sound channels */ -/** - * AGI sound resource structure. - */ -struct AgiSound { - uint32 flen; /**< size of raw data */ - uint8 *rdata; /**< raw sound data */ - uint16 type; /**< sound resource type */ - - void play() { - _isPlaying = true; - } - - void stop() { - _isPlaying = false; - } - - bool isPlaying() { - return _isPlaying; - } - -private: - bool _isPlaying; ///< Is the sound playing? -}; - struct IIgsEnvelopeSegment { uint8 bp; uint16 inc; ///< 8b.8b fixed point, big endian? @@ -223,6 +199,22 @@ struct ChannelInfo { uint32 env; }; +/** + * AGI sound resource structure. + */ +class AgiSound { +public: + uint32 flen; /**< size of raw data */ + uint8 *rdata; /**< raw sound data */ + uint16 type; /**< sound resource type */ + + virtual void play() { _isPlaying = true; } + virtual void stop() { _isPlaying = false; } + virtual bool isPlaying() { return _isPlaying; } +protected: + bool _isPlaying; ///< Is the sound playing? +}; + /** Apple IIGS AGI instrument set information. */ struct instrumentSetInfo { uint byteCount; ///< Length of the whole instrument set in bytes