aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-02-20 18:50:17 +0000
committerMax Horn2007-02-20 18:50:17 +0000
commit227a080e5b25762dc7a5a942dcfbfdbfcd76c372 (patch)
treec524092b2e9bb023bbaced29e8a245cf2cf6dff5 /engines/scumm
parent547858993725af19d2167857c4e7a4a8ba8da185 (diff)
downloadscummvm-rg350-227a080e5b25762dc7a5a942dcfbfdbfcd76c372.tar.gz
scummvm-rg350-227a080e5b25762dc7a5a942dcfbfdbfcd76c372.tar.bz2
scummvm-rg350-227a080e5b25762dc7a5a942dcfbfdbfcd76c372.zip
Patch #1663933 (Kill premix channel) with a few tiny additional tweaks by me
svn-id: r25752
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/player_mod.cpp5
-rw-r--r--engines/scumm/player_mod.h2
-rw-r--r--engines/scumm/player_nes.cpp4
-rw-r--r--engines/scumm/player_nes.h6
-rw-r--r--engines/scumm/player_v2.cpp5
-rw-r--r--engines/scumm/player_v2.h6
6 files changed, 12 insertions, 16 deletions
diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp
index 8ce3c80132..38a5c8554e 100644
--- a/engines/scumm/player_mod.cpp
+++ b/engines/scumm/player_mod.cpp
@@ -46,12 +46,11 @@ Player_MOD::Player_MOD(Audio::Mixer *mixer) {
_playproc = NULL;
_playparam = NULL;
- _mixer->setupPremix(this);
+ _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true);
}
Player_MOD::~Player_MOD() {
- // Detach the premix callback handler
- _mixer->setupPremix(0);
+ _mixer->stopHandle(_soundHandle);
for (int i = 0; i < MOD_MAXCHANS; i++) {
if (!_channels[i].id)
continue;
diff --git a/engines/scumm/player_mod.h b/engines/scumm/player_mod.h
index 6146c1c4a2..6e381191d1 100644
--- a/engines/scumm/player_mod.h
+++ b/engines/scumm/player_mod.h
@@ -26,6 +26,7 @@
#include "scumm/scumm.h"
#include "sound/audiostream.h"
+#include "sound/mixer.h"
namespace Audio {
class RateConverter;
@@ -77,6 +78,7 @@ private:
};
Audio::Mixer *_mixer;
+ Audio::SoundHandle _soundHandle;
uint32 _mixamt;
uint32 _mixpos;
diff --git a/engines/scumm/player_nes.cpp b/engines/scumm/player_nes.cpp
index eaa59fb4f8..4836ad5629 100644
--- a/engines/scumm/player_nes.cpp
+++ b/engines/scumm/player_nes.cpp
@@ -620,11 +620,11 @@ Player_NES::Player_NES(ScummEngine *scumm, Audio::Mixer *mixer) {
APU_writeControl(0);
- _mixer->setupPremix(this);
+ _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true);
}
Player_NES::~Player_NES() {
- _mixer->setupPremix(0);
+ _mixer->stopHandle(_soundHandle);
delete _apu;
}
diff --git a/engines/scumm/player_nes.h b/engines/scumm/player_nes.h
index 6140460838..eaececee2d 100644
--- a/engines/scumm/player_nes.h
+++ b/engines/scumm/player_nes.h
@@ -27,10 +27,7 @@
#include "common/scummsys.h"
#include "scumm/music.h"
#include "sound/audiostream.h"
-
-namespace Audio {
- class Mixer;
-}
+#include "sound/mixer.h"
namespace Scumm {
@@ -80,6 +77,7 @@ private:
ScummEngine *_vm;
Audio::Mixer *_mixer;
+ Audio::SoundHandle _soundHandle;
APUe::APU *_apu;
int _sample_rate;
int _samples_per_frame;
diff --git a/engines/scumm/player_v2.cpp b/engines/scumm/player_v2.cpp
index 1eb7b958dd..9f764a5d0b 100644
--- a/engines/scumm/player_v2.cpp
+++ b/engines/scumm/player_v2.cpp
@@ -375,13 +375,12 @@ Player_V2::Player_V2(ScummEngine *scumm, Audio::Mixer *mixer, bool pcjr) {
set_pcjr(pcjr);
setMusicVolume(255);
- _mixer->setupPremix(this);
+ _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true);
}
Player_V2::~Player_V2() {
mutex_up();
- // Detach the premix callback handler
- _mixer->setupPremix(0);
+ _mixer->stopHandle(_soundHandle);
mutex_down();
}
diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h
index cfcd986958..704c3d9795 100644
--- a/engines/scumm/player_v2.h
+++ b/engines/scumm/player_v2.h
@@ -28,10 +28,7 @@
#include "common/mutex.h"
#include "scumm/music.h"
#include "sound/audiostream.h"
-
-namespace Audio {
- class Mixer;
-}
+#include "sound/mixer.h"
namespace Scumm {
@@ -96,6 +93,7 @@ public:
protected:
bool _isV3Game;
Audio::Mixer *_mixer;
+ Audio::SoundHandle _soundHandle;
ScummEngine *_vm;
bool _pcjr;