aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/music.h
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-14 23:04:28 -0400
committerPaul Gilbert2016-09-14 23:04:28 -0400
commit2042133b448a06c67281dabc5f74023a0e6ffa18 (patch)
tree1b51a9e072a48e9c296205c8cd30fa6347d32832 /engines/xeen/music.h
parenta06d1b7efe0066d17fdc7d30e9c8983fcd3f8094 (diff)
downloadscummvm-rg350-2042133b448a06c67281dabc5f74023a0e6ffa18.tar.gz
scummvm-rg350-2042133b448a06c67281dabc5f74023a0e6ffa18.tar.bz2
scummvm-rg350-2042133b448a06c67281dabc5f74023a0e6ffa18.zip
XEEN: Added music playback interface methods
Diffstat (limited to 'engines/xeen/music.h')
-rw-r--r--engines/xeen/music.h54
1 files changed, 52 insertions, 2 deletions
diff --git a/engines/xeen/music.h b/engines/xeen/music.h
index e6cfbbade5..a715471088 100644
--- a/engines/xeen/music.h
+++ b/engines/xeen/music.h
@@ -38,6 +38,11 @@ namespace OPL {
namespace Xeen {
+enum MusicCommand {
+ STOP_MUSIC = 0, RESTART_MUSIC = 1, SET_VOLUME = 0x100,
+ GET_STATUS = 0xFFE0
+};
+
class MusicDriver;
typedef bool (MusicDriver::*CommandFn)(const byte *&srcP, byte param);
@@ -149,6 +154,16 @@ public:
* Starts an special effect playing
*/
virtual void playFX(uint effectId, const byte *data);
+
+ /**
+ * Plays a song
+ */
+ virtual void playSong(const byte *data);
+
+ /**
+ * Executes special music command
+ */
+ virtual int songCommand(uint commandId, byte volume = 0);
};
class AdlibMusicDriver : public MusicDriver {
@@ -265,14 +280,24 @@ public:
* Starts an special effect playing
*/
virtual void playFX(uint effectId, const byte *data);
-};
+ /**
+ * Plays a song
+ */
+ virtual void playSong(const byte *data);
+
+ /**
+ * Executes special music command
+ */
+ virtual int songCommand(uint commandId, byte volume = 0);
+};
class Music {
private:
MusicDriver *_musicDriver;
const byte *_effectsData;
Common::Array<uint16> _effectsOffsets;
+ const byte *_songData;
private:
/**
* Loads effects data that was embedded in the music driver
@@ -293,7 +318,32 @@ public:
/**
* Starts an effect playing
*/
- void playEffect(uint effectId);
+ void playFX(uint effectId);
+
+ /**
+ * Executes special music command
+ */
+ int songCommand(uint commandId, byte volume = 0);
+
+ /**
+ * Stops any currently playing music
+ */
+ void stopMusic() { songCommand(STOP_MUSIC); }
+
+ /**
+ * Restart the music
+ */
+ void restartMusic() { songCommand(RESTART_MUSIC); }
+
+ /**
+ * Plays a song
+ */
+ void playSong(Common::SeekableReadStream &stream);
+
+ /**
+ * Plays a song
+ */
+ void playSong(const Common::String &name);
};
} // End of namespace Xeen