From d3becfdcf860a0ef84f394b8af5760c0c38df42a Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Wed, 31 Jan 2024 11:08:52 -0800 Subject: [PATCH] Fix Merger crash with new StreamSelector Remove all references of StreamSelector from the Merger --- .../GenericProcessor/GenericProcessor.cpp | 11 ++-------- Source/Processors/Merger/Merger.cpp | 22 ------------------- Source/Processors/Merger/Merger.h | 7 ------ Source/Processors/Merger/MergerEditor.cpp | 11 ---------- Source/Processors/Merger/MergerEditor.h | 3 --- 5 files changed, 2 insertions(+), 52 deletions(-) diff --git a/Source/Processors/GenericProcessor/GenericProcessor.cpp b/Source/Processors/GenericProcessor/GenericProcessor.cpp index 1e652cf79c..3cec8d2a6e 100755 --- a/Source/Processors/GenericProcessor/GenericProcessor.cpp +++ b/Source/Processors/GenericProcessor/GenericProcessor.cpp @@ -925,16 +925,9 @@ void GenericProcessor::update() } } - } else if (sourceNode->isMerger()) + } + else { - Merger* merger = (Merger*) sourceNode; - - for (auto stream : merger->getStreamsForDestNode(this)) - { - continuousChannelGlobalIndex = copyDataStreamSettings(stream, continuousChannelGlobalIndex); - } - } - else { for (auto stream : sourceNode->getStreamsForDestNode(this)) { continuousChannelGlobalIndex = copyDataStreamSettings(stream, continuousChannelGlobalIndex); diff --git a/Source/Processors/Merger/Merger.cpp b/Source/Processors/Merger/Merger.cpp index 82085d643b..af0bdee062 100755 --- a/Source/Processors/Merger/Merger.cpp +++ b/Source/Processors/Merger/Merger.cpp @@ -206,28 +206,6 @@ int Merger::addSettingsFromSourceNode(GenericProcessor* sn, int continuousChanne return continuousChannelGlobalIndex; } -Array Merger::getStreamsForDestNode(GenericProcessor* node) -{ - Array outputStreams; - - for (auto stream : dataStreams) - { - if (checkStream(stream)) - outputStreams.add(stream); - } - - return outputStreams; -} - - -bool Merger::checkStream(const DataStream* stream) -{ - MergerEditor* ed = (MergerEditor*)getEditor(); - - return ed->checkStream(stream); -} - - void Merger::updateSettings() { diff --git a/Source/Processors/Merger/Merger.h b/Source/Processors/Merger/Merger.h index c30501dd34..e0c87ef684 100755 --- a/Source/Processors/Merger/Merger.h +++ b/Source/Processors/Merger/Merger.h @@ -64,9 +64,6 @@ class Merger : public GenericProcessor /** Called during updateSettings(), once for each input processor*/ int addSettingsFromSourceNode(GenericProcessor* sn, int globalIndex); - /** Checks whether or not a particular stream should be sent to the Merger output */ - bool checkStream(const DataStream* stream); - /** Set the currently displayed path (0 or 1) */ void switchIO(int) override; @@ -87,10 +84,6 @@ class Merger : public GenericProcessor /** Returns the source node for a particular path (0 or 1)*/ GenericProcessor* getSourceNode(int); - - /** Return the streams to be sent to the selected destination node*/ - Array getStreamsForDestNode(GenericProcessor* destNode) override; - /** Called while loading the signal chain */ void restoreConnections(); diff --git a/Source/Processors/Merger/MergerEditor.cpp b/Source/Processors/Merger/MergerEditor.cpp index 99dcf229c8..b03b1271a9 100755 --- a/Source/Processors/Merger/MergerEditor.cpp +++ b/Source/Processors/Merger/MergerEditor.cpp @@ -372,17 +372,6 @@ void MergerEditor::switchSource(int source, bool notify) } - - -bool MergerEditor::checkStream(const DataStream* stream) -{ - - // buttons already exist: - return streamSelector->checkStream(stream); - -} - - void MergerEditor::updateSettings() { /*for (auto button : streamButtons) diff --git a/Source/Processors/Merger/MergerEditor.h b/Source/Processors/Merger/MergerEditor.h index c64918add9..a0c09f1e49 100755 --- a/Source/Processors/Merger/MergerEditor.h +++ b/Source/Processors/Merger/MergerEditor.h @@ -81,9 +81,6 @@ class MergerEditor : public GenericEditor, /** Remove unused buttons */ void updateSettings() override; - - /** Checks whether a stream should be sent through the Merger*/ - bool checkStream(const DataStream* stream); private: