Skip to content

Commit

Permalink
- fix #556
Browse files Browse the repository at this point in the history
- fix #460
  • Loading branch information
christoph-hart committed Jul 10, 2024
1 parent 195af46 commit 5398eec
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 7 deletions.
2 changes: 2 additions & 0 deletions hi_backend/backend/BackendEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 21 additions & 5 deletions hi_backend/backend/debug_components/PatchBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RoutableProcessor*>(p.get()))
rp->editRouting(this);
{
if(root->setTogglePopupFlag(*this, clicked))
{
rp->editRouting(this);
}
}

}
if(type == ProcessorType::Midi)
{
auto pl = dynamic_cast<MidiProcessor*>(p.get())->createEventLogComponent();
GET_BACKEND_ROOT_WINDOW(this)->getRootFloatingTile()->showComponentInRootPopup(pl, getParentComponent(), { 100, 35 }, false);
if(root->setTogglePopupFlag(*this, clicked))
{
auto pl = dynamic_cast<MidiProcessor*>(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);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions hi_backend/backend/debug_components/PatchBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class PatchBrowser : public SearchableListComponent,
ProcessorType type;

WeakReference<Processor> p;

bool clicked = false;
};

// ====================================================================================================================
Expand Down
7 changes: 7 additions & 0 deletions hi_core/hi_components/floating_layout/FloatingTile.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,13 @@ class FloatingTile : public Component

void editJSON();

Component::SafePointer<Component> togglePopupCallbackComponent;
bool* toggleFlag = nullptr;

void callToggleCallback();

bool setTogglePopupFlag(Component& c, bool& shouldClose);

FloatingTilePopup* showComponentInRootPopup(Component* newComponent, Component* attachedComponent, Point<int> localPoint, bool wrapInViewport=false, bool maximiseViewport=false);

FloatingTilePopup* showComponentAsDetachedPopup(Component* newComponent, Component* attachedComponent, Point<int> localPoint, bool wrapInViewport = false);
Expand Down
7 changes: 5 additions & 2 deletions hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.h
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,8 @@ class DspNetworkGraph : public ComponentWithMiddleMouseDrag,

bool copyDraggedNode = false;

bool showParameters = false;

valuetree::RecursivePropertyListener cableRepainter;
valuetree::ChildListener rebuildListener;
valuetree::RecursivePropertyListener resizeListener;
Expand Down

0 comments on commit 5398eec

Please sign in to comment.