From 859a9c01290dc6022f99c7fd99ff91d62a3153dc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 24 Dec 2003 17:42:22 +0000 Subject: o Added SoundMixer::isReady() o Removed SoundMixer::bindToSystem() o In scumm, replaced _silentMixer, _silentDigitalImuse and _noDigitalSamples by SoundMixer::isReady() svn-id: r11893 --- sound/mixer.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'sound/mixer.cpp') diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 1d0e13a0c1..1549424720 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -101,22 +101,27 @@ public: SoundMixer::SoundMixer() { - _syst = 0; - _mutex = 0; + _syst = OSystem::instance(); + _mutex = _syst->create_mutex(); _premixParam = 0; _premixProc = 0; int i = 0; - _outputRate = 0; + _outputRate = (uint) _syst->property(OSystem::PROP_GET_SAMPLE_RATE, 0); + + if (_outputRate == 0) + error("OSystem returned invalid sample rate"); _globalVolume = 0; _musicVolume = 0; _paused = false; - + for (i = 0; i != NUM_CHANNELS; i++) _channels[i] = 0; + + _mixerReady = _syst->set_sound_proc(mixCallback, this, OSystem::SOUND_16BIT); } SoundMixer::~SoundMixer() { @@ -127,17 +132,6 @@ SoundMixer::~SoundMixer() { _syst->delete_mutex(_mutex); } -bool SoundMixer::bindToSystem(OSystem *syst) { - _syst = syst; - _mutex = _syst->create_mutex(); - _outputRate = (uint) syst->property(OSystem::PROP_GET_SAMPLE_RATE, 0); - - if (_outputRate == 0) - error("OSystem returned invalid sample rate"); - - return syst->set_sound_proc(mixCallback, this, OSystem::SOUND_16BIT); -} - void SoundMixer::setupPremix(PremixProc *proc, void *param) { Common::StackLock lock(_mutex); _premixParam = param; -- cgit v1.2.3