commit 9918feaf008b2c845d86d3433b2a71fde6003a0c
parent 5942e6c1d87d08c26eac77040c57b33266215e70
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Fri, 31 May 2024 14:53:08 +0200
fix arp pattern always displayed for part 0
Diffstat:
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/source/virusJucePlugin/ArpUserPattern.cpp b/source/virusJucePlugin/ArpUserPattern.cpp
@@ -65,6 +65,8 @@ namespace genericVirusUI
void ArpUserPattern::onCurrentPartChanged()
{
+ unbindParameters();
+ bindParameters();
}
void ArpUserPattern::bindParameters()
diff --git a/source/virusJucePlugin/VirusEditor.cpp b/source/virusJucePlugin/VirusEditor.cpp
@@ -216,7 +216,11 @@ namespace genericVirusUI
juce::Component* VirusEditor::createJuceComponent(juce::Component* _component, genericUI::UiObject& _object)
{
if(_object.getName() == "ArpUserGraphics")
- return new ArpUserPattern(*this);
+ {
+ assert(m_arpUserPattern == nullptr);
+ m_arpUserPattern = new ArpUserPattern(*this);
+ return m_arpUserPattern;
+ }
return Editor::createJuceComponent(_component, _object);
}
@@ -240,6 +244,8 @@ namespace genericVirusUI
void VirusEditor::onCurrentPartChanged()
{
m_parts->onCurrentPartChanged();
+ if(m_arpUserPattern)
+ m_arpUserPattern->onCurrentPartChanged();
updatePresetName();
}
diff --git a/source/virusJucePlugin/VirusEditor.h b/source/virusJucePlugin/VirusEditor.h
@@ -33,6 +33,8 @@ class VirusProcessor;
namespace genericVirusUI
{
+ class ArpUserPattern;
+
class VirusEditor : public jucePluginEditorLib::Editor
{
public:
@@ -105,6 +107,8 @@ namespace genericVirusUI
juce::Label* m_deviceModel = nullptr;
+ ArpUserPattern* m_arpUserPattern = nullptr;
+
pluginLib::EventListener<const virusLib::ROMFile*> m_romChangedListener;
};
}