aboutsummaryrefslogtreecommitdiff
path: root/engines/made/music.h
diff options
context:
space:
mode:
authorFilippos Karapetis2008-04-24 14:12:08 +0000
committerFilippos Karapetis2008-04-24 14:12:08 +0000
commit068372ac94ee9cde99df7a8fee64d2c8424bb119 (patch)
treec68bc762798171219381eb29077dc13beb155aef /engines/made/music.h
parent551bd59fa89fbcb1f460072aaabb20a890266289 (diff)
downloadscummvm-rg350-068372ac94ee9cde99df7a8fee64d2c8424bb119.tar.gz
scummvm-rg350-068372ac94ee9cde99df7a8fee64d2c8424bb119.tar.bz2
scummvm-rg350-068372ac94ee9cde99df7a8fee64d2c8424bb119.zip
Cleanup and simplification of the music playing code
svn-id: r31691
Diffstat (limited to 'engines/made/music.h')
-rw-r--r--engines/made/music.h58
1 files changed, 6 insertions, 52 deletions
diff --git a/engines/made/music.h b/engines/made/music.h
index 7ca464bbc0..b9fa1004d5 100644
--- a/engines/made/music.h
+++ b/engines/made/music.h
@@ -28,12 +28,8 @@
#ifndef MADE_MUSIC_H
#define MADE_MUSIC_H
-#include "sound/audiocd.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
-#include "sound/mp3.h"
-#include "sound/vorbis.h"
-#include "sound/flac.h"
#include "common/mutex.h"
#include "made/resource.h"
@@ -42,8 +38,7 @@ namespace Made {
enum MusicFlags {
MUSIC_NORMAL = 0,
- MUSIC_LOOP = 0x0001,
- MUSIC_DEFAULT = 0xffff
+ MUSIC_LOOP = 1
};
class MusicPlayer : public MidiDriver {
@@ -59,8 +54,10 @@ public:
void setNativeMT32(bool b) { _nativeMT32 = b; }
bool hasNativeMT32() { return _nativeMT32; }
- void playMusic();
- void stopMusic();
+ void play(XmidiResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
+ void stop();
+ void pause();
+ void resume();
void setLoop(bool loop) { _looping = loop; }
void setPassThrough(bool b) { _passThrough = b; }
@@ -89,6 +86,7 @@ protected:
MidiChannel *_channel[16];
MidiDriver *_driver;
+ MidiParser *_xmidiParser;
byte _channelVolume[16];
bool _nativeMT32;
bool _isGM;
@@ -96,51 +94,7 @@ protected:
bool _isPlaying;
bool _looping;
- bool _randomLoop;
byte _masterVolume;
-
- byte *_musicData;
- uint16 *_buf;
- size_t _musicDataSize;
-};
-
-class Music {
-public:
-
- Music(MidiDriver *driver, int enabled);
- ~Music(void);
- void setNativeMT32(bool b) { _player->setNativeMT32(b); }
- bool hasNativeMT32() { return _player->hasNativeMT32(); }
- void setAdlib(bool b) { _adlib = b; }
- bool hasAdlib() { return _adlib; }
- void setPassThrough(bool b) { _player->setPassThrough(b); }
- bool isPlaying(void);
-
- void play(XmidiResource *midiResource, MusicFlags flags = MUSIC_DEFAULT);
- void pause(void);
- void resume(void);
- void stop(void);
-
- void setVolume(int volume);
- int getVolume() { return _currentVolume; }
-
- int32 *_songTable;
- int _songTableLen;
-
-private:
-
- MusicPlayer *_player;
- uint32 _trackNumber;
-
- int _enabled;
- bool _adlib;
-
- int _currentVolume;
-
- MidiParser *xmidiParser;
-
- byte *_midiMusicData;
-
};
} // End of namespace Made