diff options
Diffstat (limited to 'engines/xeen/music.h')
-rw-r--r-- | engines/xeen/music.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/engines/xeen/music.h b/engines/xeen/music.h index 202f8ba982..40059be327 100644 --- a/engines/xeen/music.h +++ b/engines/xeen/music.h @@ -29,6 +29,8 @@ #include "common/mutex.h" #include "common/queue.h" +#define ADLIB_CHANNEL_COUNT 9 + namespace OPL { class OPL; } @@ -45,12 +47,31 @@ struct RegisterValue { }; class Music { + struct Channel { + byte _outputLevel; + byte _scalingValue; + + Channel() : _outputLevel(0), _scalingValue(0) {} + }; +private: + static const byte OPERATOR1_INDEXES[ADLIB_CHANNEL_COUNT]; + static const byte OPERATOR2_INDEXES[ADLIB_CHANNEL_COUNT]; private: OPL::OPL *_opl; Common::Mutex _driverMutex; + Common::Array<Channel> _channels; Common::Queue<RegisterValue> _queue; const byte *_effectsData; Common::Array<uint16> _effectsOffsets; + const byte *_musicPtr1, *_musicPtr2; + bool _fieldF; + int _field109; + int _field10B; + byte _field10D[7]; + int _field114; + int _field115; + int _field117; + bool _lowMusicIgnored; private: /** * Loads effects data that was embedded in the music driver @@ -58,6 +79,12 @@ private: void loadEffectsData(); /** + * Adds a register write to the pending queue that will be flushed + * out to the OPL on the next timer call + */ + void write(int reg, int val); + + /** * Timer function for OPL */ void onTimer(); @@ -71,11 +98,31 @@ private: * Updates any playing music */ void update(); + + /** + * Does a reset + */ + void reset(); + + /** + * Sets the frequency for an operator + */ + void setFrequency(byte operatorNum, uint frequency); + + /** + * Sets the output level for a channel + */ + void setOutputLevel(byte channelNum, uint level); protected: Audio::Mixer *_mixer; public: Music(Audio::Mixer *mixer); ~Music(); + + /** + * Starts an effect playing + */ + void playEffect(uint effectId); }; } // End of namespace Xeen |