aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/sound.h
diff options
context:
space:
mode:
authorMatthew Hoops2012-09-12 20:18:13 -0400
committerMatthew Hoops2012-09-12 20:18:13 -0400
commitd5ed8b1901b88e361a2a420a9daf586f6089a36b (patch)
treed19e4dd7baf33b7447d69d8ad8d3c25732a69698 /engines/cine/sound.h
parentff51a7661d7a2cb296b987edfc3d81727160e627 (diff)
parent8808393b3a3428df2946d7967e52aba084c8ffe5 (diff)
downloadscummvm-rg350-d5ed8b1901b88e361a2a420a9daf586f6089a36b.tar.gz
scummvm-rg350-d5ed8b1901b88e361a2a420a9daf586f6089a36b.tar.bz2
scummvm-rg350-d5ed8b1901b88e361a2a420a9daf586f6089a36b.zip
Merge remote branch 'upstream/master' into pegasus
Conflicts: AUTHORS
Diffstat (limited to 'engines/cine/sound.h')
-rw-r--r--engines/cine/sound.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/engines/cine/sound.h b/engines/cine/sound.h
index afc0994a26..fdb183ad34 100644
--- a/engines/cine/sound.h
+++ b/engines/cine/sound.h
@@ -24,6 +24,7 @@
#define CINE_SOUND_H_
#include "common/util.h"
+#include "common/mutex.h"
#include "audio/mixer.h"
namespace Audio {
@@ -47,7 +48,6 @@ public:
virtual void playSound(int channel, int frequency, const uint8 *data, int size, int volumeStep, int stepCount, int volume, int repeat) = 0;
virtual void stopSound(int channel) = 0;
- virtual void update() {}
protected:
@@ -91,19 +91,39 @@ public:
virtual void playSound(int channel, int frequency, const uint8 *data, int size, int volumeStep, int stepCount, int volume, int repeat);
virtual void stopSound(int channel);
- virtual void update();
enum {
- PAULA_FREQ = 7093789,
- NUM_CHANNELS = 4,
- SPL_HDR_SIZE = 22
+ PAULA_FREQ = 3579545,
+ NUM_CHANNELS = 4
};
protected:
- void playSoundChannel(int channel, int frequency, uint8 *data, int size, int volume);
-
- Audio::SoundHandle _channelsTable[NUM_CHANNELS];
+ struct SfxChannel {
+ Audio::SoundHandle handle;
+ int volume;
+ int volumeStep;
+ int curStep;
+ int stepCount;
+
+ void initialize(int vol, int volStep, int stepCnt) {
+ volume = vol;
+ volumeStep = volStep;
+ curStep = stepCount = stepCnt;
+ }
+ };
+ SfxChannel _channelsTable[NUM_CHANNELS];
+ static const int _channelBalance[NUM_CHANNELS];
+ Common::Mutex _sfxMutex;
+ int _sfxTimer;
+ static void sfxTimerProc(void *param);
+ void sfxTimerCallback();
+
+ Common::Mutex _musicMutex;
+ int _musicTimer;
+ int _musicFadeTimer;
+ static void musicTimerProc(void *param);
+ void musicTimerCallback();
Audio::SoundHandle _moduleHandle;
Audio::AudioStream *_moduleStream;
};