From c08142b60dfc4ea71c335649649cda259c492d3b Mon Sep 17 00:00:00 2001 From: Christoph Hart Date: Mon, 30 Sep 2024 13:28:46 +0200 Subject: [PATCH] - fix #573 (allow the AudioAnalyser floating tile to connect to scriptnode display buffers) --- currentGitHash.txt | 2 +- hi_backend/backend/currentGit.h | 2 +- hi_core/hi_modules/effects/fx/Analyser.cpp | 41 ++++++++++++++++++---- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/currentGitHash.txt b/currentGitHash.txt index 15930a5b1..1065ca513 100644 --- a/currentGitHash.txt +++ b/currentGitHash.txt @@ -1 +1 @@ -6c1c41e7f06b4a4ddcbb87ce5cf1647525e309f1 +56f5d952eaa1a4f4977e0330fbfdc3dfc2806b6f diff --git a/hi_backend/backend/currentGit.h b/hi_backend/backend/currentGit.h index 5b14f2200..c62a2c1a9 100644 --- a/hi_backend/backend/currentGit.h +++ b/hi_backend/backend/currentGit.h @@ -1 +1 @@ -#define PREVIOUS_HISE_COMMIT "6c1c41e7f06b4a4ddcbb87ce5cf1647525e309f1" +#define PREVIOUS_HISE_COMMIT "56f5d952eaa1a4f4977e0330fbfdc3dfc2806b6f" diff --git a/hi_core/hi_modules/effects/fx/Analyser.cpp b/hi_core/hi_modules/effects/fx/Analyser.cpp index e28b03cdf..ac164c994 100644 --- a/hi_core/hi_modules/effects/fx/Analyser.cpp +++ b/hi_core/hi_modules/effects/fx/Analyser.cpp @@ -97,14 +97,43 @@ Component* AudioAnalyserComponent::Panel::createContentComponent(int index) { Component* c = nullptr; - switch (index) + if(dynamic_cast(getProcessor()) == nullptr) { - case 0: c = new Goniometer(getProcessor()); break; - case 1: c = new Oscilloscope(getProcessor()); break; - case 2: c = new FFTDisplay(getProcessor()); break; - default: - return nullptr; + if(auto ed = dynamic_cast(getProcessor())) + { + if(isPositiveAndBelow(index, ed->getNumDataObjects(ExternalData::DataType::DisplayBuffer))) + { + auto rb = ed->getDisplayBuffer(index); + jassert(rb != nullptr); + + auto obj = rb->getPropertyObject(); + auto editor = obj->createComponent(); + + editor->setComplexDataUIBase(rb); + + + + c = dynamic_cast(editor); + + c->setColour(0, findPanelColour(PanelColourId::bgColour)); + c->setColour(1, findPanelColour(PanelColourId::itemColour1)); + c->setColour(2, findPanelColour(PanelColourId::itemColour2)); + } + } } + else + { + switch (index) + { + case 0: c = new Goniometer(getProcessor()); break; + case 1: c = new Oscilloscope(getProcessor()); break; + case 2: c = new FFTDisplay(getProcessor()); break; + default: + return nullptr; + } + } + + if (findPanelColour(FloatingTileContent::PanelColourId::bgColour).isOpaque()) c->setOpaque(true);