Fall back on working synth when preferred unavail

This commit is contained in:
Dale Whinham committed 2020-11-22 23:16:44 +00:00
1 parent dc77ecc790
commit f1b8f28ede
2 files changed
+15 -2

No files matched your search

+3
View File
@@ -16,6 +16,9 @@
# Set the default synthesizer to be made active on startup.
#
# If the default synthesizer is unavilable (e.g. missing ROMs or SoundFonts),
# the first working synth is made active.
#
# Values: mt32*, soundfont
#
# mt32: Use mt32emu (Munt) for Roland MT-32 emulation
+12 -2
View File
@@ -161,8 +161,18 @@ bool CMT32Pi::Initialize(bool bSerialMIDIEnabled)
if (!m_pCurrentSynth)
{
logger.Write(MT32PiName, LogError, "Preferred synth failed to initialize successfully");
LCDLog(TLCDLogType::Startup, "Synth init failed!");
return false;
// Activate any working synth
if (m_pMT32Synth)
m_pCurrentSynth = m_pMT32Synth;
else if (m_pSoundFontSynth)
m_pCurrentSynth = m_pSoundFontSynth;
else
{
logger.Write(MT32PiName, LogError, "No synths available");
LCDLog(TLCDLogType::Startup, "Synth init failed!");
return false;
}
}
CUSBMIDIDevice* pMIDIDevice = static_cast<CUSBMIDIDevice*>(CDeviceNameService::Get()->GetDevice("umidi1", FALSE));