Skip to content

Commit 0589875

Browse files
committed
Fix sync monitor re-load
1 parent ae22a03 commit 0589875

1 file changed

Lines changed: 40 additions & 43 deletions

File tree

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -991,55 +991,52 @@ void RecordNode::loadCustomParametersFromXml(XmlElement* xml)
991991

992992
for (auto stream : dataStreams)
993993
{
994-
int matchingIndex = findMatchingStreamParameters(stream);
995-
const uint16 streamId = stream->getStreamId();
996994

997-
if (matchingIndex > -1)
995+
if (findMatchingStreamParameters(stream) > -1)
998996
{
999-
int savedStreamIndex = -1;
997+
998+
const uint16 streamId = stream->getStreamId();
1000999

10011000
for (auto* subNode : xml->getChildIterator())
10021001
{
1003-
if (subNode->hasTagName("STREAM"))
1002+
if (subNode->hasTagName("STREAM")
1003+
&& subNode->getStringAttribute("name") == stream->getName()
1004+
&& subNode->getIntAttribute("source_node_id") == stream->getSourceNodeId())
10041005
{
1005-
savedStreamIndex++;
1006-
1007-
if (savedStreamIndex == matchingIndex)
1008-
{
1009-
if (subNode->getBoolAttribute("isMainStream", false))
1010-
{
1011-
setMainDataStream(streamId);
1012-
}
1013-
1014-
setSyncLine(streamId, subNode->getIntAttribute("sync_line", 0));
1015-
1016-
String recordState = subNode->getStringAttribute("recording_state", "ALL");
1017-
1018-
for (int ch = 0; ch < recordContinuousChannels[streamId].size(); ch++)
1019-
{
1020-
bool channelState;
1021-
1022-
if (recordState.equalsIgnoreCase("ALL"))
1023-
{
1024-
channelState = true;
1025-
}
1026-
else if (recordState.equalsIgnoreCase("NONE"))
1027-
{
1028-
channelState = false;
1029-
}
1030-
else {
1031-
if (recordState.length() > ch)
1032-
{
1033-
channelState = recordState.substring(ch, ch + 1) == "1" ? true : false;
1034-
}
1035-
else {
1036-
channelState = true;
1037-
}
1038-
}
1039-
1040-
recordContinuousChannels[streamId][ch] = channelState;
1041-
}
1042-
}
1006+
1007+
if (subNode->getBoolAttribute("isMainStream", false))
1008+
{
1009+
setMainDataStream(streamId);
1010+
}
1011+
1012+
setSyncLine(streamId, subNode->getIntAttribute("sync_line", 0));
1013+
1014+
String recordState = subNode->getStringAttribute("recording_state", "ALL");
1015+
1016+
for (int ch = 0; ch < recordContinuousChannels[streamId].size(); ch++)
1017+
{
1018+
bool channelState;
1019+
1020+
if (recordState.equalsIgnoreCase("ALL"))
1021+
{
1022+
channelState = true;
1023+
}
1024+
else if (recordState.equalsIgnoreCase("NONE"))
1025+
{
1026+
channelState = false;
1027+
}
1028+
else {
1029+
if (recordState.length() > ch)
1030+
{
1031+
channelState = recordState.substring(ch, ch + 1) == "1" ? true : false;
1032+
}
1033+
else {
1034+
channelState = true;
1035+
}
1036+
}
1037+
1038+
recordContinuousChannels[streamId][ch] = channelState;
1039+
}
10431040

10441041
}
10451042
}

0 commit comments

Comments
 (0)