diff options
author | Jamieson Christian | 2006-03-05 21:30:44 +0000 |
---|---|---|
committer | Jamieson Christian | 2006-03-05 21:30:44 +0000 |
commit | 5e25b3b679d61a92a39f2d9ee699fad50b0bcbb6 (patch) | |
tree | ba6b9b417a8a3f7e18e8f387db53a6f42ec3b3c5 /engines/scumm/imuse/imuse.h | |
parent | 27e49b6f5674df4ba1ae0d1d1d8eba39c9fa1b76 (diff) | |
download | scummvm-rg350-5e25b3b679d61a92a39f2d9ee699fad50b0bcbb6.tar.gz scummvm-rg350-5e25b3b679d61a92a39f2d9ee699fad50b0bcbb6.tar.bz2 scummvm-rg350-5e25b3b679d61a92a39f2d9ee699fad50b0bcbb6.zip |
Restructured IMuse and IMuseInternal.
* IMuse is no longer a concurrency front-end.
* IMuseInternal now derives from IMuse.
* Common::StackLock used to protect thread-sensitive interface methods (same as IMuseDigital).
* clear_queue() included in stopAllSounds() so it can be removed from the public interface.
* Game ID now specified at init using property().
* Timer callbacks receive a struct containing IMuseInternal and MidiDriver refs, instead of just the latter.
* OSystem pointer from init is now cached and used instead of global.
All references to the g_system and g_scumm globals are now gone. BOOYAH!
Tested with MI2, DOTT and S&M, under Windows, in Native MIDI, Adlib, and Mixed modes. No regressions or concurrency issues observed. Manifestations of the latter are the biggest concern at this point.
svn-id: r21104
Diffstat (limited to 'engines/scumm/imuse/imuse.h')
-rw-r--r-- | engines/scumm/imuse/imuse.h | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/engines/scumm/imuse/imuse.h b/engines/scumm/imuse/imuse.h index 790deb5dc5..4f25d4b897 100644 --- a/engines/scumm/imuse/imuse.h +++ b/engines/scumm/imuse/imuse.h @@ -37,47 +37,41 @@ class IMuseInternal; class ScummEngine; class Serializer; +/** + * iMuse implementation interface. + * MusicEngine derivative for state-tracked, interactive, + * persistent event-based music playback and control. + * This class serves as an interface to actual implementations + * so that client code is not exposed to the details of + * any specific implementation. + */ class IMuse : public MusicEngine { -private: - OSystem *_system; - IMuseInternal *_target; - mutable Common::MutexRef _mutex; - - IMuse(OSystem *system, IMuseInternal *target); - void in() const; - void out() const; - public: - ~IMuse(); - enum { PROP_TEMPO_BASE, PROP_NATIVE_MT32, PROP_GS, PROP_LIMIT_PLAYERS, PROP_RECYCLE_PLAYERS, - PROP_DIRECT_PASSTHROUGH + PROP_DIRECT_PASSTHROUGH, + PROP_GAME_ID }; - void on_timer(MidiDriver *midi); - void pause(bool paused); - int save_or_load(Serializer *ser, ScummEngine *scumm); - bool get_sound_active(int sound) const; - int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h); - int32 doCommand(int numargs, int args[]); - int clear_queue(); - void setBase(byte **base); - uint32 property(int prop, uint32 value); +public: + virtual void on_timer(MidiDriver *midi) = 0; + virtual void pause(bool paused) = 0; + virtual int save_or_load(Serializer *ser, ScummEngine *scumm) = 0; + virtual bool get_sound_active(int sound) const = 0; + virtual int32 doCommand(int numargs, int args[]) = 0; + virtual int clear_queue() = 0; + virtual void setBase(byte **base) = 0; + virtual uint32 property(int prop, uint32 value) = 0; - // MusicEngine base class methods - virtual void setMusicVolume(int vol); - virtual void startSound(int sound); - virtual void stopSound(int sound); - virtual void stopAllSounds(); - virtual int getSoundStatus(int sound) const; - virtual int getMusicTimer() const; - virtual void terminate(); +public: + // MusicEngine base class methods. + // Not actually redefined here because none are implemented. +public: // Factory methods static IMuse *create(OSystem *syst, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver); }; |