aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth/ym2612.cpp
diff options
context:
space:
mode:
authorJordi Vilalta Prat2008-05-14 14:56:29 +0000
committerJordi Vilalta Prat2008-05-14 14:56:29 +0000
commiteb6c809d2b3ccf238fa5efbf45b6cd2b00a82cd9 (patch)
treed52fc76e91a873d7f457b6f97cb57039210895ee /sound/softsynth/ym2612.cpp
parente2d58f4885352744c88892e93fe2cdd33ecfa1b0 (diff)
downloadscummvm-rg350-eb6c809d2b3ccf238fa5efbf45b6cd2b00a82cd9.tar.gz
scummvm-rg350-eb6c809d2b3ccf238fa5efbf45b6cd2b00a82cd9.tar.bz2
scummvm-rg350-eb6c809d2b3ccf238fa5efbf45b6cd2b00a82cd9.zip
- Added more information (ID and capabilities) to the MIDI drivers
- Added the MidiPlugin interface to the remaining MIDI drivers - Added an initial MidiManager to handle the MIDI plugins (just static plugins by now) svn-id: r32117
Diffstat (limited to 'sound/softsynth/ym2612.cpp')
-rw-r--r--sound/softsynth/ym2612.cpp43
1 files changed, 37 insertions, 6 deletions
diff --git a/sound/softsynth/ym2612.cpp b/sound/softsynth/ym2612.cpp
index 1e985aeb1c..3fcc2c3fc4 100644
--- a/sound/softsynth/ym2612.cpp
+++ b/sound/softsynth/ym2612.cpp
@@ -26,6 +26,7 @@
#include "sound/softsynth/ym2612.h"
#include "common/util.h"
+#include "sound/midiplugin.h"
////////////////////////////////////////
//
@@ -751,13 +752,43 @@ void MidiDriver_YM2612::removeLookupTables() {
sintbl = powtbl = frequencyTable = keycodeTable = keyscaleTable = attackOut = 0;
}
-////////////////////////////////////////
-//
-// MidiDriver_YM2612 factory
-//
-////////////////////////////////////////
+
+// Plugin interface
+
+class TownsMidiPlugin : public MidiPluginObject {
+public:
+ virtual const char *getName() const {
+ return "FM Towns Emulator";
+ }
+
+ virtual const char *getId() const {
+ return "towns";
+ }
+
+ virtual int getCapabilities() const {
+ return MDT_TOWNS;
+ }
+
+ virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+PluginError TownsMidiPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_YM2612(mixer);
+
+ return kNoError;
+}
MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer) {
- return new MidiDriver_YM2612(mixer);
+ MidiDriver *mididriver;
+
+ TownsMidiPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
}
+//#if PLUGIN_ENABLED_DYNAMIC(TOWNS)
+ //REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MIDI, TownsMidiPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MIDI, TownsMidiPlugin);
+//#endif