Ticket #9169: audio_output.patch
File audio_output.patch, 2.9 KB (added by , 15 years ago) |
---|
-
gui/options.cpp
42 42 #include "sound/mixer.h" 43 43 #include "sound/fmopl.h" 44 44 45 #include "engines/metaengine.h" 46 45 47 namespace GUI { 46 48 47 49 enum { … … 625 627 _midiPopUpDesc = new StaticTextWidget(boss, prefix + "auMidiPopupDesc", "Music driver:"); 626 628 _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup"); 627 629 630 // Query the metaEngine to know the supported output types 631 Common::String gameId = ConfMan.get("gameid", _domain); 632 const EnginePlugin *plugin = 0; 633 int musicTypes = ~0; 634 635 EngineMan.findGame(gameId, &plugin); 636 if (plugin) { 637 musicTypes = (*plugin)->getSupportedMusicTypes(gameId.c_str()); 638 } 639 628 640 // Populate it 629 641 const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers(); 630 642 while (md->name) { 631 _midiPopUp->appendEntry(md->description, md->id); 643 // Show capable drivers only 644 if (md->flags & musicTypes) { 645 _midiPopUp->appendEntry(md->description, md->id); 646 } 632 647 md++; 633 648 } 634 649 -
engines/metaengine.h
63 63 virtual GameDescriptor findGame(const char *gameid) const = 0; 64 64 65 65 /** 66 * Returns the music output types supported by the engine, for example 67 * if a game supports MDT_MIDI and MDT_ADLIB the return value is 68 * bitwise OR of MDT_MIDI and MDT_ADLIB 69 * default is return all 1's 70 * 71 * @param gameid game identifier 72 * @return output types supported by the engine 73 */ 74 virtual int getSupportedMusicTypes(const char *gameid) const { 75 return ~0; 76 } 77 78 /** 66 79 * Runs the engine's game detector on the given list of files, and returns a 67 80 * (possibly empty) list of games supported by the engine which it was able 68 81 * to detect amongst the given files. -
engines/scumm/detection.cpp
701 701 virtual GameList getSupportedGames() const; 702 702 virtual GameDescriptor findGame(const char *gameid) const; 703 703 virtual GameList detectGames(const Common::FSList &fslist) const; 704 virtual int getSupportedMusicTypes(const char *gameid) const; 704 705 705 706 virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; 706 707 … … 737 738 return AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); 738 739 } 739 740 741 int ScummMetaEngine::getSupportedMusicTypes(const char *gameid) const { 742 for (const GameSettings *g = gameVariantsTable; g->gameid; ++g) { 743 if (!scumm_stricmp(gameid, g->gameid)) { 744 return g->midi; 745 } 746 } 747 return ~0; 748 } 749 740 750 static Common::String generatePreferredTarget(const DetectorResult &x) { 741 751 Common::String res(x.game.gameid); 742 752