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 /audio | |
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 'audio')
-rw-r--r-- | audio/fmopl.h | 3 | ||||
-rw-r--r-- | audio/miles_adlib.cpp | 4 | ||||
-rw-r--r-- | audio/softsynth/adlib.cpp | 2 | ||||
-rw-r--r-- | audio/softsynth/opl/dosbox.cpp | 9 | ||||
-rw-r--r-- | audio/softsynth/opl/dosbox.h | 2 | ||||
-rw-r--r-- | audio/softsynth/opl/mame.cpp | 6 | ||||
-rw-r--r-- | audio/softsynth/opl/mame.h | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/audio/fmopl.h b/audio/fmopl.h index b8dbdc1550..aaa8edd42d 100644 --- a/audio/fmopl.h +++ b/audio/fmopl.h @@ -108,10 +108,9 @@ public: /** * Initializes the OPL emulator. * - * @param rate output sample rate * @return true on success, false on failure */ - virtual bool init(int rate) = 0; + virtual bool init() = 0; /** * Reinitializes the OPL emulator diff --git a/audio/miles_adlib.cpp b/audio/miles_adlib.cpp index 903b0a92be..4560a812e7 100644 --- a/audio/miles_adlib.cpp +++ b/audio/miles_adlib.cpp @@ -298,8 +298,6 @@ MidiDriver_Miles_AdLib::~MidiDriver_Miles_AdLib() { } int MidiDriver_Miles_AdLib::open() { - int rate = _mixer->getOutputRate(); - if (_modeOPL3) { // Try to create OPL3 first _opl = OPL::Config::create(OPL::Config::kOpl3); @@ -319,7 +317,7 @@ int MidiDriver_Miles_AdLib::open() { return -1; } - _opl->init(rate); + _opl->init(); MidiDriver_Emulated::open(); diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp index 98519343b4..49e69ecd57 100644 --- a/audio/softsynth/adlib.cpp +++ b/audio/softsynth/adlib.cpp @@ -1434,7 +1434,7 @@ int MidiDriver_ADLIB::open() { _opl3Mode = false; } #endif - _opl->init(getRate()); + _opl->init(); _regCache = (byte *)calloc(256, 1); diff --git a/audio/softsynth/opl/dosbox.cpp b/audio/softsynth/opl/dosbox.cpp index 5c3d833f54..bcc73a9b9e 100644 --- a/audio/softsynth/opl/dosbox.cpp +++ b/audio/softsynth/opl/dosbox.cpp @@ -32,6 +32,7 @@ #include "dosbox.h" #include "dbopl.h" +#include "audio/mixer.h" #include "common/system.h" #include "common/scummsys.h" #include "common/util.h" @@ -156,7 +157,7 @@ void OPL::free() { _emulator = 0; } -bool OPL::init(int rate) { +bool OPL::init() { free(); memset(&_reg, 0, sizeof(_reg)); @@ -167,19 +168,19 @@ bool OPL::init(int rate) { return false; DBOPL::InitTables(); - _emulator->Setup(rate); + _rate = g_system->getMixer()->getOutputRate(); + _emulator->Setup(_rate); if (_type == Config::kDualOpl2) { // Setup opl3 mode in the hander _emulator->WriteReg(0x105, 1); } - _rate = rate; return true; } void OPL::reset() { - init(_rate); + init(); } void OPL::write(int port, int val) { diff --git a/audio/softsynth/opl/dosbox.h b/audio/softsynth/opl/dosbox.h index 513a49f6b8..d3df6ba6ed 100644 --- a/audio/softsynth/opl/dosbox.h +++ b/audio/softsynth/opl/dosbox.h @@ -87,7 +87,7 @@ public: OPL(Config::OplType type); ~OPL(); - bool init(int rate); + bool init(); void reset(); void write(int a, int v); diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp index da75ba76ba..1a5810f6c8 100644 --- a/audio/softsynth/opl/mame.cpp +++ b/audio/softsynth/opl/mame.cpp @@ -31,6 +31,8 @@ #include "mame.h" +#include "audio/mixer.h" +#include "common/system.h" #include "common/textconsole.h" #include "common/util.h" @@ -50,11 +52,11 @@ OPL::~OPL() { _opl = 0; } -bool OPL::init(int rate) { +bool OPL::init() { if (_opl) MAME::OPLDestroy(_opl); - _opl = MAME::makeAdLibOPL(rate); + _opl = MAME::makeAdLibOPL(g_system->getMixer()->getOutputRate()); return (_opl != 0); } diff --git a/audio/softsynth/opl/mame.h b/audio/softsynth/opl/mame.h index bd479d9e45..080cc6d171 100644 --- a/audio/softsynth/opl/mame.h +++ b/audio/softsynth/opl/mame.h @@ -181,7 +181,7 @@ public: OPL() : _opl(0) {} ~OPL(); - bool init(int rate); + bool init(); void reset(); void write(int a, int v); |