diff options
| author | Max Horn | 2007-02-03 19:05:53 +0000 |
|---|---|---|
| committer | Max Horn | 2007-02-03 19:05:53 +0000 |
| commit | cb49cbdd456a97c6e10bdc279624603bd9bd7b60 (patch) | |
| tree | d1ef8edbfbe237973b6cdef96434a17c24c9c122 /engines | |
| parent | 9c5e62fb0408aeae98dcc9124c7090453768879d (diff) | |
| download | scummvm-rg350-cb49cbdd456a97c6e10bdc279624603bd9bd7b60.tar.gz scummvm-rg350-cb49cbdd456a97c6e10bdc279624603bd9bd7b60.tar.bz2 scummvm-rg350-cb49cbdd456a97c6e10bdc279624603bd9bd7b60.zip | |
* Reimplemented Mixer::pauseAll to simply invoke pause on all channels
(implying change of semantics)
* Reordered the params of Mixer::playRaw (the SoundType now comes first, not last)
* Removed Mixer::isPaused
* Removed Mixer::getSoundElapsedTimeOfSoundID
* Added some doxygen comments to the Mixer
svn-id: r25356
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/agos/sound.cpp | 10 | ||||
| -rw-r--r-- | engines/queen/sound.cpp | 2 | ||||
| -rw-r--r-- | engines/saga/sound.cpp | 2 | ||||
| -rw-r--r-- | engines/scumm/he/cup_player_he.cpp | 2 | ||||
| -rw-r--r-- | engines/scumm/he/sound_he.cpp | 8 | ||||
| -rw-r--r-- | engines/scumm/sound.cpp | 10 | ||||
| -rw-r--r-- | engines/sky/intro.cpp | 6 | ||||
| -rw-r--r-- | engines/sky/sound.cpp | 8 | ||||
| -rw-r--r-- | engines/sword1/sound.cpp | 4 | ||||
| -rw-r--r-- | engines/sword2/animation.cpp | 2 | ||||
| -rw-r--r-- | engines/sword2/sound.cpp | 2 |
11 files changed, 28 insertions, 28 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 3349f93a77..b6ee6cf02c 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -248,7 +248,7 @@ void VocSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, int size, rate; byte *buffer = Audio::loadVOCFromStream(*_file, size, rate); assert(buffer); - _mixer->playRaw(handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound); } void RawSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte flags, int vol) { @@ -261,7 +261,7 @@ void RawSound::playSound(uint sound, uint loopSound, Audio::SoundHandle *handle, byte *buffer = (byte *)malloc(size); assert(buffer); _file->read(buffer, size); - _mixer->playRaw(handle, buffer, size, 22050, flags | Audio::Mixer::FLAG_AUTOFREE, sound); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, 22050, flags | Audio::Mixer::FLAG_AUTOFREE, sound); } #ifdef USE_MAD @@ -671,9 +671,9 @@ void Sound::playRawData(byte *soundData, uint sound, uint size) { memcpy(buffer, soundData, size); if (_vm->getPlatform() == Common::kPlatformPC) - _mixer->playRaw(&_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE, sound); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE, sound); else - _mixer->playRaw(&_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_AUTOFREE, sound); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_effectsHandle, buffer, size, 8000, Audio::Mixer::FLAG_AUTOFREE, sound); } // Feeble Files specific @@ -737,7 +737,7 @@ void Sound::playSoundData(Audio::SoundHandle *handle, byte *soundData, uint soun memcpy(buffer, soundData + stream.pos(), size); } - _mixer->playRaw(handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound, vol, pan); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, rate, flags | Audio::Mixer::FLAG_AUTOFREE, sound, vol, pan); } void Sound::stopSfx5() { diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index 6cea53f1c1..b416bb953c 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -198,7 +198,7 @@ void SBSound::playSoundData(Common::File *f, uint32 size, Audio::SoundHandle *so if (sound) { f->read(sound, size); byte flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE; - _mixer->playRaw(soundHandle, sound, size, 11025, flags); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, soundHandle, sound, size, 11025, flags); } } diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 37f9cf174f..d528db5add 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -79,7 +79,7 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, SoundBuffer &buffer, int if (!buffer.isSigned) flags |= Audio::Mixer::FLAG_UNSIGNED; - _mixer->playRaw(handle, buffer.buffer, buffer.size, buffer.frequency, flags, -1, volume); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer.buffer, buffer.size, buffer.frequency, flags, -1, volume); } void Sound::playSound(SoundBuffer &buffer, int volume, bool loop) { diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 695d298be6..f2e181fb41 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -169,7 +169,7 @@ void CUP_Player::updateSfx() { flags |= Audio::Mixer::FLAG_LOOP; loopEnd = soundSize - 8; } - _mixer->playRaw(&sfxChannel->handle, soundData + 8, soundSize - 8, 11025, flags, -1, 255, 0, 0, loopEnd); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &sfxChannel->handle, soundData + 8, soundSize - 8, 11025, flags, -1, 255, 0, 0, loopEnd); } } else { warning("Unable to find a free channel to play sound %d", sfx->num); diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 931ef12c95..17cc10c59e 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -535,7 +535,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) musicFile.close(); if (_vm->_game.heversion == 70) { - _mixer->playRaw(&_heSoundChannels[heChannel], spoolPtr, size, 11025, flags, soundID, 255, 0, 0,0, type); + _mixer->playRaw(type, &_heSoundChannels[heChannel], spoolPtr, size, 11025, flags, soundID, 255, 0, 0, 0); return; } } @@ -586,7 +586,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) } _mixer->stopHandle(_heSoundChannels[heChannel]); - _mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID, 255, 0, 0,0, type); + _mixer->playRaw(type, &_heSoundChannels[heChannel], sound, size, rate, flags, soundID, 255, 0, 0,0); } // Support for sound in Humongous Entertainment games else if (READ_BE_UINT32(ptr) == MKID_BE('DIGI') || READ_BE_UINT32(ptr) == MKID_BE('TALK')) { @@ -642,7 +642,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) } _mixer->stopHandle(_heSoundChannels[heChannel]); - _mixer->playRaw(&_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID, 255, 0, 0,0, type); + _mixer->playRaw(type, &_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID, 255, 0, 0,0); } // Support for PCM music in 3DO versions of Humongous Entertainment games @@ -660,7 +660,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags) _mixer->stopID(_currentMusic); _currentMusic = soundID; - _mixer->playRaw(NULL, ptr + 8, size, rate, flags, soundID, 255, 0, 0,0, Audio::Mixer::kMusicSoundType); + _mixer->playRaw(Audio::Mixer::kMusicSoundType, NULL, ptr + 8, size, rate, flags, soundID, 255, 0, 0,0); } else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) { if (_vm->_imuse) { diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 8a71b455e9..bde14d3c55 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -188,7 +188,7 @@ void Sound::playSound(int soundID) { // Allocate a sound buffer, copy the data into it, and play sound = (char *)malloc(size); memcpy(sound, ptr, size); - _mixer->playRaw(NULL, sound, size, rate, flags, soundID); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, flags, soundID); } // WORKAROUND bug # 1311447 else if (READ_BE_UINT32(ptr) == 0x460e200d) { @@ -210,7 +210,7 @@ void Sound::playSound(int soundID) { // Allocate a sound buffer, copy the data into it, and play sound = (char *)malloc(size); memcpy(sound, ptr, size); - _mixer->playRaw(NULL, sound, size, rate, flags, soundID); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, flags, soundID); } // Support for sampled sound effects in Monkey Island 1 and 2 else if (READ_BE_UINT32(ptr) == MKID_BE('SBL ')) { @@ -281,7 +281,7 @@ void Sound::playSound(int soundID) { // Allocate a sound buffer, copy the data into it, and play sound = (char *)malloc(size); memcpy(sound, ptr + 6, size); - _mixer->playRaw(NULL, sound, size, rate, flags, soundID); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, flags, soundID); } else if ((_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 3) || READ_BE_UINT32(ptr) == MKID_BE('SOUN') || READ_BE_UINT32(ptr) == MKID_BE('TOWS')) { @@ -334,7 +334,7 @@ void Sound::playSound(int soundID) { if (loopEnd > 0) flags |= Audio::Mixer::FLAG_LOOP; - _mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd); } break; case 1: @@ -395,7 +395,7 @@ void Sound::playSound(int soundID) { sound = (char *)malloc(size); int vol = ptr[24] * 4; memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size); - _mixer->playRaw(NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0); } else { diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 6c50ea9804..55143d7f86 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -740,7 +740,7 @@ bool Intro::nextPart(uint16 *&data) { // probably use _skySound instead of calling playRaw() // directly, but this will have to do for now. memset(vData, 127, sizeof(struct dataFileHeader)); - _mixer->playRaw(&_voice, vData, _skyDisk->_lastLoadedFileSize, 11025, + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_voice, vData, _skyDisk->_lastLoadedFileSize, 11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED, SOUND_VOICE); return true; case WAITVOICE: @@ -757,12 +757,12 @@ bool Intro::nextPart(uint16 *&data) { return true; case LOOPBG: _mixer->stopID(SOUND_BG); - _mixer->playRaw(&_bgSfx, _bgBuf + 256, _bgSize - 768, 11025, + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_bgSfx, _bgBuf + 256, _bgSize - 768, 11025, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_LOOP, SOUND_BG); return true; case PLAYBG: _mixer->stopID(SOUND_BG); - _mixer->playRaw(&_bgSfx, _bgBuf + 256, _bgSize - 768, 11025, + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_bgSfx, _bgBuf + 256, _bgSize - 768, 11025, Audio::Mixer::FLAG_UNSIGNED, SOUND_BG); return true; case STOPBG: diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index b2263482dd..edcfd81581 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -1040,7 +1040,7 @@ void Sound::playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *h memcpy(buffer, sound+sizeof(struct dataFileHeader), size); _mixer->stopID(id); - _mixer->playRaw(handle, buffer, size, 11025, flags, id); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, handle, buffer, size, 11025, flags, id); } void Sound::loadSection(uint8 pSection) { @@ -1118,9 +1118,9 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) { } if (channel == 0) - _mixer->playRaw(&_ingameSound0, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH0, volume, 0, loopSta, loopEnd); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_ingameSound0, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH0, volume, 0, loopSta, loopEnd); else - _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1, volume, 0, loopSta, loopEnd); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1, volume, 0, loopSta, loopEnd); } void Sound::fnStartFx(uint32 sound, uint8 channel) { @@ -1245,7 +1245,7 @@ bool Sound::startSpeech(uint16 textNum) { rate = 11025; _mixer->stopID(SOUND_SPEECH); - _mixer->playRaw(&_ingameSpeech, playBuffer, speechSize, rate, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE, SOUND_SPEECH); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_ingameSpeech, playBuffer, speechSize, rate, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE, SOUND_SPEECH); return true; } diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index f699a4c475..fa4d9c3adc 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -172,7 +172,7 @@ void Sound::playSample(QueueElement *elem) { flags |= Audio::Mixer::FLAG_STEREO; if (_fxList[elem->id].type == FX_LOOP) flags |= Audio::Mixer::FLAG_LOOP; - _mixer->playRaw(&elem->handle, sampleData + 0x2C, size, 11025, flags, elem->id, volume, pan); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &elem->handle, sampleData + 0x2C, size, 11025, flags, elem->id, volume, pan); } } else break; @@ -196,7 +196,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { uint32 size; int16 *data = uncompressSpeech(index + _cowHeaderSize, sampleSize, &size); if (data) - _mixer->playRaw(&_speechHandle, data, size, 11025, SPEECH_FLAGS, SOUND_SPEECH_ID, speechVol, speechPan); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_speechHandle, data, size, 11025, SPEECH_FLAGS, SOUND_SPEECH_ID, speechVol, speechPan); } #ifdef USE_MAD else if (_cowMode == CowMp3) { diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 3f9cbb482e..838c37dc6e 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -351,7 +351,7 @@ void MoviePlayer::play(int32 leadIn, int32 leadOut) { } if (startNextText && !_mixer->isSoundHandleActive(_speechHandle)) { - _mixer->playRaw(&_speechHandle, t->speech, t->speechBufferSize, 22050, flags); + _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_speechHandle, t->speech, t->speechBufferSize, 22050, flags); startNextText = false; } diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 561b7dc45e..b1de94f3ad 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -311,7 +311,7 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo if (loop) flags |= Audio::Mixer::FLAG_LOOP; - _vm->_mixer->playRaw(handle, data + stream.pos(), size, rate, flags, -1, vol, pan, 0, 0, soundType); + _vm->_mixer->playRaw(soundType, handle, data + stream.pos(), size, rate, flags, -1, vol, pan, 0, 0); return RD_OK; } |
