diff options
author | Max Horn | 2004-11-27 16:18:25 +0000 |
---|---|---|
committer | Max Horn | 2004-11-27 16:18:25 +0000 |
commit | fbaac2e27336fb17c6ef952d41e1a408d25e7bbb (patch) | |
tree | 6cd04a3e511910bf9dced7596fc9d293227f3944 /sky | |
parent | 8ff15ae72cb4adb6b5ffc549eb7a00422308f014 (diff) | |
download | scummvm-rg350-fbaac2e27336fb17c6ef952d41e1a408d25e7bbb.tar.gz scummvm-rg350-fbaac2e27336fb17c6ef952d41e1a408d25e7bbb.tar.bz2 scummvm-rg350-fbaac2e27336fb17c6ef952d41e1a408d25e7bbb.zip |
Use modern form of setupPremix
svn-id: r15916
Diffstat (limited to 'sky')
-rw-r--r-- | sky/music/adlibmusic.cpp | 7 | ||||
-rw-r--r-- | sky/music/adlibmusic.h | 14 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sky/music/adlibmusic.cpp b/sky/music/adlibmusic.cpp index 9e9a4860f9..9fe05fec97 100644 --- a/sky/music/adlibmusic.cpp +++ b/sky/music/adlibmusic.cpp @@ -26,11 +26,6 @@ namespace Sky { -void AdlibMusic::passMixerFunc(void *param, int16 *buf, uint len) { - - ((AdlibMusic*)param)->premixerCall(buf, len); -} - AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system) : MusicBase(pDisk, system) { @@ -40,7 +35,7 @@ AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system) _opl = makeAdlibOPL(_sampleRate); - _mixer->setupPremix(passMixerFunc, this); + _mixer->setupPremix(this); } AdlibMusic::~AdlibMusic(void) { diff --git a/sky/music/adlibmusic.h b/sky/music/adlibmusic.h index d05f0fc5ac..64af432c1c 100644 --- a/sky/music/adlibmusic.h +++ b/sky/music/adlibmusic.h @@ -23,17 +23,28 @@ #define ADLIBMUSIC_H #include "sky/music/musicbase.h" +#include "sound/audiostream.h" #include "sound/fmopl.h" class SoundMixer; namespace Sky { -class AdlibMusic : public MusicBase { +class AdlibMusic : public AudioStream, public MusicBase { public: AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system); ~AdlibMusic(void); virtual void setVolume(uint8 volume); + + // AudioStream API + int readBuffer(int16 *buffer, const int numSamples) { + premixerCall(buffer, numSamples / 2); + return numSamples; + } + bool isStereo() const { return true; } + bool endOfData() const { return false; } + int getRate() const { return _sampleRate; } + private: FM_OPL *_opl; SoundMixer *_mixer; @@ -44,7 +55,6 @@ private: virtual void startDriver(void); void premixerCall(int16 *buf, uint len); - static void passMixerFunc(void *param, int16 *buf, uint len); }; } // End of namespace Sky |