aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/sound.h
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-01 20:35:36 +0000
committerFilippos Karapetis2008-12-01 20:35:36 +0000
commitaf945ac7881ae7e414f004bd0e99e8c3b5d76be9 (patch)
tree72e9c6fd43406e2021973b4f163ab4faa10143fb /engines/tinsel/sound.h
parentf10f151ff742801e12534bb052bd89419bf906cb (diff)
downloadscummvm-rg350-af945ac7881ae7e414f004bd0e99e8c3b5d76be9.tar.gz
scummvm-rg350-af945ac7881ae7e414f004bd0e99e8c3b5d76be9.tar.bz2
scummvm-rg350-af945ac7881ae7e414f004bd0e99e8c3b5d76be9.zip
Merged the tinsel 2 engine with tinsel 1. Both Discworld 1 and Discworld 2 should be completable
svn-id: r35196
Diffstat (limited to 'engines/tinsel/sound.h')
-rw-r--r--engines/tinsel/sound.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h
index 330409cf59..9b980822dc 100644
--- a/engines/tinsel/sound.h
+++ b/engines/tinsel/sound.h
@@ -37,6 +37,11 @@
namespace Tinsel {
+enum STYPE {FX, VOICE};
+
+enum PlayPriority { PRIORITY_SCRIPT, PRIORITY_SPLAY1, PRIORITY_SPLAY2, PRIORITY_TALK };
+
+enum SampleFlags {PS_COMPLETE = 0x01, PS_SUSTAIN = 0x02};
/*----------------------------------------------------------------------*\
|* Function Prototypes *|
@@ -44,14 +49,39 @@ namespace Tinsel {
class SoundManager {
protected:
+ static const int kNumSFX = 3; // Number of SFX channels
+ enum {
+ kChannelTalk = 0,
+ kChannelTinsel1 = 0, // Always using this channel for DW1
+ kChannelSFX = 1
+ };
+ static const int kNumChannels = kChannelSFX + kNumSFX;
+
+ struct Channel {
+ // Sample handle
+ Audio::SoundHandle handle;
+
+ // Sample id
+ int sampleNum;
+ int subSample;
+
+ // Playing properties
+ bool looped;
+ int x, y;
+ int priority;
+
+ // Time properties
+ uint32 timeStarted;
+ uint32 timeDuration;
+ uint32 lastStart;
+ };
+
+ Channel _channels[kNumChannels];
//TinselEngine *_vm; // TODO: Enable this once global _vm var is gone
- /** Sample handle */
- Audio::SoundHandle _handle;
-
/** Sample index buffer and number of entries */
- int32 *_sampleIndex;
+ uint32 *_sampleIndex;
/** Number of entries in the sample index */
long _sampleIndexLen;
@@ -59,19 +89,29 @@ protected:
/** file stream for sample file */
Common::File _sampleStream;
+ bool offscreenChecks(int x, int &y);
+ int8 getPan(int x);
+
public:
SoundManager(TinselEngine *vm);
~SoundManager();
bool playSample(int id, Audio::Mixer::SoundType type, Audio::SoundHandle *handle = 0);
- void stopAllSamples(void); // Stops any currently playing sample
+ bool playSample(int id, int sub, bool bLooped, int x, int y, int priority,
+ Audio::Mixer::SoundType type, Audio::SoundHandle *handle = 0);
+
+ void stopAllSamples(void); // Stops any currently playing sample
+ void stopSpecSample(int id, int sub = 0); // Stops a specific sample
+ void setSFXVolumes(uint8 volume);
+
bool sampleExists(int id);
- bool sampleIsPlaying(void);
+ bool sampleIsPlaying(int id = -1);
// TODO: Internal method, make this protected?
void openSampleFiles(void);
+ void closeSampleStream(void);
};
} // end of namespace Tinsel