diff options
-rw-r--r-- | engines/sherlock/music.cpp | 5 | ||||
-rw-r--r-- | engines/sherlock/music.h | 2 | ||||
-rw-r--r-- | engines/sherlock/sound.cpp | 13 | ||||
-rw-r--r-- | engines/sherlock/sound.h | 3 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_map.cpp | 1 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_scene.cpp | 1 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_options.cpp | 7 |
7 files changed, 12 insertions, 20 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index ccaa6a4b86..99f7b45617 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -574,8 +574,9 @@ bool Music::waitUntilMSec(uint32 msecTarget, uint32 msecMax, uint32 additionalDe } } -void Music::setMIDIVolume(int volume) { - warning("TODO: Music::setMIDIVolume"); +void Music::setMusicVolume(int volume) { + _musicVolume = volume; + _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume); } } // End of namespace Sherlock diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index 66057050e0..ca203da019 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -120,7 +120,7 @@ public: /** * Sets the volume of the MIDI music with a value ranging from 0 to 127 */ - void setMIDIVolume(int volume); + void setMusicVolume(int volume); }; } // End of namespace Sherlock diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp index 72dbfdeab7..fd51462bc0 100644 --- a/engines/sherlock/sound.cpp +++ b/engines/sherlock/sound.cpp @@ -142,7 +142,7 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit } Audio::SoundHandle soundHandle = (IS_SERRATED_SCALPEL) ? _scalpelEffectsHandle : getFreeSoundHandle(); - if (!playSoundResource(filename, libraryFilename, Audio::Mixer::kPlainSoundType, soundHandle, Audio::Mixer::kMaxChannelVolume)) + if (!playSoundResource(filename, libraryFilename, Audio::Mixer::kSFXSoundType, soundHandle)) error("Could not find sound resource - %s", filename.c_str()); _soundPlaying = true; @@ -194,11 +194,6 @@ void Sound::stopSound() { } } -void Sound::stopSndFuncPtr(int v1, int v2) { - // TODO - warning("TODO: Sound::stopSndFuncPtr"); -} - void Sound::freeDigiSound() { _soundPlaying = false; } @@ -240,7 +235,7 @@ void Sound::playSpeech(const Common::String &name) { // Ensure the given library is in the cache res.addToCache(libraryName); - if (playSoundResource(name, libraryName, Audio::Mixer::kSpeechSoundType, _speechHandle, Audio::Mixer::kMaxChannelVolume)) + if (playSoundResource(name, libraryName, Audio::Mixer::kSpeechSoundType, _speechHandle)) _speechPlaying = true; } @@ -255,7 +250,7 @@ bool Sound::isSpeechPlaying() { } bool Sound::playSoundResource(const Common::String &name, const Common::String &libFilename, - Audio::Mixer::SoundType soundType, Audio::SoundHandle &handle, int volume) { + Audio::Mixer::SoundType soundType, Audio::SoundHandle &handle) { Resources &res = *_vm->_res; Common::SeekableReadStream *stream = libFilename.empty() ? res.load(name) : res.load(name, libFilename, true); if (!stream) @@ -300,7 +295,7 @@ bool Sound::playSoundResource(const Common::String &name, const Common::String & if (!audioStream) return false; - _mixer->playStream(soundType, &handle, audioStream, -1, volume); + _mixer->playStream(soundType, &handle, audioStream, -1, Audio::Mixer::kMaxChannelVolume); return true; } diff --git a/engines/sherlock/sound.h b/engines/sherlock/sound.h index 5654c50f6a..b2d1584e85 100644 --- a/engines/sherlock/sound.h +++ b/engines/sherlock/sound.h @@ -59,7 +59,7 @@ private: * Handle playing a sound or speech */ bool playSoundResource(const Common::String &name, const Common::String &libFilename, - Audio::Mixer::SoundType soundType, Audio::SoundHandle &handle, int volume); + Audio::Mixer::SoundType soundType, Audio::SoundHandle &handle); public: bool _digitized; int _voices; @@ -103,7 +103,6 @@ public: */ void stopSound(); - void stopSndFuncPtr(int v1, int v2); void freeDigiSound(); Audio::SoundHandle getFreeSoundHandle(); diff --git a/engines/sherlock/tattoo/tattoo_map.cpp b/engines/sherlock/tattoo/tattoo_map.cpp index 53a366b319..95858aef26 100644 --- a/engines/sherlock/tattoo/tattoo_map.cpp +++ b/engines/sherlock/tattoo/tattoo_map.cpp @@ -81,7 +81,6 @@ int TattooMap::show() { song = "Cue7"; if (music.loadSong(song)) { - music.setMIDIVolume(music._musicVolume); if (music._musicOn) music.startSong(); } diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp index 9c76df0b51..78100ebd99 100644 --- a/engines/sherlock/tattoo/tattoo_scene.cpp +++ b/engines/sherlock/tattoo/tattoo_scene.cpp @@ -94,7 +94,6 @@ bool TattooScene::loadScene(const Common::String &filename) { // If it's a new song, then start it up if (music._currentSongName.compareToIgnoreCase(music._nextSongName)) { if (music.loadSong(music._nextSongName)) { - music.setMIDIVolume(music._musicVolume); if (music._musicOn) music.startSong(); } diff --git a/engines/sherlock/tattoo/widget_options.cpp b/engines/sherlock/tattoo/widget_options.cpp index 574f6a896f..5dc6fc55b9 100644 --- a/engines/sherlock/tattoo/widget_options.cpp +++ b/engines/sherlock/tattoo/widget_options.cpp @@ -112,10 +112,9 @@ void WidgetOptions::handleEvents() { if (_midiSliderX > _bounds.width() - _surface.widestChar()) _midiSliderX = _bounds.width() - _surface.widestChar(); - int temp = music._musicVolume; - music._musicVolume = (_midiSliderX - _surface.widestChar()) * 255 / (_bounds.width() - _surface.widestChar() * 2); - if (music._musicVolume != temp) { - music.setMIDIVolume(music._musicVolume); + int newVolume = (_midiSliderX - _surface.widestChar()) * 255 / (_bounds.width() - _surface.widestChar() * 2); + if (newVolume != music._musicVolume) { + music.setMusicVolume(newVolume); vm.saveConfig(); } |