Removed all conditional checks on HAVE_FLUIDSYNTH

With the current setup it makes zero sense to exclude it. This was all a remnant of its introduction when it couldn't be taken for granted.
This commit is contained in:
Christoph Oelckers 2018-02-23 14:36:26 +01:00
parent adebd644f2
commit ddedcd9fc2
4 changed files with 18 additions and 52 deletions

View file

@ -234,7 +234,6 @@ protected:
// FluidSynth implementation of a MIDI device -------------------------------
#ifdef HAVE_FLUIDSYNTH
#ifndef DYN_FLUIDSYNTH
#include <fluidsynth.h>
#else
@ -302,7 +301,6 @@ protected:
void UnloadFluidSynth();
#endif
};
#endif
// Base class for streaming MUS and MIDI files ------------------------------

View file

@ -32,8 +32,6 @@
**
*/
#ifdef HAVE_FLUIDSYNTH
// HEADER FILES ------------------------------------------------------------
#include "i_musicinterns.h"
@ -760,5 +758,4 @@ void FluidSynthMIDIDevice::UnloadFluidSynth()
#endif
#endif

View file

@ -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 : "");

View file

@ -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: