diff options
author | Matthew Hoops | 2015-04-03 01:05:03 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-07-07 20:19:42 -0400 |
commit | 2e8f9dcec93653f1bd1f115662f9fcf3a5581fd8 (patch) | |
tree | e843e3f7de6172b24f4c54b260d663f9c0cc4a80 /engines | |
parent | f1f29302f5401c4782985cec4d47d069b99036ee (diff) | |
download | scummvm-rg350-2e8f9dcec93653f1bd1f115662f9fcf3a5581fd8.tar.gz scummvm-rg350-2e8f9dcec93653f1bd1f115662f9fcf3a5581fd8.tar.bz2 scummvm-rg350-2e8f9dcec93653f1bd1f115662f9fcf3a5581fd8.zip |
AUDIO: Remove the sample rate configuration from the OPL code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agos/drivers/accolade/adlib.cpp | 4 | ||||
-rw-r--r-- | engines/cine/sound.cpp | 2 | ||||
-rw-r--r-- | engines/cruise/sound.cpp | 2 | ||||
-rw-r--r-- | engines/gob/sound/adlib.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/sound_nebular.cpp | 6 | ||||
-rw-r--r-- | engines/mads/nebular/sound_nebular.h | 2 | ||||
-rw-r--r-- | engines/mads/sound.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/adlib.cpp | 2 | ||||
-rw-r--r-- | engines/queen/midiadlib.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/drivers/adlib.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/players/player_ad.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/scalpel/drivers/adlib.cpp | 4 | ||||
-rw-r--r-- | engines/sky/music/adlibmusic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/sound.cpp | 2 |
15 files changed, 19 insertions, 21 deletions
diff --git a/engines/agos/drivers/accolade/adlib.cpp b/engines/agos/drivers/accolade/adlib.cpp index 11edc7c5f7..61f209b063 100644 --- a/engines/agos/drivers/accolade/adlib.cpp +++ b/engines/agos/drivers/accolade/adlib.cpp @@ -213,8 +213,6 @@ MidiDriver_Accolade_AdLib::~MidiDriver_Accolade_AdLib() { } int MidiDriver_Accolade_AdLib::open() { - int rate = _mixer->getOutputRate(); - // debugC(kDebugLevelAdLibDriver, "AdLib: starting driver"); _opl = OPL::Config::create(OPL::Config::kOpl2); @@ -222,7 +220,7 @@ int MidiDriver_Accolade_AdLib::open() { if (!_opl) return -1; - _opl->init(rate); + _opl->init(); MidiDriver_Emulated::open(); diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index 8da6dba532..2ac0f91cac 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -285,7 +285,7 @@ AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer) _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); - if (!_opl || !_opl->init(_sampleRate)) + if (!_opl || !_opl->init()) error("Failed to create OPL"); memset(_channelsVolumeTable, 0, sizeof(_channelsVolumeTable)); diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index 0bf9bf706e..1f4960465e 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -304,7 +304,7 @@ AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer) : _mixer(mixer) { _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); - if (!_opl || !_opl->init(_sampleRate)) + if (!_opl || !_opl->init()) error("Failed to create OPL"); for (int i = 0; i < 5; ++i) { diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 65b43cae7a..b92e20b42c 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -136,7 +136,7 @@ void AdLib::createOPL() { } _opl = OPL::Config::create(OPL::Config::parse(oplDriver), OPL::Config::kOpl2); - if (!_opl || !_opl->init(_rate)) { + if (!_opl || !_opl->init()) { delete _opl; error("Could not create an AdLib emulator"); diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 203931fcd1..ad3395b74a 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -428,7 +428,7 @@ AdLibDriver::AdLibDriver(Audio::Mixer *mixer, int version) { _mixer = mixer; _adlib = OPL::Config::create(); - if (!_adlib || !_adlib->init(getRate())) + if (!_adlib || !_adlib->init()) error("Failed to create OPL"); memset(_channels, 0, sizeof(_channels)); diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp index b0a0938958..10cbc73bf2 100644 --- a/engines/mads/nebular/sound_nebular.cpp +++ b/engines/mads/nebular/sound_nebular.cpp @@ -211,7 +211,7 @@ ASound::ASound(Audio::Mixer *mixer, OPL::OPL *opl, const Common::String &filenam _mixer = mixer; _opl = opl; - _opl->init(getRate()); + _opl->init(); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); @@ -861,6 +861,10 @@ int ASound::readBuffer(int16 *buffer, const int numSamples) { return numSamples; } +int ASound::getRate() const { + return g_system->getMixer()->getOutputRate(); +} + void ASound::setVolume(int volume) { _masterVolume = volume; if (!volume) diff --git a/engines/mads/nebular/sound_nebular.h b/engines/mads/nebular/sound_nebular.h index e0956327b4..8c1d7f8021 100644 --- a/engines/mads/nebular/sound_nebular.h +++ b/engines/mads/nebular/sound_nebular.h @@ -385,7 +385,7 @@ public: /** * Return sample rate */ - virtual int getRate() const { return 11025; } + virtual int getRate() const; /** * Set the volume diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp index 09bc3a3f13..4a35edb80f 100644 --- a/engines/mads/sound.cpp +++ b/engines/mads/sound.cpp @@ -40,7 +40,7 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) { _masterVolume = 255; _opl = OPL::Config::create(); - _opl->init(11025); + _opl->init(); // Validate sound files switch (_vm->getGameID()) { diff --git a/engines/parallaction/adlib.cpp b/engines/parallaction/adlib.cpp index 7c1dd1681f..a2defa932b 100644 --- a/engines/parallaction/adlib.cpp +++ b/engines/parallaction/adlib.cpp @@ -351,7 +351,7 @@ int AdLibDriver::open() { MidiDriver_Emulated::open(); _opl = OPL::Config::create(); - _opl->init(getRate()); + _opl->init(); _opl->writeReg(0x1, 0x20); // set bit 5 (enable all waveforms) // Reset the OPL registers. diff --git a/engines/queen/midiadlib.cpp b/engines/queen/midiadlib.cpp index 6bf0d59846..369ac99baf 100644 --- a/engines/queen/midiadlib.cpp +++ b/engines/queen/midiadlib.cpp @@ -122,7 +122,7 @@ private: int AdLibMidiDriver::open() { MidiDriver_Emulated::open(); _opl = OPL::Config::create(); - if (!_opl || !_opl->init(getRate())) + if (!_opl || !_opl->init()) error("Failed to create OPL"); adlibSetupCard(); diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index fcfda2f532..3c9538170d 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -215,8 +215,6 @@ static const int ym3812_note[13] = { }; int MidiDriver_AdLib::openAdLib(bool isSCI0) { - int rate = _mixer->getOutputRate(); - _stereo = STEREO; debug(3, "ADLIB: Starting driver in %s mode", (isSCI0 ? "SCI0" : "SCI1")); @@ -233,7 +231,7 @@ int MidiDriver_AdLib::openAdLib(bool isSCI0) { if (!_opl) return -1; - _opl->init(rate); + _opl->init(); setRegister(0xBD, 0); setRegister(0x08, 0); diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp index adcda68e10..b22180b47f 100644 --- a/engines/scumm/players/player_ad.cpp +++ b/engines/scumm/players/player_ad.cpp @@ -38,7 +38,7 @@ namespace Scumm { Player_AD::Player_AD(ScummEngine *scumm, Audio::Mixer *mixer) : _vm(scumm), _mixer(mixer), _rate(mixer->getOutputRate()) { _opl2 = OPL::Config::create(); - if (!_opl2->init(_rate)) { + if (!_opl2->init()) { error("Could not initialize OPL2 emulator"); } diff --git a/engines/sherlock/scalpel/drivers/adlib.cpp b/engines/sherlock/scalpel/drivers/adlib.cpp index 91641fcccd..3c5a6559c4 100644 --- a/engines/sherlock/scalpel/drivers/adlib.cpp +++ b/engines/sherlock/scalpel/drivers/adlib.cpp @@ -285,8 +285,6 @@ private: }; int MidiDriver_SH_AdLib::open() { - int rate = _mixer->getOutputRate(); - debugC(kDebugLevelAdLibDriver, "AdLib: starting driver"); _opl = OPL::Config::create(OPL::Config::kOpl2); @@ -294,7 +292,7 @@ int MidiDriver_SH_AdLib::open() { if (!_opl) return -1; - _opl->init(rate); + _opl->init(); MidiDriver_Emulated::open(); diff --git a/engines/sky/music/adlibmusic.cpp b/engines/sky/music/adlibmusic.cpp index 2b73cb1411..e410b3fb7b 100644 --- a/engines/sky/music/adlibmusic.cpp +++ b/engines/sky/music/adlibmusic.cpp @@ -36,7 +36,7 @@ AdLibMusic::AdLibMusic(Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pMixer, pD _sampleRate = pMixer->getOutputRate(); _opl = OPL::Config::create(); - if (!_opl || !_opl->init(_sampleRate)) + if (!_opl || !_opl->init()) error("Failed to create OPL"); _mixer->playStream(Audio::Mixer::kMusicSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 455b58d09f..6ff983eef6 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2746,7 +2746,7 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _sampleRate = _mixer->getOutputRate(); _opl = OPL::Config::create(); assert(_opl); - _opl->init(_sampleRate); + _opl->init(); _samplesTillCallback = 0; _samplesTillCallbackRemainder = 0; |