From bed9da8b9dbbaa19d317f71663e42875c1717fda Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 30 Apr 2015 00:01:30 -0400 Subject: AUDIO: Remove all AudioStream access to OPL --- engines/cine/sound.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'engines/cine') 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(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); -- cgit v1.2.3