commit 3c8bf251e4ad12408e64da03237aa5d317cacab4
parent 73ccc6032bed40f629ecbbfe1bd6d19b3a444144
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 16 Mar 2022 22:45:34 +0100
make sure that the same file loading function is also used for the json
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/source/jucePlugin/ui3/VirusEditor.cpp b/source/jucePlugin/ui3/VirusEditor.cpp
@@ -14,7 +14,9 @@ namespace genericVirusUI
m_processor(_processorRef),
m_parameterBinding(_binding)
{
- create(std::string(BinaryData::VirusC_json, BinaryData::VirusC_jsonSize));
+ uint32_t jsonSize;
+ const auto json = getResourceByFilename("VirusC.json", jsonSize);
+ create(std::string(json, jsonSize));
m_parts.reset(new Parts(*this));
m_tabs.reset(new Tabs(*this));
@@ -93,8 +95,7 @@ namespace genericVirusUI
return res;
}
- _dataSize = 0;
- return nullptr;
+ throw std::runtime_error("Failed to find file named " + _name);
}
int VirusEditor::getParameterIndexByName(const std::string& _name)