diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index b5ed34f1c..f6c247b57 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -234,7 +234,6 @@ protected: // FluidSynth implementation of a MIDI device ------------------------------- -#ifdef HAVE_FLUIDSYNTH #ifndef DYN_FLUIDSYNTH #include #else @@ -302,7 +301,6 @@ protected: void UnloadFluidSynth(); #endif }; -#endif // Base class for streaming MUS and MIDI files ------------------------------ diff --git a/src/sound/mididevices/music_fluidsynth_mididevice.cpp b/src/sound/mididevices/music_fluidsynth_mididevice.cpp index b89b280ab..90cb2ba67 100644 --- a/src/sound/mididevices/music_fluidsynth_mididevice.cpp +++ b/src/sound/mididevices/music_fluidsynth_mididevice.cpp @@ -32,8 +32,6 @@ ** */ -#ifdef HAVE_FLUIDSYNTH - // HEADER FILES ------------------------------------------------------------ #include "i_musicinterns.h" @@ -760,5 +758,4 @@ void FluidSynthMIDIDevice::UnloadFluidSynth() #endif -#endif diff --git a/src/sound/music_midi_base.cpp b/src/sound/music_midi_base.cpp index 10ee4a2c2..810dd7e12 100644 --- a/src/sound/music_midi_base.cpp +++ b/src/sound/music_midi_base.cpp @@ -50,31 +50,22 @@ static uint32_t nummididevices; static bool nummididevicesset; -#ifdef HAVE_FLUIDSYNTH #define NUM_DEF_DEVICES 5 -#else -#define NUM_DEF_DEVICES 4 -#endif static void AddDefaultMidiDevices(FOptionValues *opt) { int p; FOptionValues::Pair *pair = &opt->mValues[opt->mValues.Reserve(NUM_DEF_DEVICES)]; -#ifdef HAVE_FLUIDSYNTH pair[0].Text = "FluidSynth"; pair[0].Value = -5.0; - p = 1; -#else - p = 0; -#endif - pair[p].Text = "GUS"; - pair[p].Value = -4.0; - pair[p+1].Text = "OPL Synth Emulation"; - pair[p+1].Value = -3.0; - pair[p+2].Text = "TiMidity++"; - pair[p+2].Value = -2.0; - pair[p+3].Text = "WildMidi"; - pair[p+3].Value = -6.0; + pair[1].Text = "GUS"; + pair[1].Value = -4.0; + pair[2].Text = "OPL Synth Emulation"; + pair[2].Value = -3.0; + pair[3].Text = "TiMidity++"; + pair[3].Value = -2.0; + pair[4].Text = "WildMidi"; + pair[4].Value = -6.0; } @@ -115,11 +106,7 @@ void MIDIDeviceChanged(int newdev, bool force) if (!force) oldmididev = newdev; } -#ifdef HAVE_FLUIDSYNTH #define DEF_MIDIDEV -5 -#else -#define DEF_MIDIDEV -3 -#endif #ifdef _WIN32 unsigned mididevice; @@ -214,9 +201,7 @@ CCMD (snd_listmididevices) MMRESULT res; PrintMidiDevice (-6, "WildMidi", MIDIDEV_SWSYNTH, 0); -#ifdef HAVE_FLUIDSYNTH PrintMidiDevice (-5, "FluidSynth", MIDIDEV_SWSYNTH, 0); -#endif PrintMidiDevice (-4, "Gravis Ultrasound Emulation", MIDIDEV_SWSYNTH, 0); PrintMidiDevice (-3, "Emulated OPL FM Synth", MIDIDEV_FMSYNTH, 0); PrintMidiDevice (-2, "TiMidity++", MIDIDEV_SWSYNTH, 0); @@ -259,9 +244,7 @@ void I_BuildMIDIMenuList (FOptionValues *opt) CCMD (snd_listmididevices) { Printf("%s-6. WildMidi\n", -6 == snd_mididevice ? TEXTCOLOR_BOLD : ""); -#ifdef HAVE_FLUIDSYNTH Printf("%s-5. FluidSynth\n", -5 == snd_mididevice ? TEXTCOLOR_BOLD : ""); -#endif Printf("%s-4. Gravis Ultrasound Emulation\n", -4 == snd_mididevice ? TEXTCOLOR_BOLD : ""); Printf("%s-3. Emulated OPL FM Synth\n", -3 == snd_mididevice ? TEXTCOLOR_BOLD : ""); Printf("%s-2. TiMidity++\n", -2 == snd_mididevice ? TEXTCOLOR_BOLD : ""); diff --git a/src/sound/musicformats/music_midistream.cpp b/src/sound/musicformats/music_midistream.cpp index d5ecb0cce..45a25d926 100644 --- a/src/sound/musicformats/music_midistream.cpp +++ b/src/sound/musicformats/music_midistream.cpp @@ -171,9 +171,7 @@ EMidiDevice MIDIStreamer::SelectMIDIDevice(EMidiDevice device) case -2: return MDEV_TIMIDITY; case -3: return MDEV_OPL; case -4: return MDEV_GUS; -#ifdef HAVE_FLUIDSYNTH case -5: return MDEV_FLUIDSYNTH; -#endif case -6: return MDEV_WILDMIDI; default: #ifdef _WIN32 @@ -192,28 +190,23 @@ EMidiDevice MIDIStreamer::SelectMIDIDevice(EMidiDevice device) MIDIDevice *MIDIStreamer::CreateMIDIDevice(EMidiDevice devtype) { + // fixme: This should check up front if the device can be started. + // Checks to ensure that a device finds a compatible sound font are entirely missing here. + switch (devtype) { - case MDEV_MMAPI: -#ifdef _WIN32 - return CreateWinMIDIDevice(mididevice); -#endif - assert(0); - // Intentional fall-through for non-Windows systems. - case MDEV_GUS: return new TimidityMIDIDevice(Args); + + case MDEV_MMAPI: +#ifdef _WIN32 + return CreateWinMIDIDevice(mididevice); +#endif + // Intentional fall-through for non-Windows systems. -#ifdef HAVE_FLUIDSYNTH case MDEV_FLUIDSYNTH: - return new FluidSynthMIDIDevice(Args); -#endif - case MDEV_SNDSYS: -#ifdef HAVE_FLUIDSYNTH - return new FluidSynthMIDIDevice(nullptr); -#endif - // if no FluidSynth, fall through to OPL. + return new FluidSynthMIDIDevice(Args); case MDEV_OPL: try @@ -224,12 +217,7 @@ MIDIDevice *MIDIStreamer::CreateMIDIDevice(EMidiDevice devtype) { // The creation of an OPL MIDI device can abort with an error if no GENMIDI lump can be found. Printf("Unable to create OPL MIDI device: %s\nFalling back to default playback", err.GetMessage()); -#ifdef HAVE_FLUIDSYNTH return new FluidSynthMIDIDevice(nullptr); -#else - // Someone dared to compile GZDoom without FluidSynth support and then started an IWAD without GENMIDI support. Ugh... - return nullptr; -#endif } case MDEV_TIMIDITY: