diff options
-rw-r--r-- | engines/agi/agi.cpp | 2 | ||||
-rw-r--r-- | 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 1c1c53dee7..ee3e2f36e0 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 2b5c045969..ccc63d2fdc 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 |