commit b5c8eae107212a21e525f04434378e2108e0d93b
parent ed8606f27bf72a2b4950f0253a74c12f1635a547
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Tue, 23 Apr 2024 22:02:45 +0200
streamline rom not found error messages
Diffstat:
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/source/virusJucePlugin/VirusProcessor.cpp b/source/virusJucePlugin/VirusProcessor.cpp
@@ -78,7 +78,14 @@ void VirusProcessor::postConstruct()
synthLib::Device* VirusProcessor::createDevice()
{
const auto* rom = getSelectedRom();
- return new virusLib::Device(rom ? *rom : virusLib::ROMFile::invalid(), getPreferredDeviceSamplerate(), getHostSamplerate(), true);
+
+ if(!rom || !rom->isValid())
+ {
+ if(isTIFamily(m_defaultModel))
+ throw synthLib::DeviceException(synthLib::DeviceError::FirmwareMissing, "A Virus TI firmware (.bin) is required, but was not found.");
+ throw synthLib::DeviceException(synthLib::DeviceError::FirmwareMissing, "A Virus A/B/C operating system (.bin or .mid) is required, but was not found.");
+ }
+ return new virusLib::Device(*rom, getPreferredDeviceSamplerate(), getHostSamplerate(), true);
}
pluginLib::Controller* VirusProcessor::createController()
diff --git a/source/virusLib/device.cpp b/source/virusLib/device.cpp
@@ -18,9 +18,6 @@ namespace virusLib
: m_rom(std::move(_rom))
, m_samplerate(getDeviceSamplerate(_preferredDeviceSamplerate, _hostSamplerate))
{
- if(!m_rom.isValid())
- throw synthLib::DeviceException(synthLib::DeviceError::FirmwareMissing, "A firmware ROM file (firmware.bin) is required, but was not found.");
-
DspSingle* dsp1;
createDspInstances(dsp1, m_dsp2, m_rom, m_samplerate);
m_dsp.reset(dsp1);
diff --git a/source/xtLib/xt.cpp b/source/xtLib/xt.cpp
@@ -17,7 +17,7 @@ namespace xt
// create hardware, will use in-memory ROM if no ROM provided
const auto romFile = synthLib::findROM(g_romSize, g_romSize);
if(romFile.empty())
- throw synthLib::DeviceException(synthLib::DeviceError::FirmwareMissing, "Failed to find device ROM");
+ throw synthLib::DeviceException(synthLib::DeviceError::FirmwareMissing, "Failed to find XT operating system file (.bin)");
MCLOG("Boot using ROM " << romFile);