aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorFlorian Kagerer2010-06-22 15:30:41 +0000
committerFlorian Kagerer2010-06-22 15:30:41 +0000
commit46ec88f74d9b7596cee2e6a167b1ccf361771601 (patch)
treebbee6636c5bdb26ef1922cb3ec3c6b61d0bf8f23 /sound/softsynth
parentbb9f556c363718959a43c7a65cec1944b626d358 (diff)
downloadscummvm-rg350-46ec88f74d9b7596cee2e6a167b1ccf361771601.tar.gz
scummvm-rg350-46ec88f74d9b7596cee2e6a167b1ccf361771601.tar.bz2
scummvm-rg350-46ec88f74d9b7596cee2e6a167b1ccf361771601.zip
GUI/LAUNCHER: This should fix the regression concerning pc speaker / pcjr support caused by patch #1956501
svn-id: r50145
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/pcspk.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/softsynth/pcspk.cpp b/sound/softsynth/pcspk.cpp
index 396d9328f1..8f66578a0b 100644
--- a/sound/softsynth/pcspk.cpp
+++ b/sound/softsynth/pcspk.cpp
@@ -24,6 +24,7 @@
*/
#include "sound/softsynth/pcspk.h"
+#include "sound/null.h"
namespace Audio {
@@ -128,3 +129,59 @@ int8 PCSpeaker::generateTriangle(uint32 x, uint32 oscLength) {
}
} // End of namespace Audio
+
+
+// Plugin interface
+// (This can only create a null driver since pc speaker support is not part of the
+// midi driver architecture. But we need the plugin for the options menu in the launcher
+// and for MidiDriver::detectDevice() which is more or less used by all engines.)
+
+class PCSpeakerMusicPlugin : public NullMusicPlugin {
+public:
+ const char *getName() const {
+ return _s("PC Speaker Emulator");
+ }
+
+ const char *getId() const {
+ return "pcspk";
+ }
+
+ MusicDevices getDevices() const;
+};
+
+MusicDevices PCSpeakerMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, _s(""), MT_PCSPK));
+ return devices;
+}
+
+class PCjrMusicPlugin : public NullMusicPlugin {
+public:
+ const char *getName() const {
+ return _s("IBM PCjr Emulator");
+ }
+
+ const char *getId() const {
+ return "pcjr";
+ }
+
+ MusicDevices getDevices() const;
+};
+
+MusicDevices PCjrMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, _s(""), MT_PCJR));
+ return devices;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(PCSPK)
+ //REGISTER_PLUGIN_DYNAMIC(PCSPK, PLUGIN_TYPE_MUSIC, PCSpeakerMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(PCSPK, PLUGIN_TYPE_MUSIC, PCSpeakerMusicPlugin);
+//#endif
+
+//#if PLUGIN_ENABLED_DYNAMIC(PCJR)
+ //REGISTER_PLUGIN_DYNAMIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(PCJR, PLUGIN_TYPE_MUSIC, PCjrMusicPlugin);
+//#endif \ No newline at end of file