svn-id: r47133
This commit is contained in:
Johannes Schickel 2010-01-07 17:04:32 +00:00
parent a597e5fef9
commit b47725540f
4 changed files with 10 additions and 13 deletions

View File

@ -788,10 +788,7 @@ void Sound::playSoundData(Audio::SoundHandle *handle, byte *soundData, uint soun
convertVolume(vol);
convertPan(pan);
if (loop)
_mixer->playInputStreamLooping(Audio::Mixer::kSFXSoundType, handle, sndStream, 0, -1, vol, pan);
else
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, sndStream, -1, vol, pan);
_mixer->playInputStreamLooping(Audio::Mixer::kSFXSoundType, handle, sndStream, loop ? 0 : 1, -1, vol, pan);
}
void Sound::stopSfx5() {

View File

@ -340,10 +340,7 @@ int32 Sound::playFx(Audio::SoundHandle *handle, byte *data, uint32 len, uint8 vo
assert(input);
if (loop)
_vm->_mixer->playInputStreamLooping(soundType, handle, input, 0, -1, vol, pan, true, false, isReverseStereo());
else
_vm->_mixer->playInputStream(soundType, handle, input, -1, vol, pan, true, false, isReverseStereo());
_vm->_mixer->playInputStreamLooping(soundType, handle, input, loop ? 0 : 1, -1, vol, pan, true, false, isReverseStereo());
return RD_OK;
}

View File

@ -954,11 +954,7 @@ void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume,
if (stream) {
_mixer->stopHandle(*handle);
if (loop)
_mixer->playInputStreamLooping(type, handle, stream, 0, -1, scaleMixerVolume(volume, kMaxSoundVolume));
else
_mixer->playInputStream(type, handle, stream, -1, scaleMixerVolume(volume, kMaxSoundVolume));
_mixer->playInputStreamLooping(type, handle, stream, loop ? 0 : 1, -1, scaleMixerVolume(volume, kMaxSoundVolume));
}
}

View File

@ -274,6 +274,13 @@ void Mixer::playInputStreamLooping(
bool permanent,
bool reverseStereo) {
// Just in case the user wants the stream just looped once, we will take care of that with the normal
// playInputStream method
if (loopCount == 1) {
playInputStream(type, handle, input, id, volume, balance, autofreeStream, permanent, reverseStereo);
return;
}
LoopingAudioStream *loopingStream = new LoopingAudioStream(input, loopCount, autofreeStream);
assert(loopingStream);