aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/sound.h
diff options
context:
space:
mode:
authorPaul Gilbert2008-03-19 10:37:33 +0000
committerPaul Gilbert2008-03-19 10:37:33 +0000
commit74e5ef5c56f22884c5e198cb6ab6dd2455f525f0 (patch)
treeb9667b32dba21743964e176b63e985031d2761b3 /engines/lure/sound.h
parent63c09d5a40d70ff7dd96b691a6a413d9d65a8c22 (diff)
downloadscummvm-rg350-74e5ef5c56f22884c5e198cb6ab6dd2455f525f0.tar.gz
scummvm-rg350-74e5ef5c56f22884c5e198cb6ab6dd2455f525f0.tar.bz2
scummvm-rg350-74e5ef5c56f22884c5e198cb6ab6dd2455f525f0.zip
Commit of Hans de Goede's patches to the sound handling code
svn-id: r31194
Diffstat (limited to 'engines/lure/sound.h')
-rw-r--r--engines/lure/sound.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/engines/lure/sound.h b/engines/lure/sound.h
index fb1fcf6f16..0542d1acbc 100644
--- a/engines/lure/sound.h
+++ b/engines/lure/sound.h
@@ -34,12 +34,10 @@ class MidiParser;
namespace Lure {
-#define NUM_CHANNELS_OUTER 8
-#define NUM_CHANNELS_INNER 16
+#define NUM_CHANNELS 16
struct ChannelEntry {
MidiChannel *midiChannel;
- bool isMusic;
uint8 volume;
};
@@ -55,6 +53,7 @@ private:
MidiDriver *_driver;
MidiParser *_parser;
ChannelEntry *_channels;
+ bool _isMusic;
bool _isPlaying;
void queueUpdatePos();
@@ -65,11 +64,11 @@ private:
bool _passThrough;
public:
- MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS_INNER],
- uint8 channelNum, uint8 soundNum, bool isMusic, void *soundData, uint32 size);
+ MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS],
+ uint8 channelNum, uint8 soundNum, bool isMusic, uint8 numChannels, void *soundData, uint32 size);
~MidiMusic();
void setVolume(int volume);
- int getVolume() { return _volume; }
+ int getVolume() { return _volume; }
void playSong(uint16 songNum);
void stopSong() { stopMusic(); }
@@ -89,11 +88,11 @@ public:
void metaEvent(byte type, byte *data, uint16 length);
void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
- uint32 getBaseTempo(void) { return _driver ? _driver->getBaseTempo() : 0; }
+ uint32 getBaseTempo(void) { return _driver ? _driver->getBaseTempo() : 0; }
//Channel allocation functions
- MidiChannel *allocateChannel() { return 0; }
- MidiChannel *getPercussionChannel() { return 0; }
+ MidiChannel *allocateChannel() { return 0; }
+ MidiChannel *getPercussionChannel() { return 0; }
uint8 channelNumber() { return _channelNumber; }
uint8 soundNumber() { return _soundNumber; }
@@ -111,8 +110,8 @@ private:
MidiDriver *_driver;
ManagedList<SoundDescResource *> _activeSounds;
ManagedList<MidiMusic *> _playingSounds;
- ChannelEntry _channelsInner[NUM_CHANNELS_INNER];
- bool _channelsInUse[NUM_CHANNELS_OUTER];
+ ChannelEntry _channelsInner[NUM_CHANNELS];
+ bool _channelsInUse[NUM_CHANNELS];
bool _isPlaying;
bool _nativeMT32;
bool _isRoland;
@@ -138,7 +137,6 @@ public:
void stopSound(uint8 soundIndex);
void killSound(uint8 soundNumber);
void setVolume(uint8 soundNumber, uint8 volume);
- void setVolume(uint8 volume);
void tidySounds();
uint8 descIndexOf(uint8 soundNumber);
SoundDescResource *findSound(uint8 soundNumber);
@@ -153,7 +151,7 @@ public:
// The following methods implement the external sound player module
void musicInterface_Initialise();
- void musicInterface_Play(uint8 soundNumber, uint8 channelNumber);
+ void musicInterface_Play(uint8 soundNumber, uint8 channelNumber, uint8 numChannels = 4);
void musicInterface_Stop(uint8 soundNumber);
bool musicInterface_CheckPlaying(uint8 soundNumber);
void musicInterface_SetVolume(uint8 channelNum, uint8 volume);