aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-03-21 17:17:24 +0000
committerTorbjörn Andersson2006-03-21 17:17:24 +0000
commit0c0c41d495b35b44ab3b17b39649b5a09d9afc1a (patch)
tree093c007b5424cd86408ec0aa6cb4e87d2b4c05f1 /engines/kyra/sound.h
parent3586905f93ab27bd1274ee432ff24281f2fd14bd (diff)
downloadscummvm-rg350-0c0c41d495b35b44ab3b17b39649b5a09d9afc1a.tar.gz
scummvm-rg350-0c0c41d495b35b44ab3b17b39649b5a09d9afc1a.tar.bz2
scummvm-rg350-0c0c41d495b35b44ab3b17b39649b5a09d9afc1a.zip
Implemented "sound triggers" so that the music does not stop shortly after
entering the castle. I hope this is a fair approximation of how the original worked. Of course, this led to a couple of more renamings: _unk5 -> _soundTrigger updateCallback54() -> update_setSoundTrigger() snd_setUnk5() -> snd_getSoundTrigger() (yes, "get") At the moment, the only known sound triggers are the ones in the castle. If an unknown trigger is set, the debugging messages will be really, really noisy. I don't know if I should consider this a bug or an extremely annoying feature. svn-id: r21396
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r--engines/kyra/sound.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 158270c201..117b0c2cf1 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -45,19 +45,20 @@ public:
virtual ~Sound();
virtual bool init() = 0;
-
+ virtual void process() {}
+
virtual void setVolume(int volume) = 0;
virtual int getVolume() = 0;
-
+
virtual void loadMusicFile(const char *file) = 0;
-
+
virtual void playTrack(uint8 track) = 0;
virtual void haltTrack() = 0;
-
+
virtual void playSoundEffect(uint8 track) = 0;
-
+
virtual void beginFadeOut() = 0;
-
+
void voicePlay(const char *file);
void voiceUnload() {}
bool voiceIsPlaying();
@@ -70,12 +71,12 @@ private:
AudioStream *_currentVocFile;
Audio::SoundHandle _vocHandle;
Common::File _compressHandle;
-
+
struct SpeechCodecs {
const char *fileext;
AudioStream *(*streamFunc)(Common::File*, uint32);
};
-
+
static const SpeechCodecs _supportedCodes[];
};
@@ -87,6 +88,7 @@ public:
~SoundAdlibPC();
bool init();
+ void process();
void setVolume(int volume);
int getVolume();
@@ -114,11 +116,16 @@ private:
uint8 _sfxPriority;
uint8 _sfxFourthByteOfSong;
+
+ int _numSoundTriggers;
+ const int *_soundTriggers;
+
+ static const int _kyra1NumSoundTriggers;
+ static const int _kyra1SoundTriggers[];
};
class SoundMidiPC : public MidiDriver, public Sound {
public:
-
SoundMidiPC(MidiDriver *driver, Audio::Mixer *mixer, KyraEngine *engine);
~SoundMidiPC();
@@ -128,10 +135,10 @@ public:
int getVolume() { return _volume; }
void loadMusicFile(const char *file);
-
+
void playTrack(uint8 track);
void haltTrack();
-
+
void playSoundEffect(uint8 track);
void beginFadeOut();
@@ -148,9 +155,9 @@ public:
//Channel allocation functions
MidiChannel *allocateChannel() { return 0; }
MidiChannel *getPercussionChannel() { return 0; }
-
+
void setPassThrough(bool b) { _passThrough = b; }
-
+
void hasNativeMT32(bool nativeMT32) { _nativeMT32 = nativeMT32; }
bool isMT32() { return _nativeMT32; }
@@ -159,7 +166,7 @@ private:
void stopMusic();
void loadSoundEffectFile(const char *file);
void loadSoundEffectFile(uint8 *data, uint32 size);
-
+
void stopSoundEffect();
static void onTimer(void *data);