From 4d666c6ce5b9f6a5e4e0f69998fa427ce795ead0 Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Thu, 19 Dec 2024 16:51:32 -0800 Subject: [PATCH 1/3] Fix undo/redo handling in PopupComponent to respect acquisition status and signal chain lock --- Source/UI/PopupComponent.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/UI/PopupComponent.cpp b/Source/UI/PopupComponent.cpp index 6cf5095ba..68c482285 100644 --- a/Source/UI/PopupComponent.cpp +++ b/Source/UI/PopupComponent.cpp @@ -22,6 +22,7 @@ */ #include "PopupComponent.h" +#include "EditorViewport.h" #include "UIComponent.h" #include "../CoreServices.h" @@ -89,6 +90,13 @@ bool PopupComponent::keyPressed (const KeyPress& key) return false; } + if (CoreServices::getAcquisitionStatus() + && undoManager->getUndoDescription().contains ("Disabled during acquisition")) + return false; + + if (AccessClass::getEditorViewport()->isSignalChainLocked()) + return false; + undoManager->undo(); if (parent != nullptr) @@ -109,6 +117,13 @@ bool PopupComponent::keyPressed (const KeyPress& key) return false; } + if (CoreServices::getAcquisitionStatus() + && undoManager->getRedoDescription().contains ("Disabled during acquisition")) + return false; + + if (AccessClass::getEditorViewport()->isSignalChainLocked()) + return false; + undoManager->redo(); if (parent != nullptr) From b10b79368ada93fe1fb9ada5ba4cdf2b7eb378e7 Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Mon, 23 Dec 2024 19:24:23 -0800 Subject: [PATCH 2/3] Ensure tabbed components are resized properly when one is closed --- Source/UI/DataViewport.cpp | 43 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/Source/UI/DataViewport.cpp b/Source/UI/DataViewport.cpp index 00071b4c6..86712daeb 100755 --- a/Source/UI/DataViewport.cpp +++ b/Source/UI/DataViewport.cpp @@ -610,23 +610,8 @@ void DataViewport::removeTab (int nodeId, bool sendNotification) if (foundTab) { - if (draggableTabComponent->getNumTabs() == 0 && draggableTabComponents.size() > 1) - { - draggableTabComponents.removeObject (draggableTabComponent); - activeTabbedComponent--; - - tabbedComponentLayout.clearAllItems(); - - tabbedComponentResizer->setVisible (draggableTabComponents.size() == 2); - - resized(); - - if (draggableTabComponents[activeTabbedComponent]->getNumTabs() > 1) - addTabbedComponentButton->setVisible (true); - else - addTabbedComponentButton->setVisible (false); - } - + // remove the tabbed component if it's empty + removeTabbedComponent (draggableTabComponent); return; } } @@ -641,11 +626,14 @@ void DataViewport::buttonClicked (Button* button) addAndMakeVisible (d); draggableTabComponents.add (d); - tabbedComponentResizer->setVisible (true); + if (draggableTabComponents.size() == 2) + { + tabbedComponentResizer->setVisible (true); - tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5); - tabbedComponentLayout.setItemLayout (1, 12, 12, 12); - tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5); + tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5); + tabbedComponentLayout.setItemLayout (1, 12, 12, 12); + tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5); + } resized(); @@ -684,7 +672,18 @@ void DataViewport::removeTabbedComponent (DraggableTabComponent* draggableTabCom tabbedComponentLayout.clearAllItems(); - tabbedComponentResizer->setVisible (draggableTabComponents.size() == 2); + if (draggableTabComponents.size() == 2) + { + tabbedComponentResizer->setVisible (true); + + tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5); + tabbedComponentLayout.setItemLayout (1, 12, 12, 12); + tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5); + } + else + { + tabbedComponentResizer->setVisible (false); + } resized(); } From f066eeac977a65302a53ac65b72348ced6f8c5e1 Mon Sep 17 00:00:00 2001 From: Pavel Kulik Date: Tue, 24 Dec 2024 12:59:23 -0800 Subject: [PATCH 3/3] Add isRequired flag to PathParameter --- Source/Processors/DataThreads/DataThread.cpp | 3 ++- Source/Processors/DataThreads/DataThread.h | 1 + Source/Processors/FileReader/FileReader.cpp | 2 +- Source/Processors/GenericProcessor/GenericProcessor.cpp | 2 ++ Source/Processors/GenericProcessor/GenericProcessor.h | 1 + Source/Processors/Parameter/Parameter.cpp | 8 +++++++- Source/Processors/Parameter/Parameter.h | 2 ++ Source/Processors/RecordNode/RecordNode.cpp | 2 +- 8 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Source/Processors/DataThreads/DataThread.cpp b/Source/Processors/DataThreads/DataThread.cpp index 26ff6528e..770d7eb79 100644 --- a/Source/Processors/DataThreads/DataThread.cpp +++ b/Source/Processors/DataThreads/DataThread.cpp @@ -120,9 +120,10 @@ void DataThread::addPathParameter (Parameter::ParameterScope scope, const String& defaultValue, const StringArray& validFileExtensions, bool isDirectory, + bool isRequired, bool deactivateDuringAcquisition) { - sn->addPathParameter (scope, name, displayName, description, defaultValue, validFileExtensions, isDirectory, deactivateDuringAcquisition); + sn->addPathParameter (scope, name, displayName, description, defaultValue, validFileExtensions, isDirectory, isRequired, deactivateDuringAcquisition); } void DataThread::addSelectedStreamParameter (Parameter::ParameterScope scope, diff --git a/Source/Processors/DataThreads/DataThread.h b/Source/Processors/DataThreads/DataThread.h index 2b823faad..8813d109b 100755 --- a/Source/Processors/DataThreads/DataThread.h +++ b/Source/Processors/DataThreads/DataThread.h @@ -193,6 +193,7 @@ class PLUGIN_API DataThread : public Thread const String& defaultValue, const StringArray& validFileExtensions, bool isDirectory, + bool isRequired, bool deactivateDuringAcquisition = true); /** Adds a selected stream parameter which holds the currentlu selected stream */ diff --git a/Source/Processors/FileReader/FileReader.cpp b/Source/Processors/FileReader/FileReader.cpp index e28baea1c..cb8c4bb26 100644 --- a/Source/Processors/FileReader/FileReader.cpp +++ b/Source/Processors/FileReader/FileReader.cpp @@ -109,7 +109,7 @@ FileReader::~FileReader() void FileReader::registerParameters() { /* Add parameters */ - addPathParameter (Parameter::PROCESSOR_SCOPE, "selected_file", "Selected File", "File to load data from", defaultFile, getSupportedExtensions(), false); + addPathParameter (Parameter::PROCESSOR_SCOPE, "selected_file", "Selected File", "File to load data from", defaultFile, getSupportedExtensions(), false, true); addSelectedStreamParameter (Parameter::PROCESSOR_SCOPE, "active_stream", "Active Stream", "Currently active stream", {}, 0); addTimeParameter (Parameter::PROCESSOR_SCOPE, "start_time", "Start Time", "Time to start playback"); addTimeParameter (Parameter::PROCESSOR_SCOPE, "end_time", "Stop Time", "Time to end playback"); diff --git a/Source/Processors/GenericProcessor/GenericProcessor.cpp b/Source/Processors/GenericProcessor/GenericProcessor.cpp index 531fdcb7e..54fbeebdc 100755 --- a/Source/Processors/GenericProcessor/GenericProcessor.cpp +++ b/Source/Processors/GenericProcessor/GenericProcessor.cpp @@ -422,6 +422,7 @@ void GenericProcessor::addPathParameter ( const File& defaultValue, const StringArray& validFileExtensions, bool isDirectory, + bool isRequired, bool deactivateDuringAcquisition) { PathParameter* p = @@ -433,6 +434,7 @@ void GenericProcessor::addPathParameter ( defaultValue, validFileExtensions, isDirectory, + isRequired, deactivateDuringAcquisition); if (scope == Parameter::PROCESSOR_SCOPE) diff --git a/Source/Processors/GenericProcessor/GenericProcessor.h b/Source/Processors/GenericProcessor/GenericProcessor.h index 72024af7f..41ae2ae48 100755 --- a/Source/Processors/GenericProcessor/GenericProcessor.h +++ b/Source/Processors/GenericProcessor/GenericProcessor.h @@ -377,6 +377,7 @@ class PLUGIN_API GenericProcessor : public GenericProcessorBase, public PluginCl const File& defaultValue, const StringArray& validFileExtensions, bool isDirectory, + bool isRequired, bool deactivateDuringAcquisition = true); /** Adds a selected stream parameter which holds the currentlu selected stream */ diff --git a/Source/Processors/Parameter/Parameter.cpp b/Source/Processors/Parameter/Parameter.cpp index 1b976e8fa..6b3e3fc37 100755 --- a/Source/Processors/Parameter/Parameter.cpp +++ b/Source/Processors/Parameter/Parameter.cpp @@ -1184,6 +1184,7 @@ PathParameter::PathParameter (ParameterOwner* owner, const File& defaultValue_, const StringArray& fileExtensions_, bool isDirectory_, + bool isRequired_, bool deactivateDuringAcquisition) : Parameter (owner, ParameterType::PATH_PARAM, @@ -1194,7 +1195,8 @@ PathParameter::PathParameter (ParameterOwner* owner, defaultValue_.getFullPathName(), deactivateDuringAcquisition), filePatternsAllowed (fileExtensions_), - isDirectory (isDirectory_) + isDirectory (isDirectory_), + isRequired (isRequired_) { currentValue = defaultValue; } @@ -1257,6 +1259,10 @@ bool PathParameter::isValid() { return true; } + else if (! isRequired) + { + return true; + } return false; } diff --git a/Source/Processors/Parameter/Parameter.h b/Source/Processors/Parameter/Parameter.h index ee2d528a8..604ab66fc 100755 --- a/Source/Processors/Parameter/Parameter.h +++ b/Source/Processors/Parameter/Parameter.h @@ -883,6 +883,7 @@ class PLUGIN_API PathParameter : public Parameter const File& defaultValue, const StringArray& filePatternsAllowed, const bool isDirectory, + const bool isRequired = true, bool deactivateDuringAcquisition = true); /** Sets the current value*/ @@ -912,6 +913,7 @@ class PLUGIN_API PathParameter : public Parameter private: StringArray filePatternsAllowed; bool isDirectory; + bool isRequired; }; /** diff --git a/Source/Processors/RecordNode/RecordNode.cpp b/Source/Processors/RecordNode/RecordNode.cpp index 8c0f1be88..7821111b0 100755 --- a/Source/Processors/RecordNode/RecordNode.cpp +++ b/Source/Processors/RecordNode/RecordNode.cpp @@ -106,7 +106,7 @@ RecordNode::~RecordNode() void RecordNode::registerParameters() { String defaultRecordDirectory = CoreServices::getRecordingParentDirectory().getFullPathName(); - addPathParameter (Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", defaultRecordDirectory, {}, true); + addPathParameter (Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", defaultRecordDirectory, {}, true, true); Array recordEngines; std::vector engines = getAvailableRecordEngines();