aboutsummaryrefslogtreecommitdiff
path: root/sound/mixer.cpp
diff options
context:
space:
mode:
authorMax Horn2003-12-24 17:42:22 +0000
committerMax Horn2003-12-24 17:42:22 +0000
commit859a9c01290dc6022f99c7fd99ff91d62a3153dc (patch)
tree34a40bd53ce6c75e3685ec837c4da4c0a38d01f7 /sound/mixer.cpp
parent5665d137f6bae488ac19539acdcfe441f514a9d6 (diff)
downloadscummvm-rg350-859a9c01290dc6022f99c7fd99ff91d62a3153dc.tar.gz
scummvm-rg350-859a9c01290dc6022f99c7fd99ff91d62a3153dc.tar.bz2
scummvm-rg350-859a9c01290dc6022f99c7fd99ff91d62a3153dc.zip
o Added SoundMixer::isReady()
o Removed SoundMixer::bindToSystem() o In scumm, replaced _silentMixer, _silentDigitalImuse and _noDigitalSamples by SoundMixer::isReady() svn-id: r11893
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r--sound/mixer.cpp24
1 files changed, 9 insertions, 15 deletions
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;