commit f08f3466e6adad700d401c2028324bdb8089e65a
parent c484af613b66459981557ee2c4abf907fb34b55c
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sat, 2 Nov 2024 16:15:05 +0100
FX plugins use data folder from non-FX version
Diffstat:
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/source/jucePluginEditorLib/pluginEditor.cpp b/source/jucePluginEditorLib/pluginEditor.cpp
@@ -570,7 +570,7 @@ namespace jucePluginEditorLib
return res;
const auto modulePath = synthLib::getModulePath();
- const auto publicDataPath = pluginLib::Tools::getPublicDataFolder(m_processor.getProperties().vendor, m_processor.getProperties().name);
+ const auto publicDataPath = m_processor.getDataFolder();
const auto folder = synthLib::validatePath(m_skin.folder.find(modulePath) == 0 || m_skin.folder.find(publicDataPath) == 0 ? m_skin.folder : modulePath + m_skin.folder);
// try to load from disk first
diff --git a/source/jucePluginEditorLib/pluginEditorState.cpp b/source/jucePluginEditorLib/pluginEditorState.cpp
@@ -89,7 +89,7 @@ void PluginEditorState::getPerInstanceConfig(std::vector<uint8_t>& _data)
std::string PluginEditorState::getSkinFolder() const
{
- return synthLib::validatePath(pluginLib::Tools::getPublicDataFolder(m_processor.getProperties().vendor, m_processor.getProperties().name) + "skins/");
+ return synthLib::validatePath(m_processor.getDataFolder() + "skins/");
}
bool PluginEditorState::loadSkin(const Skin& _skin, const uint32_t _fallbackIndex/* = 0*/)
diff --git a/source/jucePluginLib/processor.cpp b/source/jucePluginLib/processor.cpp
@@ -340,7 +340,16 @@ namespace pluginLib
std::string Processor::getPublicRomFolder() const
{
- return Tools::getPublicDataFolder(getProperties().vendor, getProperties().name) + "roms/";
+ return getDataFolder() + "roms/";
+ }
+
+ std::string Processor::getDataFolder(const bool _useFxFolder) const
+ {
+ const auto& p = getProperties();
+ auto name = p.name;
+ if(!_useFxFolder && p.isSynth && name.substr(name.size()-2, 2) == "FX")
+ name = name.substr(name.size() - 2);
+ return Tools::getPublicDataFolder(p.vendor, name);
}
void Processor::destroyController()
diff --git a/source/jucePluginLib/processor.h b/source/jucePluginLib/processor.h
@@ -123,6 +123,7 @@ namespace pluginLib
std::optional<std::pair<const char*, uint32_t>> findResource(const std::string& _filename) const;
std::string getPublicRomFolder() const;
+ std::string getDataFolder(bool _useFxFolder = false) const;
protected:
void destroyController();