- Increase the fluid_voices default to 128. It apparently has a poor voice cutting algorithm

which is painfully apparent on hexen.wad MAP01's music, which hits around 90 voices.
- Patch from Chris:
  * Add FluidSynth to the menu.
  * Enable FluidSynth for MIDI as well as MUS.
  * Fix CmakeLists.txt.


SVN r2554 (trunk)
This commit is contained in:
Randy Heit 2010-08-19 15:31:44 +00:00
parent f6edfd1300
commit 576e597d2b
4 changed files with 50 additions and 21 deletions

View file

@ -490,7 +490,7 @@ set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_L
include_directories( "${ZLIB_INCLUDE_DIR}" "${FMOD_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" )
if( FLUIDSYNTH_FOUND )
set( ZDOOM_LIBS "${FLUIDSYNTH_LIBRARIES}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${FLUIDSYNTH_LIBRARIES}" )
include_directories( "${FLUIDSYNTH_INCLUDE_DIR}" )
endif( FLUIDSYNTH_FOUND )

View file

@ -527,6 +527,12 @@ MusInfo *I_RegisterSong (const char *filename, BYTE *musiccache, int offset, int
{
info = new MIDISong2(file, musiccache, len, MIDI_Timidity);
}
#ifdef HAVE_FLUIDSYNTH
else if (snd_mididevice == -5 && device == MDEV_DEFAULT)
{
info = new MIDISong2(file, musiccache, len, MIDI_Fluid);
}
#endif
if (info != NULL && !info->IsValid())
{
delete info;

View file

@ -83,7 +83,7 @@ CUSTOM_CVAR(Bool, fluid_chorus, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
currSong->FluidSettingStr("synth.chorus.active", self ? "yes" : "no");
}
CUSTOM_CVAR(Int, fluid_voices, 32, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Int, fluid_voices, 128, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{
if (self < 16)
self = 16;

View file

@ -77,25 +77,34 @@ void I_BuildMIDIMenuList (struct value_t **outValues, float *numValues)
{
if (*outValues == NULL)
{
int count = 3 + nummididevices;
int count = 4 + nummididevices;
value_t *values;
UINT id;
int p;
int p = 0;
*outValues = values = new value_t[count];
values[0].name = "OPL Synth Emulation";
values[0].value = -3.0;
values[1].name = "TiMidity++";
values[1].value = -2.0;
values[2].name = "FMOD";
values[2].value = -1.0;
for (id = 0, p = 3; id < nummididevices; ++id)
#ifdef HAVE_FLUIDSYNTH
values[p].name = "FluidSynth";
values[p].value = -5.0;
++p;
#endif
values[p].name = "OPL Synth Emulation";
values[p].value = -3.0;
++p;
values[p].name = "TiMidity++";
values[p].value = -2.0;
++p;
values[p].name = "FMOD";
values[p].value = -1.0;
++p;
for (id = 0; id < nummididevices; ++id)
{
MIDIOUTCAPS caps;
MMRESULT res;
res = midiOutGetDevCaps (id, &caps, sizeof(caps));
assert(res == MMSYSERR_NOERROR);
if (res == MMSYSERR_NOERROR)
{
size_t len = strlen (caps.szPname) + 1;
@ -107,8 +116,7 @@ void I_BuildMIDIMenuList (struct value_t **outValues, float *numValues)
++p;
}
}
assert(p == count);
*numValues = float(count);
*numValues = float(p);
}
}
@ -154,6 +162,9 @@ CCMD (snd_listmididevices)
MIDIOUTCAPS caps;
MMRESULT res;
#ifdef HAVE_FLUIDSYNTH
PrintMidiDevice (-5, "FluidSynth", MOD_SWSYNTH, 0);
#endif
PrintMidiDevice (-3, "Emulated OPL FM Synth", MOD_FMSYNTH, 0);
PrintMidiDevice (-2, "TiMidity++", 0, MOD_SWSYNTH);
PrintMidiDevice (-1, "FMOD", 0, MOD_SWSYNTH);
@ -191,21 +202,33 @@ void I_BuildMIDIMenuList (struct value_t **outValues, float *numValues)
if (*outValues == NULL)
{
value_t *values;
int p = 0;
*outValues = values = new value_t[3];
*outValues = values = new value_t[4];
values[0].name = "OPL Synth Emulation";
values[0].value = -3.0;
values[1].name = "TiMidity++";
values[1].value = -2.0;
values[2].name = "FMOD";
values[2].value = -1.0;
*numValues = 3.f;
#ifdef HAVE_FLUIDSYNTH
values[p].name = "FluidSynth";
values[p].value = -5.0;
++p;
#endif
values[p].name = "OPL Synth Emulation";
values[p].value = -3.0;
++p;
values[p].name = "TiMidity++";
values[p].value = -2.0;
++p;
values[p].name = "FMOD";
values[p].value = -1.0;
++p;
*numValues = float(p);
}
}
CCMD (snd_listmididevices)
{
#ifdef HAVE_FLUIDSYNTH
Printf("%s-5. FluidSynth\n", -5 == snd_mididevice ? TEXTCOLOR_BOLD : "");
#endif
Printf("%s-3. Emulated OPL FM Synth\n", -3 == snd_mididevice ? TEXTCOLOR_BOLD : "");
Printf("%s-2. TiMidity++\n", -2 == snd_mididevice ? TEXTCOLOR_BOLD : "");
Printf("%s-1. FMOD\n", -1 == snd_mididevice ? TEXTCOLOR_BOLD : "");