aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
Diffstat (limited to 'audio')
-rw-r--r--audio/fmopl.h3
-rw-r--r--audio/miles_adlib.cpp4
-rw-r--r--audio/softsynth/adlib.cpp2
-rw-r--r--audio/softsynth/opl/dosbox.cpp9
-rw-r--r--audio/softsynth/opl/dosbox.h2
-rw-r--r--audio/softsynth/opl/mame.cpp6
-rw-r--r--audio/softsynth/opl/mame.h2
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);