From 5398eece3f554a548cb1245fcc83cc4070dac1d2 Mon Sep 17 00:00:00 2001 From: Christoph Hart Date: Wed, 10 Jul 2024 15:03:07 +0200 Subject: [PATCH] - fix #556 - fix #460 --- hi_backend/backend/BackendEditor.h | 2 ++ .../backend/debug_components/PatchBrowser.cpp | 26 +++++++++++++++---- .../backend/debug_components/PatchBrowser.h | 2 ++ .../floating_layout/FloatingTile.h | 7 +++++ .../scriptnode/ui/DspNetworkComponents.cpp | 7 +++-- .../scriptnode/ui/DspNetworkComponents.h | 2 ++ 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/hi_backend/backend/BackendEditor.h b/hi_backend/backend/BackendEditor.h index 893f391837..d6c0c6f69f 100644 --- a/hi_backend/backend/BackendEditor.h +++ b/hi_backend/backend/BackendEditor.h @@ -392,8 +392,10 @@ class MainTopBar : public FloatingTileContent, ProcessorPeakMeter(p), ControlledObject(p->getMainController()) { + vuMeter->setTooltip("Click to show the Audio Analyser"); setRepaintsOnMouseActivity(true); vuMeter->addMouseListener(this, true); + } void mouseEnter(const MouseEvent& event) override diff --git a/hi_backend/backend/debug_components/PatchBrowser.cpp b/hi_backend/backend/debug_components/PatchBrowser.cpp index c7da511886..e510538dfb 100644 --- a/hi_backend/backend/debug_components/PatchBrowser.cpp +++ b/hi_backend/backend/debug_components/PatchBrowser.cpp @@ -2155,20 +2155,36 @@ PatchBrowser::MiniPeak::~MiniPeak() void PatchBrowser::MiniPeak::mouseDown(const MouseEvent& e) { + auto root = GET_BACKEND_ROOT_WINDOW(this)->getRootFloatingTile(); + + + if (type == ProcessorType::Audio) { if(auto rp = dynamic_cast(p.get())) - rp->editRouting(this); + { + if(root->setTogglePopupFlag(*this, clicked)) + { + rp->editRouting(this); + } + } + } if(type == ProcessorType::Midi) { - auto pl = dynamic_cast(p.get())->createEventLogComponent(); - GET_BACKEND_ROOT_WINDOW(this)->getRootFloatingTile()->showComponentInRootPopup(pl, getParentComponent(), { 100, 35 }, false); + if(root->setTogglePopupFlag(*this, clicked)) + { + auto pl = dynamic_cast(p.get())->createEventLogComponent(); + root->showComponentInRootPopup(pl, getParentComponent(), { 100, 35 }, false); + } } if (type == ProcessorType::Mod) { - auto pl = new PlotterPopup(p); - GET_BACKEND_ROOT_WINDOW(this)->getRootFloatingTile()->showComponentInRootPopup(pl, getParentComponent(), { 100, 35 }, false); + if(root->setTogglePopupFlag(*this, clicked)) + { + auto pl = new PlotterPopup(p); + root->showComponentInRootPopup(pl, getParentComponent(), { 100, 35 }, false); + } } } diff --git a/hi_backend/backend/debug_components/PatchBrowser.h b/hi_backend/backend/debug_components/PatchBrowser.h index 0d30ecec26..fefb1195df 100644 --- a/hi_backend/backend/debug_components/PatchBrowser.h +++ b/hi_backend/backend/debug_components/PatchBrowser.h @@ -88,6 +88,8 @@ class PatchBrowser : public SearchableListComponent, ProcessorType type; WeakReference p; + + bool clicked = false; }; // ==================================================================================================================== diff --git a/hi_core/hi_components/floating_layout/FloatingTile.h b/hi_core/hi_components/floating_layout/FloatingTile.h index c7fbf9e159..0ecf4f4e08 100644 --- a/hi_core/hi_components/floating_layout/FloatingTile.h +++ b/hi_core/hi_components/floating_layout/FloatingTile.h @@ -445,6 +445,13 @@ class FloatingTile : public Component void editJSON(); + Component::SafePointer togglePopupCallbackComponent; + bool* toggleFlag = nullptr; + + void callToggleCallback(); + + bool setTogglePopupFlag(Component& c, bool& shouldClose); + FloatingTilePopup* showComponentInRootPopup(Component* newComponent, Component* attachedComponent, Point localPoint, bool wrapInViewport=false, bool maximiseViewport=false); FloatingTilePopup* showComponentAsDetachedPopup(Component* newComponent, Component* attachedComponent, Point localPoint, bool wrapInViewport = false); diff --git a/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp b/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp index ba96a0fdda..ab2b55e767 100644 --- a/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp +++ b/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp @@ -2305,8 +2305,11 @@ bool DspNetworkGraph::Actions::showParameterPopup(DspNetworkGraph& g) if (b == nullptr) b = &g; - ft->showComponentInRootPopup(s, b, {12, 24}); - + if(ft->setTogglePopupFlag(g, g.showParameters)) + { + ft->showComponentInRootPopup(s, b, {12, 24}); + } + return true; } diff --git a/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.h b/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.h index aa67bf473d..c8a1afc025 100644 --- a/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.h +++ b/hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.h @@ -1012,6 +1012,8 @@ class DspNetworkGraph : public ComponentWithMiddleMouseDrag, bool copyDraggedNode = false; + bool showParameters = false; + valuetree::RecursivePropertyListener cableRepainter; valuetree::ChildListener rebuildListener; valuetree::RecursivePropertyListener resizeListener;