[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.cpp,1.45,1.46 mididrv.h,1.29,1.30
Max Horn
fingolfin at users.sourceforge.net
Fri Oct 17 17:23:35 CEST 2003
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv12549/sound
Modified Files:
mididrv.cpp mididrv.h
Log Message:
We proudly present the latest installment of our hit series 'Untangle the mess': 'Help! Space Invaders refactored the music detector'... in other news, I obviously need to sleep now
Index: mididrv.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- mididrv.cpp 5 Oct 2003 15:36:52 -0000 1.45
+++ mididrv.cpp 18 Oct 2003 00:22:46 -0000 1.46
@@ -22,6 +22,7 @@
#include "stdafx.h"
#include "sound/mididrv.h"
+#include "common/str.h"
/** Internal list of all available 'midi' drivers. */
@@ -66,4 +67,21 @@
const MidiDriverDescription *getAvailableMidiDrivers() {
return midiDrivers;
+}
+
+int parseMusicDriver(const Common::String &str) {
+ if (str.isEmpty())
+ return -1;
+
+ const char *s = str.c_str();
+ const MidiDriverDescription *md = getAvailableMidiDrivers();
+
+ while (md->name) {
+ if (!scumm_stricmp(md->name, s)) {
+ return md->id;
+ }
+ md++;
+ }
+
+ return -1;
}
Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- mididrv.h 5 Oct 2003 15:36:52 -0000 1.29
+++ mididrv.h 18 Oct 2003 00:22:46 -0000 1.30
@@ -27,7 +27,7 @@
class MidiChannel;
class SoundMixer;
-
+namespace Common { class String; }
/** MIDI Driver Types */
enum {
@@ -47,6 +47,9 @@
MD_TOWNS = 13,
MD_YPA1 = 14 // PalmOS
};
+
+/** Convert a string containing a music driver name into MIDI Driver type. */
+extern int parseMusicDriver(const Common::String &str);
/**
* Abstract description of a MIDI driver. Used by the config file and command
More information about the Scummvm-git-logs
mailing list