gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit fb890f5db0a37f0ab412a7349e8f710eea59aba6
parent f06f9e576866904178d10003b5252f9dc9a499ce
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Wed, 13 Nov 2024 22:12:46 +0100

handle properly if no skin is found, do not abuse a window size as an indicator for it, fixes #230

Diffstat:
Msource/jucePluginEditorLib/pluginEditorState.cpp | 8+++-----
Msource/jucePluginEditorLib/pluginEditorState.h | 4++++
Msource/jucePluginEditorLib/pluginProcessor.cpp | 2+-
Msource/jucePluginEditorLib/skin.h | 5+++++
4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/source/jucePluginEditorLib/pluginEditorState.cpp b/source/jucePluginEditorLib/pluginEditorState.cpp @@ -10,8 +10,6 @@ #include "dsp56kEmu/logging.h" -#include "jucePluginLib/tools.h" - namespace jucePluginEditorLib { PluginEditorState::PluginEditorState(Processor& _processor, pluginLib::Controller& _controller, std::vector<Skin> _includedSkins) @@ -94,9 +92,6 @@ std::string PluginEditorState::getSkinFolder() const bool PluginEditorState::loadSkin(const Skin& _skin, const uint32_t _fallbackIndex/* = 0*/) { - m_currentSkin = _skin; - writeSkinToConfig(_skin); - if (m_editor) { m_instanceConfig.clear(); @@ -135,6 +130,9 @@ bool PluginEditorState::loadSkin(const Skin& _skin, const uint32_t _fallbackInde m_editor->setTopLeftPosition(0, 0); + m_currentSkin = _skin; + writeSkinToConfig(_skin); + if(evSkinLoaded) evSkinLoaded(m_editor.get()); diff --git a/source/jucePluginEditorLib/pluginEditorState.h b/source/jucePluginEditorLib/pluginEditorState.h @@ -63,6 +63,10 @@ namespace jucePluginEditorLib std::string getSkinFolder() const; + bool hasSkin() const + { + return m_currentSkin.isValid(); + } protected: virtual Editor* createEditor(const Skin& _skin) = 0; diff --git a/source/jucePluginEditorLib/pluginProcessor.cpp b/source/jucePluginEditorLib/pluginProcessor.cpp @@ -68,7 +68,7 @@ namespace jucePluginEditorLib auto* window = new EditorWindow(*this, *m_editorState, getConfig()); - if(window->getWidth() == 0 || window->getHeight() == 0) + if(!m_editorState->hasSkin()) { constexpr int w = 600; constexpr int h = 300; diff --git a/source/jucePluginEditorLib/skin.h b/source/jucePluginEditorLib/skin.h @@ -14,5 +14,10 @@ namespace jucePluginEditorLib { return displayName == _other.displayName && jsonFilename == _other.jsonFilename && folder == _other.folder; } + + bool isValid() const + { + return !jsonFilename.empty(); + } }; }