diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 14 | ||||
-rw-r--r-- | sound/mixer.h | 4 | ||||
-rw-r--r-- | sound/mixer_intern.h | 2 | ||||
-rw-r--r-- | sound/softsynth/adlib.cpp | 2 | ||||
-rw-r--r-- | sound/softsynth/mt32.cpp | 2 | ||||
-rw-r--r-- | sound/softsynth/ym2612.cpp | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 16a7dcf024..b27bf87c89 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -44,7 +44,7 @@ namespace Audio { */ class Channel { public: - Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, bool autofreeStream, bool reverseStereo, int id, bool permanent); + Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent); ~Channel(); /** @@ -151,7 +151,7 @@ private: uint32 _pauseStartTime; uint32 _pauseTime; - bool _autofreeStream; + DisposeAfterUse::Flag _autofreeStream; RateConverter *_converter; AudioStream *_input; }; @@ -229,7 +229,7 @@ void MixerImpl::playRaw( AudioStream *input = makeLinearInputStream((byte *)sound, size, rate, flags, loopStart, loopEnd); // Play it - playInputStream(type, handle, input, id, volume, balance, true, false, ((flags & Mixer::FLAG_REVERSE_STEREO) != 0)); + playInputStream(type, handle, input, id, volume, balance, DisposeAfterUse::YES, false, ((flags & Mixer::FLAG_REVERSE_STEREO) != 0)); } void MixerImpl::playInputStream( @@ -237,7 +237,7 @@ void MixerImpl::playInputStream( SoundHandle *handle, AudioStream *input, int id, byte volume, int8 balance, - bool autofreeStream, + DisposeAfterUse::Flag autofreeStream, bool permanent, bool reverseStereo) { Common::StackLock lock(_mutex); @@ -251,7 +251,7 @@ void MixerImpl::playInputStream( if (id != -1) { for (int i = 0; i != NUM_CHANNELS; i++) if (_channels[i] != 0 && _channels[i]->getId() == id) { - if (autofreeStream) + if (autofreeStream == DisposeAfterUse::YES) delete input; return; } @@ -444,7 +444,7 @@ int MixerImpl::getVolumeForSoundType(SoundType type) const { #pragma mark - Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, - bool autofreeStream, bool reverseStereo, int id, bool permanent) + DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent) : _type(type), _mixer(mixer), _id(id), _permanent(permanent), _volume(Mixer::kMaxChannelVolume), _balance(0), _pauseLevel(0), _samplesConsumed(0), _samplesDecoded(0), _mixerTimeStamp(0), _pauseStartTime(0), _pauseTime(0), _autofreeStream(autofreeStream), _converter(0), @@ -458,7 +458,7 @@ Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, Channel::~Channel() { delete _converter; - if (_autofreeStream) + if (_autofreeStream == DisposeAfterUse::YES) delete _input; } diff --git a/sound/mixer.h b/sound/mixer.h index 78dc336f2e..97daa839f1 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -26,7 +26,7 @@ #ifndef SOUND_MIXER_H #define SOUND_MIXER_H -#include "common/scummsys.h" +#include "common/types.h" #include "common/mutex.h" #include "sound/timestamp.h" @@ -166,7 +166,7 @@ public: SoundHandle *handle, AudioStream *input, int id = -1, byte volume = kMaxChannelVolume, int8 balance = 0, - bool autofreeStream = true, + DisposeAfterUse::Flag autofreeStream = DisposeAfterUse::YES, bool permanent = false, bool reverseStereo = false) = 0; diff --git a/sound/mixer_intern.h b/sound/mixer_intern.h index abae5adc69..be47f0c163 100644 --- a/sound/mixer_intern.h +++ b/sound/mixer_intern.h @@ -86,7 +86,7 @@ public: SoundHandle *handle, AudioStream *input, int id, byte volume, int8 balance, - bool autofreeStream, + DisposeAfterUse::Flag autofreeStream, bool permanent, bool reverseStereo); diff --git a/sound/softsynth/adlib.cpp b/sound/softsynth/adlib.cpp index 3f887f1f5b..dd01ea9f64 100644 --- a/sound/softsynth/adlib.cpp +++ b/sound/softsynth/adlib.cpp @@ -918,7 +918,7 @@ int MidiDriver_ADLIB::open() { adlib_write(0xBD, 0x00); create_lookup_table(); - _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); + _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); return 0; } diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp index 654aca9294..1863ec9c67 100644 --- a/sound/softsynth/mt32.cpp +++ b/sound/softsynth/mt32.cpp @@ -287,7 +287,7 @@ int MidiDriver_MT32::open() { _initialising = false; g_system->fillScreen(0); g_system->updateScreen(); - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_handle, this, -1, 255, 0, false, true); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_handle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); return 0; } diff --git a/sound/softsynth/ym2612.cpp b/sound/softsynth/ym2612.cpp index b03488855b..2dbf2ec522 100644 --- a/sound/softsynth/ym2612.cpp +++ b/sound/softsynth/ym2612.cpp @@ -587,7 +587,7 @@ int MidiDriver_YM2612::open() { MidiDriver_Emulated::open(); - _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); + _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); return 0; } |