From 1a40c95f84eb0114ac25e1b4b7a0f77eddb4eaef Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 26 Jun 2014 16:58:18 -0700 Subject: [PATCH] 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. --- src/s_advsound.cpp | 2 +- src/s_sound.cpp | 2 +- src/s_sound.h | 2 +- src/sound/i_music.cpp | 16 ++++++++-------- src/sound/i_musicinterns.h | 10 +++++----- src/sound/music_dumb.cpp | 4 ++-- src/sound/music_midi_base.cpp | 2 +- src/sound/music_midi_timidity.cpp | 2 +- src/sound/music_midistream.cpp | 12 ++++++------ src/sound/music_pseudo_mididevice.cpp | 8 ++++---- wadsrc/static/menudef.txt | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index c2d567f29..4206d3500 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -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; diff --git a/src/s_sound.cpp b/src/s_sound.cpp index c84c539ca..a54921500 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -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)) { diff --git a/src/s_sound.h b/src/s_sound.h index 346e51ce1..df3b87de8 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -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, diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index 1067b2b83..36ec7598a 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -396,9 +396,9 @@ MusInfo *I_RegisterSong (std::auto_ptr 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 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); } } diff --git a/src/sound/i_musicinterns.h b/src/sound/i_musicinterns.h index 43e52a722..698a8b5a8 100644 --- a/src/sound/i_musicinterns.h +++ b/src/sound/i_musicinterns.h @@ -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 { diff --git a/src/sound/music_dumb.cpp b/src/sound/music_dumb.cpp index bcacefe40..97ad2b5ea 100644 --- a/src/sound/music_dumb.cpp +++ b/src/sound/music_dumb.cpp @@ -1004,8 +1004,8 @@ MusInfo *MOD_OpenSong(std::auto_ptr &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); } diff --git a/src/sound/music_midi_base.cpp b/src/sound/music_midi_base.cpp index 78b88b92f..c33434aab 100644 --- a/src/sound/music_midi_base.cpp +++ b/src/sound/music_midi_base.cpp @@ -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; } diff --git a/src/sound/music_midi_timidity.cpp b/src/sound/music_midi_timidity.cpp index 4acda49b9..3c780d459 100644 --- a/src/sound/music_midi_timidity.cpp +++ b/src/sound/music_midi_timidity.cpp @@ -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; diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index ba0077903..b7fb54bf2 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -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; diff --git a/src/sound/music_pseudo_mididevice.cpp b/src/sound/music_pseudo_mididevice.cpp index ba52f0a08..422f039ce 100644 --- a/src/sound/music_pseudo_mididevice.cpp +++ b/src/sound/music_pseudo_mididevice.cpp @@ -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 reader(new MemoryArrayReader(NULL, 0)); song->CreateSMF(reader->GetArray(), looping ? 0 : 1); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index dd6ec08d3..52a77475c 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1526,7 +1526,7 @@ OptionMenu AdvSoundOptions OptionValue ModReplayers { - 0.0, "FMOD" + 0.0, "Sound System" 1.0, "foo_dumb" }