commit 574689015dffedb7e2deee62029ec41901e40390
parent 03c9123a6f05ddafb1a6fd0c98bc82b92208ac57
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Mon, 14 Mar 2022 23:43:03 +0100
implement preset name at the top
Diffstat:
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/source/jucePlugin/ui3/Parts.cpp b/source/jucePlugin/ui3/Parts.cpp
@@ -29,16 +29,15 @@ namespace genericVirusUI
}
updateAll();
-
- m_editor.getController().onProgramChange = [this]
- {
- updateAll();
- };
}
Parts::~Parts()
{
- m_editor.getController().onProgramChange = nullptr;
+ }
+
+ void Parts::onProgramChange()
+ {
+ updateAll();
}
void Parts::selectPart(const size_t _part)
diff --git a/source/jucePlugin/ui3/Parts.h b/source/jucePlugin/ui3/Parts.h
@@ -14,6 +14,8 @@ namespace genericVirusUI
explicit Parts(VirusEditor& _editor);
virtual ~Parts();
+ void onProgramChange();
+
private:
void selectPart(size_t _part);
void selectPrevPreset(size_t _part);
diff --git a/source/jucePlugin/ui3/VirusEditor.cpp b/source/jucePlugin/ui3/VirusEditor.cpp
@@ -1,6 +1,7 @@
#include "VirusEditor.h"
#include "BinaryData.h"
+#include "../VirusController.h"
namespace genericVirusUI
{
@@ -8,5 +9,15 @@ namespace genericVirusUI
m_parts(*this),
m_tabs(*this)
{
+ m_presetName = findComponentT<juce::Label>("PatchName");
+
+ getController().onProgramChange = [this] { onProgramChange(); };
+ }
+
+ void VirusEditor::onProgramChange()
+ {
+ m_parts.onProgramChange();
+
+ m_presetName->setText(getController().getCurrentPartPresetName(getController().getCurrentPart()), juce::dontSendNotification);
}
}
diff --git a/source/jucePlugin/ui3/VirusEditor.h b/source/jucePlugin/ui3/VirusEditor.h
@@ -13,7 +13,11 @@ namespace genericVirusUI
VirusEditor(VirusParameterBinding& _binding, Virus::Controller& _controller);
private:
+ void onProgramChange();
+
Parts m_parts;
Tabs m_tabs;
+
+ juce::Label* m_presetName = nullptr;
};
-}
-\ No newline at end of file
+}