[Scummvm-cvs-logs] SF.net SVN: scummvm: [32695] scummvm/trunk

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Fri Jun 13 18:04:43 CEST 2008


Revision: 32695
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32695&view=rev
Author:   jvprat
Date:     2008-06-13 09:04:43 -0700 (Fri, 13 Jun 2008)

Log Message:
-----------
Added initial interface to list music devices and their types

Modified Paths:
--------------
    scummvm/trunk/backends/midi/alsa.cpp
    scummvm/trunk/backends/midi/camd.cpp
    scummvm/trunk/backends/midi/coreaudio.cpp
    scummvm/trunk/backends/midi/coremidi.cpp
    scummvm/trunk/backends/midi/dmedia.cpp
    scummvm/trunk/backends/midi/quicktime.cpp
    scummvm/trunk/backends/midi/seq.cpp
    scummvm/trunk/backends/midi/timidity.cpp
    scummvm/trunk/backends/midi/windows.cpp
    scummvm/trunk/backends/midi/ypa1.cpp
    scummvm/trunk/backends/midi/zodiac.cpp
    scummvm/trunk/sound/module.mk
    scummvm/trunk/sound/musicplugin.h
    scummvm/trunk/sound/null.cpp
    scummvm/trunk/sound/softsynth/adlib.cpp
    scummvm/trunk/sound/softsynth/fluidsynth.cpp
    scummvm/trunk/sound/softsynth/mt32.cpp
    scummvm/trunk/sound/softsynth/ym2612.cpp

Added Paths:
-----------
    scummvm/trunk/sound/musicplugin.cpp

Modified: scummvm/trunk/backends/midi/alsa.cpp
===================================================================
--- scummvm/trunk/backends/midi/alsa.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/alsa.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -243,21 +243,16 @@
 
 class AlsaMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "ALSA";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "alsa";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual Common::StringList getDevices() const;
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
 #define perm_ok(pinfo,bits) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits))
@@ -271,8 +266,8 @@
 	return 0;
 }
 
-Common::StringList AlsaMusicPlugin::getDevices() const {
-	Common::StringList devices;
+MusicDevices AlsaMusicPlugin::getDevices() const {
+	MusicDevices devices;
 
 	snd_seq_t *seq;
 	if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) < 0)
@@ -292,7 +287,8 @@
 		while (!found_valid_port && snd_seq_query_next_port(seq, pinfo) >= 0) {
 			if (check_permission(pinfo)) {
 				found_valid_port = true;
-				devices.push_back(snd_seq_client_info_get_name(cinfo));
+				// TODO: Return a different music type depending on the configuration
+				devices.push_back(MusicDevice(this, snd_seq_client_info_get_name(cinfo), MT_GM));
 				//snd_seq_client_info_get_client(cinfo) : snd_seq_port_info_get_port(pinfo)
 			}
 		}

Modified: scummvm/trunk/backends/midi/camd.cpp
===================================================================
--- scummvm/trunk/backends/midi/camd.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/camd.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -168,23 +168,26 @@
 
 class CamdMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "CAMD";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "camd";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
 
-	//virtual Common::StringList getDevices() const;
+MusicDevices CamdMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
 
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
-};
-
 PluginError CamdMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_CAMD();
 

Modified: scummvm/trunk/backends/midi/coreaudio.cpp
===================================================================
--- scummvm/trunk/backends/midi/coreaudio.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/coreaudio.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -209,21 +209,26 @@
 
 class CoreAudioMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "CoreAudio";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "core";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices CoreAudioMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError CoreAudioMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_CORE();
 

Modified: scummvm/trunk/backends/midi/coremidi.cpp
===================================================================
--- scummvm/trunk/backends/midi/coremidi.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/coremidi.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -181,21 +181,26 @@
 
 class CoreMIDIMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "CoreMIDI";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "coremidi";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices CoreMIDIMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError CoreMIDIMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_CoreMIDI();
 

Modified: scummvm/trunk/backends/midi/dmedia.cpp
===================================================================
--- scummvm/trunk/backends/midi/dmedia.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/dmedia.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -180,21 +180,26 @@
 
 class DMediaMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "DMedia";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "dmedia";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices DMediaMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError DMediaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_DMEDIA();
 

Modified: scummvm/trunk/backends/midi/quicktime.cpp
===================================================================
--- scummvm/trunk/backends/midi/quicktime.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/quicktime.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -267,21 +267,26 @@
 
 class QuickTimeMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "QuickTime";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "qt";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices QuickTimeMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError QuickTimeMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_QT();
 

Modified: scummvm/trunk/backends/midi/seq.cpp
===================================================================
--- scummvm/trunk/backends/midi/seq.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/seq.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -175,21 +175,26 @@
 
 class SeqMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "SEQ";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "seq";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices SeqMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError SeqMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_SEQ();
 

Modified: scummvm/trunk/backends/midi/timidity.cpp
===================================================================
--- scummvm/trunk/backends/midi/timidity.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/timidity.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -516,21 +516,24 @@
 
 class TimidityMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "TiMidity";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "timidity";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices TimidityMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError TimidityMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_TIMIDITY();
 

Modified: scummvm/trunk/backends/midi/windows.cpp
===================================================================
--- scummvm/trunk/backends/midi/windows.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/windows.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -149,21 +149,26 @@
 
 class WindowsMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "Windows MIDI";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "windows";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices WindowsMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError WindowsMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_WIN();
 

Modified: scummvm/trunk/backends/midi/ypa1.cpp
===================================================================
--- scummvm/trunk/backends/midi/ypa1.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/ypa1.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -108,21 +108,26 @@
 
 class YamahaPa1MusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "Yamaha Pa1";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "ypa1";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices YamahaPa1MusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError YamahaPa1MusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_YamahaPa1();
 

Modified: scummvm/trunk/backends/midi/zodiac.cpp
===================================================================
--- scummvm/trunk/backends/midi/zodiac.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/backends/midi/zodiac.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -126,21 +126,26 @@
 
 class ZodiacMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "Tapwave Zodiac";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "zodiac";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices ZodiacMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: Return a different music type depending on the configuration
+	// TODO: List the available devices
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError ZodiacMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_Zodiac();
 

Modified: scummvm/trunk/sound/module.mk
===================================================================
--- scummvm/trunk/sound/module.mk	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/module.mk	2008-06-13 16:04:43 UTC (rev 32695)
@@ -15,6 +15,7 @@
 	mixer.o \
 	mp3.o \
 	mpu401.o \
+	musicplugin.o \
 	null.o \
 	voc.o \
 	vorbis.o \

Added: scummvm/trunk/sound/musicplugin.cpp
===================================================================
--- scummvm/trunk/sound/musicplugin.cpp	                        (rev 0)
+++ scummvm/trunk/sound/musicplugin.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "sound/musicplugin.h"
+
+MusicDevice::MusicDevice(MusicPluginObject const *musicPlugin, Common::String name, MusicType mt) :
+	_musicDriverName(musicPlugin->getName()), _musicDriverId(musicPlugin->getId()),
+	_name(name), _type(mt) {
+}
+
+Common::String MusicDevice::getCompleteName() {
+	Common::String name;
+
+	if (_name.empty()) {
+		// Default device, just show the driver name
+		name = _musicDriverName;
+	} else {
+		// Show both device and driver names
+		name = _name;
+		name += " [";
+		name += _musicDriverName;
+		name += "]";
+	}
+
+	return name;
+}


Property changes on: scummvm/trunk/sound/musicplugin.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: scummvm/trunk/sound/musicplugin.h
===================================================================
--- scummvm/trunk/sound/musicplugin.h	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/musicplugin.h	2008-06-13 16:04:43 UTC (rev 32695)
@@ -29,6 +29,51 @@
 #include "sound/mididrv.h"
 
 /**
+ * Music types that music drivers can implement and engines can rely on.
+ */
+enum MusicType {
+	MT_PCSPK = 1,  // PC Speaker
+	MT_PCJR  = 2,  // PCjr
+	MT_ADLIB = 3,  // AdLib
+	MT_TOWNS = 4,  // FM-TOWNS
+	MT_GM    = 5,  // General MIDI
+	MT_MT32  = 6,  // MT-32
+	MT_GS    = 7   // Roland GS
+};
+
+class MusicPluginObject;
+
+/**
+ * Description of a Music device. Used to list the devices a Music driver
+ * can manage and their capabilities.
+ * A device with an empty name means the default device.
+ */
+class MusicDevice {
+public:
+	MusicDevice(MusicPluginObject const *musicPlugin, Common::String name, MusicType mt);
+
+	Common::String &getName() { return _name; }
+	Common::String &getMusicDriverName() { return _musicDriverName; }
+	Common::String &getMusicDriverId() { return _musicDriverId; }
+	MusicType getMusicType() { return _type; }
+
+	/**
+	 * Returns a user readable string that contains the name of the current
+	 * device name (if it isn't the default one) and the name of the driver.
+	 */
+	Common::String getCompleteName();
+
+private:
+	Common::String _name;
+	Common::String _musicDriverName;
+	Common::String _musicDriverId;
+	MusicType _type;
+};
+
+/** List of music devices. */
+typedef Common::List<MusicDevice> MusicDevices;
+
+/**
  * A MusicPluginObject is essentially a factory for MidiDriver instances with
  * the added ability of listing the available devices and their capabilities.
  */
@@ -43,22 +88,11 @@
 	virtual const char *getId() const = 0;
 
 	/**
-	 * Returns the type kind of music supported by this driver, as specified
-	 * by the MidiDriverFlags enum.
+	 * Returns a list of the available devices.
 	 */
-	virtual int getCapabilities() const = 0;
+	virtual MusicDevices getDevices() const = 0;
 
 	/**
-	 * Returns a list of the available devices. The empty string means the
-	 * default device.
-	 */
-	virtual Common::StringList getDevices() const {
-		Common::StringList dev;
-		dev.push_back("");
-		return dev;
-	}
-
-	/**
 	 * Tries to instantiate a MIDI Driver instance based on the settings of
 	 * the currently active ConfMan target. That is, the MusicPluginObject
 	 * should query the ConfMan singleton for the device name, port, etc.

Modified: scummvm/trunk/sound/null.cpp
===================================================================
--- scummvm/trunk/sound/null.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/null.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -37,19 +37,16 @@
 
 class NullMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "No music";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "null";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI | MDT_PCSPK | MDT_ADLIB | MDT_TOWNS;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
 PluginError NullMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
@@ -58,6 +55,13 @@
 	return kNoError;
 }
 
+MusicDevices NullMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	// TODO: return a different music type?
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer) {
 	MidiDriver *mididriver;
 

Modified: scummvm/trunk/sound/softsynth/adlib.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/adlib.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/softsynth/adlib.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -1518,24 +1518,27 @@
 
 // Plugin interface
 
-class AdlibMusicPlugin : public MusicPluginObject {
+class AdlibEmuMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "AdLib Emulator";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "adlib";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_ADLIB;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
-PluginError AdlibMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+MusicDevices AdlibEmuMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, "", MT_ADLIB));
+	return devices;
+}
+
+PluginError AdlibEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_ADLIB(mixer);
 
 	return kNoError;
@@ -1544,14 +1547,14 @@
 MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) {
 	MidiDriver *mididriver;
 
-	AdlibMusicPlugin p;
+	AdlibEmuMusicPlugin p;
 	p.createInstance(mixer, &mididriver);
 
 	return mididriver;
 }
 
 //#if PLUGIN_ENABLED_DYNAMIC(ADLIB)
-	//REGISTER_PLUGIN_DYNAMIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibMusicPlugin);
+	//REGISTER_PLUGIN_DYNAMIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
 //#else
-	REGISTER_PLUGIN_STATIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibMusicPlugin);
+	REGISTER_PLUGIN_STATIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
 //#endif

Modified: scummvm/trunk/sound/softsynth/fluidsynth.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/fluidsynth.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/softsynth/fluidsynth.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -221,21 +221,24 @@
 
 class FluidSynthMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "FluidSynth";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "fluidsynth";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
+MusicDevices FluidSynthMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, "", MT_GM));
+	return devices;
+}
+
 PluginError FluidSynthMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_FluidSynth(mixer);
 

Modified: scummvm/trunk/sound/softsynth/mt32.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/softsynth/mt32.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -483,24 +483,27 @@
 
 // Plugin interface
 
-class MT32MusicPlugin : public MusicPluginObject {
+class MT32EmuMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "MT-32 Emulator";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "mt32";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_MIDI;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
-PluginError MT32MusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+MusicDevices MT32EmuMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, "", MT_MT32));
+	return devices;
+}
+
+PluginError MT32EmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_MT32(mixer);
 
 	return kNoError;
@@ -513,16 +516,16 @@
 
 	MidiDriver *mididriver;
 
-	MT32MusicPlugin p;
+	MT32EmuMusicPlugin p;
 	p.createInstance(mixer, &mididriver);
 
 	return mididriver;
 }
 
 //#if PLUGIN_ENABLED_DYNAMIC(MT32)
-	//REGISTER_PLUGIN_DYNAMIC(MT32, PLUGIN_TYPE_MUSIC, MT32MusicPlugin);
+	//REGISTER_PLUGIN_DYNAMIC(MT32, PLUGIN_TYPE_MUSIC, MT32EmuMusicPlugin);
 //#else
-	REGISTER_PLUGIN_STATIC(MT32, PLUGIN_TYPE_MUSIC, MT32MusicPlugin);
+	REGISTER_PLUGIN_STATIC(MT32, PLUGIN_TYPE_MUSIC, MT32EmuMusicPlugin);
 //#endif
 
 #endif

Modified: scummvm/trunk/sound/softsynth/ym2612.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/ym2612.cpp	2008-06-13 14:57:47 UTC (rev 32694)
+++ scummvm/trunk/sound/softsynth/ym2612.cpp	2008-06-13 16:04:43 UTC (rev 32695)
@@ -755,24 +755,27 @@
 
 // Plugin interface
 
-class TownsMusicPlugin : public MusicPluginObject {
+class TownsEmuMusicPlugin : public MusicPluginObject {
 public:
-	virtual const char *getName() const {
+	const char *getName() const {
 		return "FM Towns Emulator";
 	}
 
-	virtual const char *getId() const {
+	const char *getId() const {
 		return "towns";
 	}
 
-	virtual int getCapabilities() const {
-		return MDT_TOWNS;
-	}
-
-	virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+	MusicDevices getDevices() const;
+	PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
 };
 
-PluginError TownsMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+MusicDevices TownsEmuMusicPlugin::getDevices() const {
+	MusicDevices devices;
+	devices.push_back(MusicDevice(this, "", MT_TOWNS));
+	return devices;
+}
+
+PluginError TownsEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
 	*mididriver = new MidiDriver_YM2612(mixer);
 
 	return kNoError;
@@ -781,14 +784,14 @@
 MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer) {
 	MidiDriver *mididriver;
 
-	TownsMusicPlugin p;
+	TownsEmuMusicPlugin p;
 	p.createInstance(mixer, &mididriver);
 
 	return mididriver;
 }
 
 //#if PLUGIN_ENABLED_DYNAMIC(TOWNS)
-	//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsMusicPlugin);
+	//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
 //#else
-	REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsMusicPlugin);
+	REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
 //#endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list