diff options
Diffstat (limited to 'engines/gob/sound')
-rw-r--r-- | engines/gob/sound/bgatmosphere.cpp | 9 | ||||
-rw-r--r-- | engines/gob/sound/bgatmosphere.h | 10 | ||||
-rw-r--r-- | engines/gob/sound/sound.cpp | 3 | ||||
-rw-r--r-- | engines/gob/sound/sound.h | 10 |
4 files changed, 18 insertions, 14 deletions
diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp index 21fb70278a..c7be1be96a 100644 --- a/engines/gob/sound/bgatmosphere.cpp +++ b/engines/gob/sound/bgatmosphere.cpp @@ -23,6 +23,7 @@ #include "common/array.h" #include "gob/sound/bgatmosphere.h" +#include "gob/sound/sound.h" #include "gob/sound/sounddesc.h" namespace Gob { @@ -30,7 +31,7 @@ namespace Gob { BackgroundAtmosphere::BackgroundAtmosphere(Audio::Mixer &mixer) : SoundMixer(mixer, Audio::Mixer::kMusicSoundType), _rnd("gobBA") { - _playMode = kPlayModeLinear; + _playMode = Sound::kPlayModeLinear; _queuePos = -1; _shaded = false; _shadable = true; @@ -56,7 +57,7 @@ void BackgroundAtmosphere::stopBA() { SoundMixer::stop(0); } -void BackgroundAtmosphere::setPlayMode(PlayMode mode) { +void BackgroundAtmosphere::setPlayMode(Sound::BackgroundPlayMode mode) { _playMode = mode; } @@ -100,11 +101,11 @@ void BackgroundAtmosphere::getNextQueuePos() { switch (_playMode) { - case kPlayModeLinear: + case Sound::kPlayModeLinear: _queuePos = (_queuePos + 1) % _queue.size(); break; - case kPlayModeRandom: + case Sound::kPlayModeRandom: _queuePos = _rnd.getRandomNumber(_queue.size() - 1); break; diff --git a/engines/gob/sound/bgatmosphere.h b/engines/gob/sound/bgatmosphere.h index c838a2c2bb..138b65a1c1 100644 --- a/engines/gob/sound/bgatmosphere.h +++ b/engines/gob/sound/bgatmosphere.h @@ -27,6 +27,7 @@ #include "common/mutex.h" #include "common/random.h" +#include "gob/sound/sound.h" #include "gob/sound/soundmixer.h" namespace Audio { @@ -39,18 +40,13 @@ class SoundDesc; class BackgroundAtmosphere : private SoundMixer { public: - enum PlayMode { - kPlayModeLinear, - kPlayModeRandom - }; - BackgroundAtmosphere(Audio::Mixer &mixer); ~BackgroundAtmosphere(); void playBA(); void stopBA(); - void setPlayMode(PlayMode mode); + void setPlayMode(Sound::BackgroundPlayMode mode); void queueSample(SoundDesc &sndDesc); void queueClear(); @@ -60,7 +56,7 @@ public: void unshade(); private: - PlayMode _playMode; + Sound::BackgroundPlayMode _playMode; Common::Array<SoundDesc *> _queue; int _queuePos; diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 22dfe9d3c3..000eafa031 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -28,6 +28,7 @@ #include "gob/game.h" #include "gob/inter.h" +#include "gob/sound/bgatmosphere.h" #include "gob/sound/pcspeaker.h" #include "gob/sound/soundblaster.h" #include "gob/sound/adlplayer.h" @@ -717,7 +718,7 @@ void Sound::bgStop() { _bgatmos->queueClear(); } -void Sound::bgSetPlayMode(BackgroundAtmosphere::PlayMode mode) { +void Sound::bgSetPlayMode(Sound::BackgroundPlayMode mode) { if (!_bgatmos) return; diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h index 6ebc323b18..f1fd46d24b 100644 --- a/engines/gob/sound/sound.h +++ b/engines/gob/sound/sound.h @@ -23,12 +23,13 @@ #ifndef GOB_SOUND_SOUND_H #define GOB_SOUND_SOUND_H +#include "common/str.h" #include "gob/sound/sounddesc.h" -#include "gob/sound/bgatmosphere.h" namespace Gob { class GobEngine; +class BackgroundAtmosphere; class PCSpeaker; class SoundBlaster; class ADLPlayer; @@ -39,6 +40,11 @@ class CDROM; class Sound { public: + enum BackgroundPlayMode { + kPlayModeLinear, + kPlayModeRandom + }; + static const int kSoundsCount = 60; Sound(GobEngine *vm); @@ -135,7 +141,7 @@ public: void bgPlay(const char *base, const char *ext, SoundType type, int count); void bgStop(); - void bgSetPlayMode(BackgroundAtmosphere::PlayMode mode); + void bgSetPlayMode(BackgroundPlayMode mode); void bgShade(); void bgUnshade(); |