- The garbage collector is now run one last time just before exiting the game.
- Removed movie volume from the sound menu and renamed some of the other options to give the MIDI device name more room to display itself. - Moved the midi device selection into the main sound menu. - Added FMOD as MIDI device -1, to replace the MIDI mapper. This is still the default device. By default, it uses exactly the same DLS instruments as the Microsoft GS Wavetable Synth. If you have another set DLS level 1 patch set you want to use, set the snd_midipatchfile cvar to specify where it should load the instruments from. - Changed the ProduceMIDI function to store its output into a TArray<BYTE>. An overloaded version wraps around it to continue to supply file-writing support for external Timidity++ usage. - Added an FMOD credits banner to comply with their non-commercial license. - Reimplemented the snd_buffersize cvar for the FMOD Ex sound system. Rather than a time in ms, this is now the length in samples of the DSP buffer. Also added the snd_buffercount cvar to offer complete control over the call to FMOD::System::setDSPBufferSize(). Note that with any snd_samplerate below about 44kHz, you will need to set snd_buffersize to avoid long latencies. - Reimplemented the snd_output cvar for the FMOD Ex sound system. - Changed snd_samplerate default to 0. This now means to use the default sample rate. - Made snd_output, snd_output_format, snd_speakermode, snd_resampler, and snd_hrtf available through the menu. - Split the HRTF effect selection into its own cvar: snd_hrtf. - Removed 96000 Hz option from the menu. It's still available through the cvar, if desired. - Fixed: If Windows sound init failed, retry with DirectSound. (Apparently, WASAPI doesn't work with more than two speakers and PCM-Float output at the same time.) - Fixed: Area sounds only played from the front speakers once you got within the 2D panning area. SVN r854 (trunk)
This commit is contained in:
parent
d730d7ee1c
commit
8d0c48bf81
21 changed files with 615 additions and 186 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "i_musicinterns.h"
|
||||
#include "c_dispatch.h"
|
||||
#include "i_music.h"
|
||||
#include "i_system.h"
|
||||
|
||||
#include "templates.h"
|
||||
#include "v_text.h"
|
||||
|
|
@ -56,19 +57,22 @@ void I_InitMusicWin32 ()
|
|||
|
||||
void I_ShutdownMusicWin32 ()
|
||||
{
|
||||
// I don't know if this is an NT 4.0 bug or an FMOD bug, but if waveout
|
||||
// is used for sound, and a MIDI is also played, then when I quit, the OS
|
||||
// Ancient bug a saw on NT 4.0 and an old version of FMOD 3: If waveout
|
||||
// is used for sound and a MIDI is also played, then when I quit, the OS
|
||||
// tells me a free block was modified after being freed. This is
|
||||
// apparently a synchronization issue between two threads, because if I
|
||||
// put this Sleep here after stopping the music but before shutting down
|
||||
// the entire sound system, the error does not happen. I don't think it's
|
||||
// a driver problem, because it happens with both a Vortex 2 and an Audigy.
|
||||
// Though if their drivers are both based off some common Microsoft sample
|
||||
// code, I suppose it could be a driver issue.
|
||||
Sleep (50);
|
||||
// the entire sound system, the error does not happen. Observed with a
|
||||
// Vortex 2 (may Aureal rest in peace) and an Audigy (damn you, Creative!).
|
||||
// I no longer have a system with NT4 drivers, so I don't know if this
|
||||
// workaround is still needed or not.
|
||||
if (OSPlatform == os_WinNT4)
|
||||
{
|
||||
Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
void I_BuildMIDIMenuList (struct value_s **outValues, float *numValues)
|
||||
void I_BuildMIDIMenuList (struct value_t **outValues, float *numValues)
|
||||
{
|
||||
if (*outValues == NULL)
|
||||
{
|
||||
|
|
@ -79,13 +83,13 @@ void I_BuildMIDIMenuList (struct value_s **outValues, float *numValues)
|
|||
|
||||
values[0].name = "TiMidity++";
|
||||
values[0].value = -2.0;
|
||||
values[1].name = "FMOD";
|
||||
values[1].value = -1.0;
|
||||
if (nummididevices > 0)
|
||||
{
|
||||
UINT id;
|
||||
int p;
|
||||
|
||||
values[1].name = "MIDI Mapper";
|
||||
values[1].value = -1.0;
|
||||
for (id = 0, p = 2; id < nummididevices; ++id)
|
||||
{
|
||||
MIDIOUTCAPS caps;
|
||||
|
|
@ -107,7 +111,7 @@ void I_BuildMIDIMenuList (struct value_s **outValues, float *numValues)
|
|||
}
|
||||
else
|
||||
{
|
||||
*numValues = 1.f;
|
||||
*numValues = 2.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -157,9 +161,9 @@ CCMD (snd_listmididevices)
|
|||
MMRESULT res;
|
||||
|
||||
PrintMidiDevice (-2, "TiMidity++", 0, 0);
|
||||
PrintMidiDevice (-1, "FMOD", 0, 0);
|
||||
if (nummididevices != 0)
|
||||
{
|
||||
PrintMidiDevice (-1, "MIDI Mapper", MOD_MAPPER, 0);
|
||||
for (id = 0; id < nummididevices; ++id)
|
||||
{
|
||||
res = midiOutGetDevCaps (id, &caps, sizeof(caps));
|
||||
|
|
@ -174,4 +178,39 @@ CCMD (snd_listmididevices)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// Everything but Windows uses this code.
|
||||
|
||||
CUSTOM_CVAR(Int, snd_mididevice, -1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < -2)
|
||||
self = -2;
|
||||
else if (self > -1)
|
||||
self = -1;
|
||||
}
|
||||
|
||||
void I_BuildMIDIMenuList (struct value_t **outValues, float *numValues)
|
||||
{
|
||||
if (*outValues == NULL)
|
||||
{
|
||||
int count = 1 + nummididevices + (nummididevices > 0);
|
||||
value_t *values;
|
||||
|
||||
*outValues = values = new value_t[count];
|
||||
|
||||
values[0].name = "TiMidity++";
|
||||
values[0].value = -2.0;
|
||||
values[1].name = "FMOD";
|
||||
values[1].value = -1.0;
|
||||
*numValues = 2.f;
|
||||
}
|
||||
}
|
||||
|
||||
CCMD (snd_listmididevices)
|
||||
{
|
||||
Printf("%s-2. TiMidity++\n", -2 == snd_mididevice ? TEXTCOLOR_BOLD : "");
|
||||
Printf("%s-1. FMOD\n", -1 == snd_mididevice ? TEXTCOLOR_BOLD : "");
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue