diff options
author | Matthew Hoops | 2015-04-30 00:01:30 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:47 -0400 |
commit | bed9da8b9dbbaa19d317f71663e42875c1717fda (patch) | |
tree | 56b714515cae107ae1f7992a2e85db1e9c800a8a /engines/cine | |
parent | 8bcbcd6c167e8e7169f006da459f3cbe450a4a59 (diff) | |
download | scummvm-rg350-bed9da8b9dbbaa19d317f71663e42875c1717fda.tar.gz scummvm-rg350-bed9da8b9dbbaa19d317f71663e42875c1717fda.tar.bz2 scummvm-rg350-bed9da8b9dbbaa19d317f71663e42875c1717fda.zip |
AUDIO: Remove all AudioStream access to OPL
Diffstat (limited to 'engines/cine')
-rw-r--r-- | engines/cine/sound.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index a20ad5d330..0c788b816c 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -101,7 +101,7 @@ struct AdLibSoundInstrument { byte amDepth; }; -class AdLibSoundDriver : public PCSoundDriver, Audio::AudioStream { +class AdLibSoundDriver : public PCSoundDriver { public: AdLibSoundDriver(Audio::Mixer *mixer); virtual ~AdLibSoundDriver(); @@ -112,12 +112,6 @@ public: virtual void stopChannel(int channel); virtual void stopAll(); - // AudioStream interface - virtual int readBuffer(int16 *buffer, const int numSamples); - virtual bool isStereo() const { return false; } - virtual bool endOfData() const { return false; } - virtual int getRate() const { return _sampleRate; } - void initCard(); void onTimer(); void setupInstrument(const byte *data, int channel); @@ -129,9 +123,7 @@ protected: void *_upRef; OPL::OPL *_opl; - int _sampleRate; Audio::Mixer *_mixer; - Audio::SoundHandle _soundHandle; byte _vibrato; int _channelsVolumeTable[4]; @@ -283,7 +275,6 @@ void PCSoundDriver::resetChannel(int channel) { AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer) : _upCb(0), _upRef(0), _mixer(mixer) { - _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); if (!_opl || !_opl->init()) error("Failed to create OPL"); @@ -292,11 +283,9 @@ AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer) memset(_instrumentsTable, 0, sizeof(_instrumentsTable)); initCard(); _opl->start(new Common::Functor0Mem<void, AdLibSoundDriver>(this, &AdLibSoundDriver::onTimer), 50); - _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); } AdLibSoundDriver::~AdLibSoundDriver() { - _mixer->stopHandle(_soundHandle); delete _opl; } @@ -346,10 +335,6 @@ void AdLibSoundDriver::stopAll() { _opl->writeReg(0xBD, 0); } -int AdLibSoundDriver::readBuffer(int16 *buffer, const int numSamples) { - return _opl->readBuffer(buffer, numSamples); -} - void AdLibSoundDriver::initCard() { _vibrato = 0x20; _opl->writeReg(0xBD, _vibrato); |