Skip to content

Commit

Permalink
Fix Merger crash with new StreamSelector
Browse files Browse the repository at this point in the history
Remove all references of StreamSelector from the Merger
  • Loading branch information
anjaldoshi committed Jan 31, 2024
1 parent 24b979b commit d3becfd
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 52 deletions.
11 changes: 2 additions & 9 deletions Source/Processors/GenericProcessor/GenericProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 0 additions & 22 deletions Source/Processors/Merger/Merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,28 +206,6 @@ int Merger::addSettingsFromSourceNode(GenericProcessor* sn, int continuousChanne
return continuousChannelGlobalIndex;
}

Array<const DataStream*> Merger::getStreamsForDestNode(GenericProcessor* node)
{
Array<const DataStream*> 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()
{

Expand Down
7 changes: 0 additions & 7 deletions Source/Processors/Merger/Merger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<const DataStream*> getStreamsForDestNode(GenericProcessor* destNode) override;


/** Called while loading the signal chain */
void restoreConnections();
Expand Down
11 changes: 0 additions & 11 deletions Source/Processors/Merger/MergerEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions Source/Processors/Merger/MergerEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d3becfd

Please sign in to comment.