Index: gui/options.cpp
===================================================================
--- gui/options.cpp	(revision 48678)
+++ gui/options.cpp	(working copy)
@@ -42,6 +42,8 @@
 #include "sound/mixer.h"
 #include "sound/fmopl.h"
 
+#include "engines/metaengine.h"
+
 namespace GUI {
 
 enum {
@@ -625,10 +627,23 @@
 	_midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", "Music driver:");
 	_midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup");
 
+	// Query the metaEngine to know the supported output types
+	Common::String gameId = ConfMan.get("gameid", _domain);
+	const EnginePlugin *plugin = 0;
+	int musicTypes = ~0;
+
+	EngineMan.findGame(gameId, &plugin);
+	if (plugin) {
+		musicTypes = (*plugin)->getSupportedMusicTypes(gameId.c_str());
+	}
+
 	// Populate it
 	const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
 	while (md->name) {
-		_midiPopUp->appendEntry(md->description, md->id);
+		// Show capable drivers only
+		if (md->flags & musicTypes) {
+			_midiPopUp->appendEntry(md->description, md->id);
+		}
 		md++;
 	}
 
Index: engines/metaengine.h
===================================================================
--- engines/metaengine.h	(revision 48678)
+++ engines/metaengine.h	(working copy)
@@ -63,6 +63,19 @@
 	virtual GameDescriptor findGame(const char *gameid) const = 0;
 
 	/**
+	 * Returns the music output types supported by the engine, for example
+	 * if a game supports MDT_MIDI and MDT_ADLIB the return value is
+	 * bitwise OR of MDT_MIDI and MDT_ADLIB
+	 * default is return all 1's
+	 *
+	 * @param gameid	game identifier
+	 * @return			output types supported by the engine
+	 */
+	virtual int getSupportedMusicTypes(const char *gameid) const {
+		return ~0;
+	}
+	
+	/**
 	 * Runs the engine's game detector on the given list of files, and returns a
 	 * (possibly empty) list of games supported by the engine which it was able
 	 * to detect amongst the given files.
Index: engines/scumm/detection.cpp
===================================================================
--- engines/scumm/detection.cpp	(revision 48678)
+++ engines/scumm/detection.cpp	(working copy)
@@ -701,6 +701,7 @@
 	virtual GameList getSupportedGames() const;
 	virtual GameDescriptor findGame(const char *gameid) const;
 	virtual GameList detectGames(const Common::FSList &fslist) const;
+	virtual int getSupportedMusicTypes(const char *gameid) const;
 
 	virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
 
@@ -737,6 +738,15 @@
 	return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
 }
 
+int ScummMetaEngine::getSupportedMusicTypes(const char *gameid) const {	
+	for (const GameSettings *g = gameVariantsTable; g->gameid; ++g) {
+		if (!scumm_stricmp(gameid, g->gameid)) {
+			return g->midi;
+		}
+	}
+	return ~0;
+}
+
 static Common::String generatePreferredTarget(const DetectorResult &x) {
 	Common::String res(x.game.gameid);
 
