Add a cvar for the timidity++ config file

This commit is contained in:
Chris Robinson 2017-09-06 14:48:43 -07:00 committed by Rachael Alexanderson
parent 8f8c2ef2ef
commit 49df5a7f16

View file

@ -123,6 +123,7 @@ CUSTOM_CVAR(String, timidity_exe, "timidity", CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
} }
CVAR (String, timidity_extargs, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // extra args to pass to Timidity CVAR (String, timidity_extargs, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // extra args to pass to Timidity
CVAR (String, timidity_config, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (String, timidity_chorus, "0", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (String, timidity_chorus, "0", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (String, timidity_reverb, "0", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (String, timidity_reverb, "0", CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, timidity_stereo, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, timidity_stereo, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
@ -184,6 +185,12 @@ TimidityPPMIDIDevice::TimidityPPMIDIDevice(const char *args)
CommandLine.Format("%s %s -EFchorus=%s -EFreverb=%s -s%d ", CommandLine.Format("%s %s -EFchorus=%s -EFreverb=%s -s%d ",
args, *timidity_extargs, args, *timidity_extargs,
*timidity_chorus, *timidity_reverb, *timidity_frequency); *timidity_chorus, *timidity_reverb, *timidity_frequency);
if (**timidity_config != '\0')
{
CommandLine += "-c \"";
CommandLine += timidity_config;
CommandLine += "\" ";
}
#endif #endif
if (DiskName == NULL) if (DiskName == NULL)
@ -570,6 +577,11 @@ bool TimidityPPMIDIDevice::LaunchTimidity ()
arglist.push_back(exename); arglist.push_back(exename);
for(size_t i = 0;i < words.we_wordc;i++) for(size_t i = 0;i < words.we_wordc;i++)
arglist.push_back(words.we_wordv[i]); arglist.push_back(words.we_wordv[i]);
if(**timidity_config != '\0')
{
arglist.push_back("-c");
arglist.push_back(timidity_config);
}
arglist.push_back(chorusarg.c_str()); arglist.push_back(chorusarg.c_str());
arglist.push_back(reverbarg.c_str()); arglist.push_back(reverbarg.c_str());
arglist.push_back(sratearg.c_str()); arglist.push_back(sratearg.c_str());