diff options
author | Willem Jan Palenstijn | 2015-07-22 22:37:40 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-07-22 22:43:42 +0200 |
commit | 6ec9c81b575f13b2c4b30aeac592ebf2557b5890 (patch) | |
tree | 503d50902bad2d800165593039d08d5ccf0c98ab /engines/gob/sound/adlib.h | |
parent | 5ec05f6b647c5ea41418be7ed19ad381f97cabd8 (diff) | |
parent | 4e5c8d35f7e133e2e72a846fdbd54900c91eeb73 (diff) | |
download | scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.gz scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.tar.bz2 scummvm-rg350-6ec9c81b575f13b2c4b30aeac592ebf2557b5890.zip |
Merge branch 'master' into mm
Conflicts:
engines/access/access.cpp
engines/access/asurface.h
engines/access/bubble_box.cpp
engines/access/bubble_box.h
engines/access/martian/martian_game.cpp
engines/access/player.cpp
engines/access/player.h
engines/access/resources.cpp
engines/access/screen.cpp
engines/access/screen.h
engines/access/sound.cpp
engines/access/sound.h
Diffstat (limited to 'engines/gob/sound/adlib.h')
-rw-r--r-- | engines/gob/sound/adlib.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h index 8071249374..d60458295c 100644 --- a/engines/gob/sound/adlib.h +++ b/engines/gob/sound/adlib.h @@ -35,9 +35,9 @@ namespace OPL { namespace Gob { /** Base class for a player of an AdLib music format. */ -class AdLib : public Audio::AudioStream { +class AdLib { public: - AdLib(Audio::Mixer &mixer); + AdLib(int callbackFrequency); virtual ~AdLib(); bool isPlaying() const; ///< Are we currently playing? @@ -53,13 +53,7 @@ public: void startPlay(); void stopPlay(); - -// AudioStream API - int readBuffer(int16 *buffer, const int numSamples); - bool isStereo() const; - bool endOfData() const; - bool endOfStream() const; - int getRate() const; + void syncVolume(); protected: enum kVoice { @@ -120,8 +114,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 +127,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,7 +199,14 @@ protected: /** Switch a voice off. */ void noteOff(uint8 voice); + /** + * Set the OPL timer frequency + */ + void setTimerFrequency(int timerFrequency); + private: + static const uint8 kVolumeTable[Audio::Mixer::kMaxMixerVolume + 1]; + static const uint8 kOperatorType [kOperatorCount]; static const uint8 kOperatorOffset[kOperatorCount]; static const uint8 kOperatorVoice [kOperatorCount]; @@ -226,13 +225,11 @@ private: static const uint16 kHihatParams [kParamCount]; - Audio::Mixer *_mixer; - Audio::SoundHandle _handle; OPL::OPL *_opl; Common::Mutex _mutex; - uint32 _rate; + int _volume; uint32 _toPoll; @@ -300,6 +297,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 |