From eb6c809d2b3ccf238fa5efbf45b6cd2b00a82cd9 Mon Sep 17 00:00:00 2001 From: Jordi Vilalta Prat Date: Wed, 14 May 2008 14:56:29 +0000 Subject: - 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 --- base/plugins.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ base/plugins.h | 2 ++ 2 files changed, 58 insertions(+) (limited to 'base') diff --git a/base/plugins.cpp b/base/plugins.cpp index c39b877eb8..7dae94e006 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -33,6 +33,7 @@ int pluginTypeVersions[PLUGIN_TYPE_MAX] = { PLUGIN_TYPE_ENGINE_VERSION, + PLUGIN_TYPE_MIDI_VERSION, }; @@ -82,6 +83,7 @@ public: // "Loader" for the static plugins. // Iterate over all registered (static) plugins and load them. + // Engine plugins #if PLUGIN_ENABLED_STATIC(SCUMM) LINK_PLUGIN(SCUMM) #endif @@ -140,6 +142,49 @@ public: LINK_PLUGIN(TOUCHE) #endif + // MIDI plugins + // TODO: Use defines to disable or enable each MIDI driver as a + // static/dynamic plugin, like it's done for the engines + LINK_PLUGIN(NULL) + #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) + LINK_PLUGIN(WINDOWS) + #endif + #if defined(UNIX) && defined(USE_ALSA) + LINK_PLUGIN(ALSA) + #endif + #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) + LINK_PLUGIN(SEQ) + #endif + #if defined(IRIX) + LINK_PLUGIN(DMEDIA) + #endif + #if defined(__amigaos4__) + LINK_PLUGIN(CAMD) + #endif + #if defined(MACOSX) + LINK_PLUGIN(COREAUDIO) + LINK_PLUGIN(COREMIDI) + LINK_PLUGIN(QUICKTIME) + #endif + #if defined(PALMOS_MODE) + # if defined(COMPILE_CLIE) + LINK_PLUGIN(YPA1) + # elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM)) + LINK_PLUGIN(ZODIAC) + # endif + #endif + #ifdef USE_FLUIDSYNTH + LINK_PLUGIN(FLUIDSYNTH) + #endif + #ifdef USE_MT32EMU + LINK_PLUGIN(MT32) + #endif + LINK_PLUGIN(ADLIB) + LINK_PLUGIN(TOWNS) + #if defined (UNIX) + LINK_PLUGIN(TIMIDITY) + #endif + return pl; } }; @@ -336,3 +381,14 @@ GameList EngineManager::detectGames(const FSList &fslist) const { const EnginePlugin::list &EngineManager::getPlugins() const { return (const EnginePlugin::list&)PluginManager::instance().getPlugins(PLUGIN_TYPE_ENGINE); } + + +// MIDI plugins + +#include "sound/midiplugin.h" + +DECLARE_SINGLETON(MidiManager); + +const MidiPlugin::list &MidiManager::getPlugins() const { + return (const MidiPlugin::list&)PluginManager::instance().getPlugins(PLUGIN_TYPE_MIDI); +} diff --git a/base/plugins.h b/base/plugins.h index 92b317498f..b64334074c 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -63,6 +63,7 @@ enum PluginType { PLUGIN_TYPE_ENGINE = 0, + PLUGIN_TYPE_MIDI, PLUGIN_TYPE_MAX }; @@ -70,6 +71,7 @@ enum PluginType { // TODO: Make the engine API version depend on ScummVM's version // because of the backlinking #define PLUGIN_TYPE_ENGINE_VERSION 1 +#define PLUGIN_TYPE_MIDI_VERSION 1 extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; -- cgit v1.2.3