diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mididrv.cpp | 37 | ||||
-rw-r--r-- | sound/mididrv.h | 61 |
2 files changed, 60 insertions, 38 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 0931f334f2..97913864cd 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -30,46 +30,48 @@ /** Internal list of all available 'midi' drivers. */ static const struct MidiDriverDescription midiDrivers[] = { - {"auto", "Default", MD_AUTO}, - {"null", "No music", MD_NULL}, + {"auto", "Default", MD_AUTO, MDT_NONE}, + {"null", "No music", MD_NULL, MDT_NONE}, #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) - {"windows", "Windows MIDI", MD_WINDOWS}, + {"windows", "Windows MIDI", MD_WINDOWS, MDT_NATIVE}, #endif #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) - {"seq", "SEQ", MD_SEQ}, + {"seq", "SEQ", MD_SEQ, MDT_NONE}, #endif #if defined(MACOSX) - {"qt", "QuickTime", MD_QTMUSIC}, - {"core", "CoreAudio", MD_COREAUDIO}, + {"qt", "QuickTime", MD_QTMUSIC, MDT_NATIVE}, + {"core", "CoreAudio", MD_COREAUDIO, MDT_NATIVE}, + {"coreaudio", "CoreAudio", MD_COREAUDIO, MDT_NATIVE}, + {"coremidi", "CoreMIDI", MD_COREMIDI, MDT_NATIVE}, #endif #if defined(__MORPHOS__) - {"etude", "Etude", MD_ETUDE}, + {"etude", "Etude", MD_ETUDE, MDT_NONE}, #endif #if defined(UNIX) && defined(USE_ALSA) - {"alsa", "ALSA", MD_ALSA}, + {"alsa", "ALSA", MD_ALSA, MDT_NONE}, #endif - {"adlib", "Adlib", MD_ADLIB}, - {"towns", "FM Towns", MD_TOWNS}, - {"pcspk", "PC Speaker", MD_PCSPK}, - {"pcjr", "IBM PCjr", MD_PCJR}, + {"adlib", "Adlib", MD_ADLIB, MDT_ADLIB}, + {"towns", "FM Towns", MD_TOWNS, MDT_TOWNS}, + {"pcspk", "PC Speaker", MD_PCSPK, MDT_PCSPK}, + {"pcjr", "IBM PCjr", MD_PCJR, MDT_PCSPK}, #ifdef USE_FLUIDSYNTH - {"fluidsynth", "FluidSynth", MD_FLUIDSYNTH}, + {"fluidsynth", "FluidSynth", MD_FLUIDSYNTH, MDT_NONE}, #endif #ifdef USE_MT32EMU - {"mt32", "MT-32", MD_MT32}, + {"mt32", "MT-32", MD_MT32, MDT_NONE}, #endif #if defined(PALMOS_MODE) - {"ypa1", "Yamaha Pa1", MD_YPA1}, - {"zodiac", "Tapwave Zodiac", MD_ZODIAC}, + {"ypa1", "Yamaha Pa1", MD_YPA1, MDT_NATIVE}, + {"zodiac", "Tapwave Zodiac", MD_ZODIAC, MDT_NATIVE}, #endif - {0, 0, 0} + {0, 0, MD_NULL, MDT_NONE} }; const byte MidiDriver::_mt32ToGm[128] = { @@ -210,6 +212,7 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) { #endif #if defined(MACOSX) case MD_COREAUDIO: return MidiDriver_CORE_create(); + case MD_COREMIDI: return MidiDriver_CoreMIDI_create(); #endif #if defined(UNIX) && defined(USE_ALSA) case MD_ALSA: return MidiDriver_ALSA_create(); diff --git a/sound/mididrv.h b/sound/mididrv.h index b9b361f0ca..62f00c31f9 100644 --- a/sound/mididrv.h +++ b/sound/mididrv.h @@ -33,28 +33,45 @@ namespace Audio { namespace Common { class String; } /** MIDI Driver Types */ -enum { - MD_AUTO = 0, - MD_NULL = 1, - MD_WINDOWS = 2, - MD_TIMIDITY = 3, - MD_SEQ = 4, - MD_QTMUSIC = 5, - MD_ETUDE = 6, - MD_COREAUDIO = 7, - MD_MIDIEMU = 8, - MD_ALSA = 9, - MD_ADLIB = 10, - MD_PCSPK = 11, - MD_PCJR = 12, - MD_TOWNS = 13, - MD_YPA1 = 14, // PalmOS - MD_ZODIAC = 15, // PalmOS - MD_MT32 = 16, - MD_FLUIDSYNTH = 17 +enum MidiDriverType { + MD_AUTO, + MD_NULL, + + // Windows + MD_WINDOWS, + + // Linux + MD_ALSA, + MD_SEQ, + + // Mac OS X + MD_QTMUSIC, + MD_COREAUDIO, + MD_COREMIDI, + + // PalmOS + MD_YPA1, + MD_ZODIAC, + + // MorphOS + MD_ETUDE, + + // "Fake" MIDI devices + MD_ADLIB, + MD_PCSPK, + MD_PCJR, + MD_TOWNS, + + // MIDI softsynths + MD_MT32, + MD_FLUIDSYNTH }; -enum MidiDriverType { +/** + * A set of bitmasks which can be used to specify what kind of midi + * driver is prefered. + */ +enum MidiDriverFlags { MDT_NONE = 0, MDT_PCSPK = 1, // MD_PCSPK and MD_PCJR MDT_ADLIB = 2, // MD_ADLIB @@ -71,7 +88,8 @@ enum MidiDriverType { struct MidiDriverDescription { const char *name; const char *description; - int id; + MidiDriverType id; + MidiDriverFlags flags; }; /** Abstract MIDI Driver Class */ @@ -199,6 +217,7 @@ extern MidiDriver *MidiDriver_WIN_create(); extern MidiDriver *MidiDriver_SEQ_create(); extern MidiDriver *MidiDriver_QT_create(); extern MidiDriver *MidiDriver_CORE_create(); +extern MidiDriver *MidiDriver_CoreMIDI_create(); extern MidiDriver *MidiDriver_ETUDE_create(); extern MidiDriver *MidiDriver_ALSA_create(); extern MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer); |