mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Rename some FMOD references to be generic sound system
Since they relates to other sound backends as well, there's no need to single out FMOD in these places.
This commit is contained in:
parent
0adfdf31dd
commit
1a40c95f84
11 changed files with 31 additions and 31 deletions
|
@ -1367,7 +1367,7 @@ static void S_AddSNDINFO (int lump)
|
|||
FName nm = sc.String;
|
||||
sc.MustGetString();
|
||||
if (sc.Compare("timidity")) MidiDevices[nm] = MDEV_TIMIDITY;
|
||||
else if (sc.Compare("fmod")) MidiDevices[nm] = MDEV_FMOD;
|
||||
else if (sc.Compare("fmod") || sc.Compare("sndsys")) MidiDevices[nm] = MDEV_SNDSYS;
|
||||
else if (sc.Compare("standard")) MidiDevices[nm] = MDEV_MMAPI;
|
||||
else if (sc.Compare("opl")) MidiDevices[nm] = MDEV_OPL;
|
||||
else if (sc.Compare("default")) MidiDevices[nm] = MDEV_DEFAULT;
|
||||
|
|
|
@ -1326,7 +1326,7 @@ sfxinfo_t *S_LoadSound(sfxinfo_t *sfx)
|
|||
}
|
||||
// If the sound is raw, just load it as such.
|
||||
// Otherwise, try the sound as DMX format.
|
||||
// If that fails, let FMOD try and figure it out.
|
||||
// If that fails, let the sound system try and figure it out.
|
||||
else if (sfx->bLoadRAW ||
|
||||
(((BYTE *)sfxdata)[0] == 3 && ((BYTE *)sfxdata)[1] == 0 && len <= size - 8))
|
||||
{
|
||||
|
|
|
@ -389,7 +389,7 @@ enum EMidiDevice
|
|||
MDEV_DEFAULT = -1,
|
||||
MDEV_MMAPI = 0,
|
||||
MDEV_OPL = 1,
|
||||
MDEV_FMOD = 2,
|
||||
MDEV_SNDSYS = 2,
|
||||
MDEV_TIMIDITY = 3,
|
||||
MDEV_FLUIDSYNTH = 4,
|
||||
MDEV_GUS = 5,
|
||||
|
|
|
@ -396,9 +396,9 @@ MusInfo *I_RegisterSong (std::auto_ptr<FileReader> reader, int device)
|
|||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
// non-Windows platforms don't support MDEV_MMAPI so map to MDEV_FMOD
|
||||
// non-Windows platforms don't support MDEV_MMAPI so map to MDEV_SNDSYS
|
||||
if (device == MDEV_MMAPI)
|
||||
device = MDEV_FMOD;
|
||||
device = MDEV_SNDSYS;
|
||||
#endif
|
||||
|
||||
// Check for gzip compression. Some formats are expected to have players
|
||||
|
@ -435,17 +435,17 @@ MusInfo *I_RegisterSong (std::auto_ptr<FileReader> reader, int device)
|
|||
{
|
||||
EMidiDevice devtype = (EMidiDevice)device;
|
||||
|
||||
retry_as_fmod:
|
||||
retry_as_sndsys:
|
||||
info = CreateMIDIStreamer(reader, devtype, miditype);
|
||||
if (info != NULL && !info->IsValid())
|
||||
{
|
||||
delete info;
|
||||
info = NULL;
|
||||
}
|
||||
if (info == NULL && devtype != MDEV_FMOD && snd_mididevice < 0)
|
||||
if (info == NULL && devtype != MDEV_SNDSYS && snd_mididevice < 0)
|
||||
{
|
||||
devtype = MDEV_FMOD;
|
||||
goto retry_as_fmod;
|
||||
devtype = MDEV_SNDSYS;
|
||||
goto retry_as_sndsys;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
if (info == NULL && devtype != MDEV_MMAPI && snd_mididevice >= 0)
|
||||
|
@ -495,14 +495,14 @@ retry_as_fmod:
|
|||
}
|
||||
}
|
||||
|
||||
// no FMOD => no modules/streams
|
||||
// no support in sound system => no modules/streams
|
||||
// 1024 bytes is an arbitrary restriction. It's assumed that anything
|
||||
// smaller than this can't possibly be a valid music file if it hasn't
|
||||
// been identified already, so don't even bother trying to load it.
|
||||
// Of course MIDIs shorter than 1024 bytes should pass.
|
||||
if (info == NULL && (reader->GetLength() >= 1024 || id[0] == MAKE_ID('M','T','h','d')))
|
||||
{
|
||||
// Let FMOD figure out what it is.
|
||||
// Let the sound system figure out what it is.
|
||||
info = new StreamSong (reader);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,16 +169,16 @@ protected:
|
|||
bool bLooping;
|
||||
};
|
||||
|
||||
// FMOD pseudo-MIDI device --------------------------------------------------
|
||||
// Sound System pseudo-MIDI device ------------------------------------------
|
||||
|
||||
class FMODMIDIDevice : public PseudoMIDIDevice
|
||||
class SndSysMIDIDevice : public PseudoMIDIDevice
|
||||
{
|
||||
public:
|
||||
int Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata);
|
||||
bool Preprocess(MIDIStreamer *song, bool looping);
|
||||
};
|
||||
|
||||
// MIDI file played with TiMidity++ and possibly streamed through FMOD ------
|
||||
// MIDI file played with TiMidity++ and possibly streamed through the Sound System
|
||||
|
||||
class TimidityPPMIDIDevice : public PseudoMIDIDevice
|
||||
{
|
||||
|
@ -661,7 +661,7 @@ protected:
|
|||
EventSource EventDue;
|
||||
};
|
||||
|
||||
// Anything supported by FMOD out of the box --------------------------------
|
||||
// Anything supported by the sound system out of the box --------------------
|
||||
|
||||
class StreamSong : public MusInfo
|
||||
{
|
||||
|
@ -685,7 +685,7 @@ protected:
|
|||
SoundStream *m_Stream;
|
||||
};
|
||||
|
||||
// MUS file played by a software OPL2 synth and streamed through FMOD -------
|
||||
// MUS file played by a software OPL2 synth and streamed through the sound system
|
||||
|
||||
class OPLMUSSong : public StreamSong
|
||||
{
|
||||
|
|
|
@ -1004,8 +1004,8 @@ MusInfo *MOD_OpenSong(std::auto_ptr<FileReader> &reader)
|
|||
// No way to get the filename, so we can't check for a .mod extension, and
|
||||
// therefore, trying to load an old 15-instrument SoundTracker module is not
|
||||
// safe. We'll restrict MOD loading to 31-instrument modules with known
|
||||
// signatures and let FMOD worry about 15-instrument ones. (Assuming it even
|
||||
// supports them; I have not checked.)
|
||||
// signatures and let the sound system worry about 15-instrument ones.
|
||||
// (Assuming it even supports them)
|
||||
duh = dumb_read_mod_quick(f, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static void AddDefaultMidiDevices(FOptionValues *opt)
|
|||
pair[p+1].Value = -3.0;
|
||||
pair[p+2].Text = "TiMidity++";
|
||||
pair[p+2].Value = -2.0;
|
||||
pair[p+3].Text = "FMOD";
|
||||
pair[p+3].Text = "Sound System";
|
||||
pair[p+3].Value = -1.0;
|
||||
|
||||
}
|
||||
|
|
|
@ -608,7 +608,7 @@ int TimidityPPMIDIDevice::Resume()
|
|||
{
|
||||
if (LaunchTimidity())
|
||||
{
|
||||
// Assume success if not mixing with FMOD
|
||||
// Assume success if not mixing with the sound system
|
||||
if (Stream == NULL || Stream->Play(true, timidity_mastervolume))
|
||||
{
|
||||
Started = true;
|
||||
|
|
|
@ -214,13 +214,13 @@ EMidiDevice MIDIStreamer::SelectMIDIDevice(EMidiDevice device)
|
|||
- if explicitly selected by $mididevice
|
||||
- when snd_mididevice is -2 and no midi device is set for the song
|
||||
|
||||
- FMod:
|
||||
- Sound System:
|
||||
- if explicitly selected by $mididevice
|
||||
- when snd_mididevice is -1 and no midi device is set for the song
|
||||
- as fallback when both OPL and Timidity failed unless snd_mididevice is >= 0
|
||||
|
||||
- MMAPI (Win32 only):
|
||||
- if explicitly selected by $mididevice (non-Win32 redirects this to FMOD)
|
||||
- if explicitly selected by $mididevice (non-Win32 redirects this to Sound System)
|
||||
- when snd_mididevice is >= 0 and no midi device is set for the song
|
||||
- as fallback when both OPL and Timidity failed and snd_mididevice is >= 0
|
||||
*/
|
||||
|
@ -232,7 +232,7 @@ EMidiDevice MIDIStreamer::SelectMIDIDevice(EMidiDevice device)
|
|||
}
|
||||
switch (snd_mididevice)
|
||||
{
|
||||
case -1: return MDEV_FMOD;
|
||||
case -1: return MDEV_SNDSYS;
|
||||
case -2: return MDEV_TIMIDITY;
|
||||
case -3: return MDEV_OPL;
|
||||
case -4: return MDEV_GUS;
|
||||
|
@ -243,7 +243,7 @@ EMidiDevice MIDIStreamer::SelectMIDIDevice(EMidiDevice device)
|
|||
#ifdef _WIN32
|
||||
return MDEV_MMAPI;
|
||||
#else
|
||||
return MDEV_FMOD;
|
||||
return MDEV_SNDSYS;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -270,8 +270,8 @@ MIDIDevice *MIDIStreamer::CreateMIDIDevice(EMidiDevice devtype) const
|
|||
return new FluidSynthMIDIDevice;
|
||||
#endif
|
||||
|
||||
case MDEV_FMOD:
|
||||
return new FMODMIDIDevice;
|
||||
case MDEV_SNDSYS:
|
||||
return new SndSysMIDIDevice;
|
||||
|
||||
case MDEV_GUS:
|
||||
return new TimidityMIDIDevice;
|
||||
|
|
|
@ -235,24 +235,24 @@ FString PseudoMIDIDevice::GetStats()
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMODMIDIDevice :: Open
|
||||
// SndSysMIDIDevice :: Open
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FMODMIDIDevice::Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata)
|
||||
int SndSysMIDIDevice::Open(void (*callback)(unsigned int, void *, DWORD, DWORD), void *userdata)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMODMIDIDevice :: Preprocess
|
||||
// SndSysMIDIDevice :: Preprocess
|
||||
//
|
||||
// Create a standard MIDI file and stream it.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool FMODMIDIDevice::Preprocess(MIDIStreamer *song, bool looping)
|
||||
bool SndSysMIDIDevice::Preprocess(MIDIStreamer *song, bool looping)
|
||||
{
|
||||
std::auto_ptr<MemoryArrayReader> reader(new MemoryArrayReader(NULL, 0));
|
||||
song->CreateSMF(reader->GetArray(), looping ? 0 : 1);
|
||||
|
|
|
@ -1526,7 +1526,7 @@ OptionMenu AdvSoundOptions
|
|||
|
||||
OptionValue ModReplayers
|
||||
{
|
||||
0.0, "FMOD"
|
||||
0.0, "Sound System"
|
||||
1.0, "foo_dumb"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue