aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRobert Göffringmann2003-05-12 23:21:35 +0000
committerRobert Göffringmann2003-05-12 23:21:35 +0000
commit299a1a451fdbde6f7c8bed40596dc3a6786a6c3b (patch)
tree481209f23304510b903f669c2e4aa089f306e268 /common
parent81bfe8cd5116e99f794ddfa105378aa1d9a3f401 (diff)
downloadscummvm-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
Diffstat (limited to 'common')
-rw-r--r--common/gameDetector.cpp24
-rw-r--r--common/gameDetector.h1
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();