Skip to content

Commit

Permalink
Add unique String key to DataStream
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Oct 5, 2023
1 parent 8079085 commit 8320509
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Source/Processors/GenericProcessor/GenericProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,7 @@ void GenericProcessor::update()
{
Array<String> streamNames;
for (auto stream : dataStreams)
{
streamNames.add(stream->getName());
}
streamNames.add(stream->getKey());
SelectedStreamParameter* p = (SelectedStreamParameter*)param;
p->setStreamNames(streamNames);
parameterValueChanged(p);
Expand Down
4 changes: 2 additions & 2 deletions Source/Processors/RecordNode/RecordNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ void RecordNode::parameterValueChanged(Parameter* p)
Array<String> streamNames = ((SelectedStreamParameter*)p)->getStreamNames();
for (auto stream : dataStreams)
{
String key = String(stream->getSourceNodeId()) + " | " + stream->getName();
if (key == streamNames[((CategoricalParameter*)p)->getSelectedIndex()])
String key = stream->getKey();
if (key == streamNames[((SelectedStreamParameter*)p)->getSelectedIndex()])
{
synchronizer.setMainDataStream(stream->getStreamId());
break;
Expand Down
3 changes: 3 additions & 0 deletions Source/Processors/Settings/DataStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class PLUGIN_API DataStream :
/** Returns the unique ID for this stream*/
uint16 getStreamId() const;

/** Returns a unique String for this stream */
String getKey() const { return String(getSourceNodeId()) + "|" + getName(); }

/** Returns true if this DataStream has a device associated with it.*/
bool hasDevice() const;

Expand Down

0 comments on commit 8320509

Please sign in to comment.