Skip to content

Commit

Permalink
Fix restoring RecordNodeEditor state on re-load
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Nov 3, 2023
1 parent 5f5dbb9 commit 84a7fa6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Source/Processors/RecordNode/RecordNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,11 @@ void RecordNode::clearRecordEngines()

void RecordNode::saveCustomParametersToXml(XmlElement* xml)
{

if (!headlessMode)
{
RecordNodeEditor* recordNodeEditor = (RecordNodeEditor*) getEditor();
xml->setAttribute("fifoMonitorsVisible", recordNodeEditor->fifoDrawerButton->getToggleState());
}
/*
xml->setAttribute ("path", dataDirectory.getFullPathName());
xml->setAttribute("engine", recordEngine->getEngineId());
Expand Down Expand Up @@ -1065,7 +1069,15 @@ void RecordNode::saveCustomParametersToXml(XmlElement* xml)

void RecordNode::loadCustomParametersFromXml(XmlElement* xml)
{

if (xml->hasAttribute("fifoMonitorsVisible"))
{
if (!headlessMode)
{
RecordNodeEditor* recordNodeEditor = (RecordNodeEditor*)getEditor();
if (!xml->getBoolAttribute("fifoMonitorsVisible"))
recordNodeEditor->fifoDrawerButton->triggerClick();
}
}
/*
String savedPath = xml->getStringAttribute("path");
Expand Down
2 changes: 2 additions & 0 deletions Source/Processors/RecordNode/RecordNodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,13 @@ void RecordNodeEditor::updateFifoMonitors()
Parameter* channels = recordNode->getDataStream(streamId)->getParameter("channels");
recordNode->getDataStream(streamId)->setColor("channels", getLookAndFeel().findColour(ProcessorColor::IDs::RECORD_COLOR));
addCustomParameterEditor(new RecordChannelsParameterEditor(recordNode, channels), 18 + streamCount * 20, 32);
parameterEditors.getLast()->setVisible(!getCollapsedState());
streamMonitors.push_back(parameterEditors.getLast());

Parameter* sync = recordNode->getDataStream(streamId)->getParameter("sync_line");
recordNode->getDataStream(streamId)->setColor("sync_line", getLookAndFeel().findColour(ProcessorColor::IDs::SYNC_COLOR));
addCustomParameterEditor(new SyncChannelsParameterEditor(recordNode, sync), 18 + streamCount * 20, 110);
parameterEditors.getLast()->setVisible(!getCollapsedState());
syncMonitors.push_back(parameterEditors.getLast());

streamCount++;
Expand Down

0 comments on commit 84a7fa6

Please sign in to comment.