diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/gameDetector.cpp | 24 | ||||
-rw-r--r-- | common/gameDetector.h | 1 |
2 files changed, 14 insertions, 11 deletions
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 885a1e5754..a79bfa17dc 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -656,32 +656,34 @@ OSystem *GameDetector::createSystem() { #endif } -MidiDriver *GameDetector::createMidi() { - int drv = _midi_driver; +int GameDetector::getMidiDriverType() { + if (_midi_driver != MD_AUTO) return _midi_driver; - if (drv == MD_AUTO) { #if defined (WIN32) && !defined(_WIN32_WCE) - drv = MD_WINDOWS; // MD_WINDOWS is default MidiDriver on windows targets + return MD_WINDOWS; // MD_WINDOWS is default MidiDriver on windows targets #elif defined(MACOSX) - drv = MD_COREAUDIO; + return MD_COREAUDIO; #elif defined(__PALM_OS__) // must be before mac - drv = MD_YPA1; + return MD_YPA1; #elif defined(macintosh) - drv = MD_QTMUSIC; + return MD_QTMUSIC; #elif defined(__MORPHOS__) - drv = MD_ETUDE; + return MD_ETUDE; #elif defined (_WIN32_WCE) || defined(UNIX) || defined(X11_BACKEND) // Always use MIDI emulation via adlib driver on CE and UNIX device // TODO: We should, for the Unix targets, attempt to detect // whether a sequencer is available, and use it instead. - drv = MD_ADLIB; + return MD_ADLIB; #endif - } + return MD_NULL; +} + +MidiDriver *GameDetector::createMidi() { + int drv = getMidiDriverType(); switch(drv) { - case MD_AUTO: case MD_NULL: return MidiDriver_NULL_create(); #ifndef __PALM_OS__ case MD_ADLIB: _use_adlib = true; return MidiDriver_ADLIB_create(); diff --git a/common/gameDetector.h b/common/gameDetector.h index 6c6d6eee5e..01dd0ff380 100644 --- a/common/gameDetector.h +++ b/common/gameDetector.h @@ -178,6 +178,7 @@ public: public: OSystem *createSystem(); MidiDriver *createMidi(); + int getMidiDriverType(); int parseGraphicsMode(const char *s); void updateconfig(); |