diff options
author | Matthew Hoops | 2015-04-21 00:44:25 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:45 -0400 |
commit | 73e8ac2a9b51fc4d278c87677b815f1f6c308775 (patch) | |
tree | 69fd4abb51e9fd9a8ba97d3d4cbe9af06daef36d /engines/gob/sound/adlib.h | |
parent | 5b06eef1597ce701a4f6d16854be077b952d29f7 (diff) | |
download | scummvm-rg350-73e8ac2a9b51fc4d278c87677b815f1f6c308775.tar.gz scummvm-rg350-73e8ac2a9b51fc4d278c87677b815f1f6c308775.tar.bz2 scummvm-rg350-73e8ac2a9b51fc4d278c87677b815f1f6c308775.zip |
GOB: Use the built-in OPL timer
Diffstat (limited to 'engines/gob/sound/adlib.h')
-rw-r--r-- | engines/gob/sound/adlib.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h index 8071249374..6a6215298a 100644 --- a/engines/gob/sound/adlib.h +++ b/engines/gob/sound/adlib.h @@ -37,7 +37,7 @@ namespace Gob { /** Base class for a player of an AdLib music format. */ class AdLib : public Audio::AudioStream { public: - AdLib(Audio::Mixer &mixer); + AdLib(Audio::Mixer &mixer, int callbackFrequency); virtual ~AdLib(); bool isPlaying() const; ///< Are we currently playing? @@ -120,8 +120,6 @@ protected: static const int kOPLMidC = 48; ///< A mid C for the OPL. - /** Return the number of samples per second. */ - uint32 getSamplesPerSecond() const; /** Write a value into an OPL register. */ void writeOPL(byte reg, byte val); @@ -135,7 +133,7 @@ protected: /** The callback function that's called for polling more AdLib commands. * * @param first Is this the first poll since the start of the song? - * @return The number of samples until the next poll. + * @return The number of ticks until the next poll. */ virtual uint32 pollMusic(bool first) = 0; @@ -207,6 +205,11 @@ protected: /** Switch a voice off. */ void noteOff(uint8 voice); + /** + * Set the OPL timer frequency + */ + void setTimerFrequency(int timerFrequency); + private: static const uint8 kOperatorType [kOperatorCount]; static const uint8 kOperatorOffset[kOperatorCount]; @@ -300,6 +303,11 @@ private: void changePitch(uint8 voice, uint16 pitchBend); void setFreq(uint8 voice, uint16 note, bool on); + + /** + * Callback function for OPL + */ + void onTimer(); }; } // End of namespace Gob |