diff options
author | Robert Göffringmann | 2003-05-12 23:21:35 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-05-12 23:21:35 +0000 |
commit | 299a1a451fdbde6f7c8bed40596dc3a6786a6c3b (patch) | |
tree | 481209f23304510b903f669c2e4aa089f306e268 | |
parent | 81bfe8cd5116e99f794ddfa105378aa1d9a3f401 (diff) | |
download | scummvm-rg350-299a1a451fdbde6f7c8bed40596dc3a6786a6c3b.tar.gz scummvm-rg350-299a1a451fdbde6f7c8bed40596dc3a6786a6c3b.tar.bz2 scummvm-rg350-299a1a451fdbde6f7c8bed40596dc3a6786a6c3b.zip |
added method to detect which midi driver will be created
svn-id: r7482
-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(); |