From ee0f991830ae61dbb06aec91ebeea6b64c404ed7 Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Fri, 6 Oct 2023 15:30:38 -0700 Subject: [PATCH] Various headless mode fixes --- Source/Processors/FileReader/FileReader.cpp | 6 +++++- Source/Processors/Merger/Merger.cpp | 8 ++++++-- Source/Processors/ProcessorGraph/ProcessorGraph.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Source/Processors/FileReader/FileReader.cpp b/Source/Processors/FileReader/FileReader.cpp index 73f9e95c1..600e853fc 100644 --- a/Source/Processors/FileReader/FileReader.cpp +++ b/Source/Processors/FileReader/FileReader.cpp @@ -789,7 +789,11 @@ ScrubberInterface* FileReader::getScrubberInterface() void FileReader::saveCustomParametersToXml (XmlElement* xml) { XmlElement* childNode = xml->createNewChildElement ("SCRUBBERINTERFACE"); - childNode->setAttribute ("show", getScrubberInterface()->isVisible() ? "true" : "false"); + + if(headlessMode) + childNode->setAttribute ("show", "false"); + else + childNode->setAttribute ("show", getScrubberInterface()->isVisible() ? "true" : "false"); } void FileReader::loadCustomParametersFromXml (XmlElement* xml) diff --git a/Source/Processors/Merger/Merger.cpp b/Source/Processors/Merger/Merger.cpp index 4c89a9e2d..bd56bb792 100755 --- a/Source/Processors/Merger/Merger.cpp +++ b/Source/Processors/Merger/Merger.cpp @@ -57,8 +57,12 @@ void Merger::setMergerSourceNode(GenericProcessor* sn) { sourceNodeA = sn; activePath = 0; - MergerEditor* ed = (MergerEditor*)getEditor(); - ed->switchSource(activePath, false); + + if(!headlessMode) + { + MergerEditor* ed = (MergerEditor*)getEditor(); + ed->switchSource(activePath, false); + } } else { diff --git a/Source/Processors/ProcessorGraph/ProcessorGraph.cpp b/Source/Processors/ProcessorGraph/ProcessorGraph.cpp index 6e136ece9..51928596f 100644 --- a/Source/Processors/ProcessorGraph/ProcessorGraph.cpp +++ b/Source/Processors/ProcessorGraph/ProcessorGraph.cpp @@ -567,7 +567,7 @@ void ProcessorGraph::updateViews(GenericProcessor* processor, bool updateGraphVi { LOGD("Processor to view: ", processor->getName()); - if (processor->isSplitter()) + if (processor->isSplitter() && !isConsoleApp) { SplitterEditor* spEditor = (SplitterEditor*)processor->getEditor(); Splitter* spProc = (Splitter*)processor; @@ -1406,10 +1406,10 @@ void ProcessorGraph::removeProcessor(GenericProcessor* processor) checkForNewRootNodes(processor, false, false); - AccessClass::getGraphViewer()->removeNode(processor); - - if (AccessClass::getEditorViewport() != nullptr) //headless mode + if (!isConsoleApp) { + AccessClass::getGraphViewer()->removeNode(processor); + AccessClass::getEditorViewport()->removeEditor(processor->editor.get()); //// need this to prevent editors from remaining after starting acquisition