diff --git a/src/common/audio/music/i_music.cpp b/src/common/audio/music/i_music.cpp index bc05d4da50..453ea70774 100644 --- a/src/common/audio/music/i_music.cpp +++ b/src/common/audio/music/i_music.cpp @@ -200,7 +200,8 @@ static void SetupWgOpn() static void SetupDMXGUS() { - int lump = fileSystem.CheckNumForFullName("DMXGUS"); + int lump = fileSystem.CheckNumForName("DMXGUSC", ns_global); + if (lump < 0) lump = fileSystem.CheckNumForName("DMXGUS", ns_global); if (lump < 0) { return; diff --git a/src/common/audio/music/i_soundfont.cpp b/src/common/audio/music/i_soundfont.cpp index 8d928a42ca..a01f835e65 100644 --- a/src/common/audio/music/i_soundfont.cpp +++ b/src/common/audio/music/i_soundfont.cpp @@ -194,6 +194,7 @@ FileReader FSF2Reader::OpenFile(const char *name) FZipPatReader::FZipPatReader(const char *filename) { + mAllowAbsolutePaths = true; resf = FResourceFile::OpenResourceFile(filename, true); } @@ -218,6 +219,7 @@ FileReader FZipPatReader::OpenFile(const char *name) return lump->NewReader(); } } + fr.OpenFile(name); return fr; } @@ -478,13 +480,6 @@ FSoundFontReader *FSoundFontManager::OpenSoundFont(const char *name, int allowed } } - auto sfi = FindSoundFont(name, allowed); - if (sfi != nullptr) - { - if (sfi->type == SF_SF2) return new FSF2Reader(sfi->mFilename); - else return new FZipPatReader(sfi->mFilename); - } - // The sound font collection did not yield any good results. // Next check if the file is a .sf file if (allowed & SF_SF2) { @@ -500,6 +495,7 @@ FSoundFontReader *FSoundFontManager::OpenSoundFont(const char *name, int allowed } } } + // Next check if the file is a resource file (it should contains gus patches and a timidity.cfg file) if (allowed & SF_GUS) { FileReader fr; @@ -523,6 +519,13 @@ FSoundFontReader *FSoundFontManager::OpenSoundFont(const char *name, int allowed return new FPatchSetReader(name); } } + // Lastly check in the sound font collection for a specific item or pick the first valid item available. + auto sfi = FindSoundFont(name, allowed); + if (sfi != nullptr) + { + if (sfi->type == SF_SF2) return new FSF2Reader(sfi->mFilename); + else return new FZipPatReader(sfi->mFilename); + } return nullptr; } diff --git a/src/common/audio/music/music_config.cpp b/src/common/audio/music/music_config.cpp index 86eef267e3..ee85706110 100644 --- a/src/common/audio/music/music_config.cpp +++ b/src/common/audio/music/music_config.cpp @@ -278,7 +278,7 @@ CUSTOM_CVAR(String, opn_custom_bank, "", CVAR_ARCHIVE | CVAR_VIRTUAL) //========================================================================== -CUSTOM_CVAR(String, midi_config, GAMENAMELOWERCASE, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(String, midi_config, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_STRING_CVAR(gus_config); } diff --git a/src/common/menu/menudef.cpp b/src/common/menu/menudef.cpp index 7e344c314d..44d3040e2f 100644 --- a/src/common/menu/menudef.cpp +++ b/src/common/menu/menudef.cpp @@ -1496,7 +1496,7 @@ static void InitMusicMenus() { DMenuDescriptor **advmenu = MenuDescriptors.CheckKey("AdvSoundOptions"); auto soundfonts = sfmanager.GetList(); - std::tuple sfmenus[] = { std::make_tuple("GusConfigMenu", SF_SF2 | SF_GUS, "midi_config"), + std::tuple sfmenus[] = { std::make_tuple("GusConfigMenu", SF_GUS, "midi_config"), std::make_tuple("WildMidiConfigMenu", SF_GUS, "wildmidi_config"), std::make_tuple("TimidityConfigMenu", SF_SF2 | SF_GUS, "timidity_config"), std::make_tuple("FluidPatchsetMenu", SF_SF2, "fluid_patchset"), diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 90e3ed0edf..8b39980847 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -2103,7 +2103,7 @@ OptionMenu ModReplayerOptions protected Title "$ADVSNDMNU_TIMIDITY" LabeledSubMenu "$ADVSNDMNU_SELCONFIG", "timidity_config", "TimidityConfigMenu" Option "$ADVSNDMNU_REVERB", "timidity_reverb", "TimidityReverb" - Slider "$ADVSNDMNU_REVERB_LEVEL", "timidity_reverb_level", 9, 127, 1, 0 + Slider "$ADVSNDMNU_REVERB_LEVEL", "timidity_reverb_level", 0, 127, 1, 0 Option "$ADVSNDMNU_CHORUS", "timidity_chorus", "OnOff" // other CVARs need to be revieved for usefulness }