From 67b311713d8f4cfcd460a9649e0075f24278a048 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 27 Dec 2004 00:27:00 +0000 Subject: Added 'sound types' to the mixer - for now, only plain (for the premixer), SFX and music; volume is now controlled based on the sound type svn-id: r16330 --- sword1/credits.cpp | 2 +- sword1/sound.cpp | 4 ++-- sword1/sword1.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sword1') diff --git a/sword1/credits.cpp b/sword1/credits.cpp index 75fc8b2060..ab454cb9a5 100644 --- a/sword1/credits.cpp +++ b/sword1/credits.cpp @@ -109,7 +109,7 @@ void CreditsPlayer::play(void) { // everything's initialized, time to render and show the credits. PlayingSoundHandle bgSound; - _mixer->playInputStream(&bgSound, bgSoundStream, true, 0); + _mixer->playInputStream(SoundMixer::kMusicAudioDataType, &bgSound, bgSoundStream, 0); int relDelay = 0; uint16 scrollY = 0; diff --git a/sword1/sound.cpp b/sword1/sound.cpp index e409af5e02..5f976e49f2 100644 --- a/sword1/sound.cpp +++ b/sword1/sound.cpp @@ -194,7 +194,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { #ifdef USE_MAD else if (_cowMode == CowMp3) { _cowFile.seek(index); - _mixer->playInputStream(&_speechHandle, makeMP3Stream(&_cowFile, sampleSize), false, SOUND_SPEECH_ID, speechVol, speechPan); + _mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_speechHandle, makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); // with compressed audio, we can't calculate the wave volume. // so default to talking. for (int cnt = 0; cnt < 480; cnt++) @@ -205,7 +205,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { #ifdef USE_VORBIS else if (_cowMode == CowVorbis) { _cowFile.seek(index); - _mixer->playInputStream(&_speechHandle, makeVorbisStream(&_cowFile, sampleSize), false, SOUND_SPEECH_ID, speechVol, speechPan); + _mixer->playInputStream(SoundMixer::kSFXAudioDataType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); for (int cnt = 0; cnt < 480; cnt++) _waveVolume[cnt] = true; _waveVolPos = 0; diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp index 218c6a7ee0..4bafa81544 100644 --- a/sword1/sword1.cpp +++ b/sword1/sword1.cpp @@ -165,8 +165,8 @@ int SwordEngine::init(GameDetector &detector) { _resMan = new ResMan("swordres.rif"); debug(5, "Starting object manager"); _objectMan = new ObjectMan(_resMan); - _mixer->setVolume(255); - _mixer->setMusicVolume(256); + _mixer->setVolumeForSoundType(SoundMixer::kSFXAudioDataType, 256); + _mixer->setVolumeForSoundType(SoundMixer::kMusicAudioDataType, 256); _mouse = new Mouse(_system, _resMan, _objectMan); _screen = new Screen(_system, _resMan, _objectMan); _music = new Music(_system, _mixer); -- cgit v1.2.3