aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.h
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-07 17:56:04 +0000
committerJohannes Schickel2008-04-07 17:56:04 +0000
commit9377fc7dc8548eb5369c99f5ab3e2437e756a003 (patch)
tree941d1da902d3ef429fab7cff750593ca8099ca30 /engines/kyra/sound.h
parent9f06984ba5be4b21f0d261887e2c8431d6838e27 (diff)
downloadscummvm-rg350-9377fc7dc8548eb5369c99f5ab3e2437e756a003.tar.gz
scummvm-rg350-9377fc7dc8548eb5369c99f5ab3e2437e756a003.tar.bz2
scummvm-rg350-9377fc7dc8548eb5369c99f5ab3e2437e756a003.zip
Some MIDI related cleanup.
svn-id: r31443
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r--engines/kyra/sound.h58
1 files changed, 33 insertions, 25 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 0ffb1c73b5..c6f416db5b 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -42,17 +42,17 @@
#ifndef KYRA_SOUND_H
#define KYRA_SOUND_H
+#include "kyra/kyra.h"
#include "common/scummsys.h"
#include "common/file.h"
#include "common/mutex.h"
+#include "common/ptr.h"
#include "sound/midiparser.h"
#include "sound/mixer.h"
#include "sound/softsynth/ym2612.h"
-#include "kyra/kyra.h"
-
namespace Audio {
class AudioStream;
} // end of namespace Audio
@@ -303,9 +303,9 @@ public:
kType getMusicType() const { return isMT32() ? kMidiMT32 : kMidiGM; }
- bool init() { return true; }
+ bool init();
- void updateVolumeSettings() { /*XXX*/ }
+ void updateVolumeSettings();
void loadSoundFile(uint file);
@@ -335,35 +335,43 @@ public:
bool isMT32() const { return _nativeMT32; }
private:
- void setVolume(int vol);
-
- void playMusic(uint8 *data, uint32 size);
- void stopMusic();
- void loadSoundEffectFile(uint file);
- void loadSoundEffectFile(uint8 *data, uint32 size);
-
- void stopSoundEffect();
+ void updateChannelVolume(uint8 vol);
static void onTimer(void *data);
- MidiChannel *_channel[32];
- int _virChannel[16];
+ // Our channel handling
+ uint8 _virChannel[16];
uint8 _channelVolume[16];
- MidiDriver *_driver;
- bool _nativeMT32;
- bool _useC55;
- bool _passThrough;
- uint8 _volume;
- bool _isPlaying;
- bool _sfxIsPlaying;
+
+ MidiChannel *_channel[32];
+
+ // Music/Sfx volume
+ uint8 _musicVolume;
+ uint8 _sfxVolume;
+
uint32 _fadeStartTime;
bool _fadeMusicOut;
+
+ // Midi file related
+ Common::SharedPtr<byte> _midiFile;
+ Common::String _currentTrack;
+
+ // Music related
+ MidiParser *_musicParser;
+
+ bool _isMusicPlaying;
bool _eventFromMusic;
- MidiParser *_parser;
- byte *_parserSource;
- MidiParser *_soundEffect;
- byte *_soundEffectSource;
+ // Sfx related
+ MidiParser *_sfxParser;
+
+ bool _isSfxPlaying;
+
+ // misc
+ bool _nativeMT32;
+ bool _useC55;
+ MidiDriver *_driver;
+ bool _passThrough;
Common::Mutex _mutex;
};