diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/sound.h | 34 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 7 | ||||
-rw-r--r-- | engines/kyra/sound_towns.cpp | 1 |
5 files changed, 10 insertions, 37 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 302f7277ae..74159dbc00 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -129,6 +129,8 @@ int KyraEngine::init() { } } + if (_sound) + _sound->updateVolumeSettings(); _res = new Resource(this); assert(_res); _res->reset(); @@ -350,6 +352,8 @@ void KyraEngine::setVolume(kVolumeEntry vol, uint8 value) { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); + if (_sound) + _sound->updateVolumeSettings(); } uint8 KyraEngine::getVolume(kVolumeEntry vol) { diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 3031987aba..bc317564d0 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -196,7 +196,6 @@ int KyraEngine_v1::init() { if (!_sound->init()) error("Couldn't init sound"); - _sound->setVolume(255); _sound->loadSoundFile(0); setupButtonData(); diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index b786c9e013..11c5bf6ad6 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -82,22 +82,9 @@ public: virtual void process() {} /** - * Set the volume of the device. - * - * @param volume value between 0 and 255 - * - * @see getVolume + * Updates internal volume settings according to ConfigManager */ - virtual void setVolume(int volume) = 0; - - /** - * Returns the current volume. - * - * @return volume - * - * @see setVolume - */ - virtual int getVolume() = 0; + virtual void updateVolumeSettings() {} /** * Sets the soundfiles the output device will use @@ -237,9 +224,6 @@ public: bool init(); void process(); - void setVolume(int volume); - int getVolume(); - void loadSoundFile(uint file); void playTrack(uint8 track); @@ -291,8 +275,7 @@ public: bool init() { return true; } - void setVolume(int volume); - int getVolume() { return _volume; } + void updateVolumeSettings() { /*XXX*/ } void loadSoundFile(uint file); @@ -322,6 +305,8 @@ public: bool isMT32() { return _nativeMT32; } private: + void setVolume(int vol); + void playMusic(uint8 *data, uint32 size); void stopMusic(); void loadSoundEffectFile(uint file); @@ -361,9 +346,6 @@ public: bool init(); void process(); - void setVolume(int) {} - int getVolume() { return 255; } - void loadSoundFile(uint file); void playTrack(uint8 track); @@ -419,9 +401,6 @@ public: bool init(); void process(); - void setVolume(int) {} - int getVolume() { return 255; } - void loadSoundFile(uint file) {} void playTrack(uint8 track); @@ -448,8 +427,7 @@ public: bool init() { return (_music->init() && _sfx->init()); } void process() { _music->process(); _sfx->process(); } - void setVolume(int volume) { _music->setVolume(volume); _sfx->setVolume(volume); } - int getVolume() { return _music->getVolume(); } + void updateVolumeSettings() { _music->updateVolumeSettings(); _sfx->updateVolumeSettings(); } void setSoundList(const AudioDataStruct * list) { _music->setSoundList(list); _sfx->setSoundList(list); } void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index df37c75426..dea54e37a0 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -2253,13 +2253,6 @@ void SoundAdlibPC::process() { } } -void SoundAdlibPC::setVolume(int volume) { -} - -int SoundAdlibPC::getVolume() { - return 0; -} - void SoundAdlibPC::playTrack(uint8 track) { if (_musicEnabled) { // WORKAROUND: There is a bug in the Kyra 1 "Pool of Sorrow" diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 88651fbb5a..1a79c646d1 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -1156,7 +1156,6 @@ void SoundTowns::haltTrack() { _parser->unloadMusic(); delete _parser; _parser = 0; - setVolume(255); } _driver->queue()->release(); } |