Skip to content

Commit 661c0de

Browse files
committed
Merge branch 'development-juce8' into testing-juce8
2 parents 93fc365 + f066eea commit 661c0de

10 files changed

Lines changed: 53 additions & 26 deletions

File tree

Source/Processors/DataThreads/DataThread.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ void DataThread::addPathParameter (Parameter::ParameterScope scope,
120120
const String& defaultValue,
121121
const StringArray& validFileExtensions,
122122
bool isDirectory,
123+
bool isRequired,
123124
bool deactivateDuringAcquisition)
124125
{
125-
sn->addPathParameter (scope, name, displayName, description, defaultValue, validFileExtensions, isDirectory, deactivateDuringAcquisition);
126+
sn->addPathParameter (scope, name, displayName, description, defaultValue, validFileExtensions, isDirectory, isRequired, deactivateDuringAcquisition);
126127
}
127128

128129
void DataThread::addSelectedStreamParameter (Parameter::ParameterScope scope,

Source/Processors/DataThreads/DataThread.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class PLUGIN_API DataThread : public Thread
193193
const String& defaultValue,
194194
const StringArray& validFileExtensions,
195195
bool isDirectory,
196+
bool isRequired,
196197
bool deactivateDuringAcquisition = true);
197198

198199
/** Adds a selected stream parameter which holds the currentlu selected stream */

Source/Processors/FileReader/FileReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ FileReader::~FileReader()
109109
void FileReader::registerParameters()
110110
{
111111
/* Add parameters */
112-
addPathParameter (Parameter::PROCESSOR_SCOPE, "selected_file", "Selected File", "File to load data from", defaultFile, getSupportedExtensions(), false);
112+
addPathParameter (Parameter::PROCESSOR_SCOPE, "selected_file", "Selected File", "File to load data from", defaultFile, getSupportedExtensions(), false, true);
113113
addSelectedStreamParameter (Parameter::PROCESSOR_SCOPE, "active_stream", "Active Stream", "Currently active stream", {}, 0);
114114
addTimeParameter (Parameter::PROCESSOR_SCOPE, "start_time", "Start Time", "Time to start playback");
115115
addTimeParameter (Parameter::PROCESSOR_SCOPE, "end_time", "Stop Time", "Time to end playback");

Source/Processors/GenericProcessor/GenericProcessor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ void GenericProcessor::addPathParameter (
422422
const File& defaultValue,
423423
const StringArray& validFileExtensions,
424424
bool isDirectory,
425+
bool isRequired,
425426
bool deactivateDuringAcquisition)
426427
{
427428
PathParameter* p =
@@ -433,6 +434,7 @@ void GenericProcessor::addPathParameter (
433434
defaultValue,
434435
validFileExtensions,
435436
isDirectory,
437+
isRequired,
436438
deactivateDuringAcquisition);
437439

438440
if (scope == Parameter::PROCESSOR_SCOPE)

Source/Processors/GenericProcessor/GenericProcessor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ class PLUGIN_API GenericProcessor : public GenericProcessorBase, public PluginCl
377377
const File& defaultValue,
378378
const StringArray& validFileExtensions,
379379
bool isDirectory,
380+
bool isRequired,
380381
bool deactivateDuringAcquisition = true);
381382

382383
/** Adds a selected stream parameter which holds the currentlu selected stream */

Source/Processors/Parameter/Parameter.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ PathParameter::PathParameter (ParameterOwner* owner,
11841184
const File& defaultValue_,
11851185
const StringArray& fileExtensions_,
11861186
bool isDirectory_,
1187+
bool isRequired_,
11871188
bool deactivateDuringAcquisition)
11881189
: Parameter (owner,
11891190
ParameterType::PATH_PARAM,
@@ -1194,7 +1195,8 @@ PathParameter::PathParameter (ParameterOwner* owner,
11941195
defaultValue_.getFullPathName(),
11951196
deactivateDuringAcquisition),
11961197
filePatternsAllowed (fileExtensions_),
1197-
isDirectory (isDirectory_)
1198+
isDirectory (isDirectory_),
1199+
isRequired (isRequired_)
11981200
{
11991201
currentValue = defaultValue;
12001202
}
@@ -1257,6 +1259,10 @@ bool PathParameter::isValid()
12571259
{
12581260
return true;
12591261
}
1262+
else if (! isRequired)
1263+
{
1264+
return true;
1265+
}
12601266

12611267
return false;
12621268
}

Source/Processors/Parameter/Parameter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,7 @@ class PLUGIN_API PathParameter : public Parameter
883883
const File& defaultValue,
884884
const StringArray& filePatternsAllowed,
885885
const bool isDirectory,
886+
const bool isRequired = true,
886887
bool deactivateDuringAcquisition = true);
887888

888889
/** Sets the current value*/
@@ -912,6 +913,7 @@ class PLUGIN_API PathParameter : public Parameter
912913
private:
913914
StringArray filePatternsAllowed;
914915
bool isDirectory;
916+
bool isRequired;
915917
};
916918

917919
/**

Source/Processors/RecordNode/RecordNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ RecordNode::~RecordNode()
106106
void RecordNode::registerParameters()
107107
{
108108
String defaultRecordDirectory = CoreServices::getRecordingParentDirectory().getFullPathName();
109-
addPathParameter (Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", defaultRecordDirectory, {}, true);
109+
addPathParameter (Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", defaultRecordDirectory, {}, true, true);
110110

111111
Array<String> recordEngines;
112112
std::vector<RecordEngineManager*> engines = getAvailableRecordEngines();

Source/UI/DataViewport.cpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -610,23 +610,8 @@ void DataViewport::removeTab (int nodeId, bool sendNotification)
610610

611611
if (foundTab)
612612
{
613-
if (draggableTabComponent->getNumTabs() == 0 && draggableTabComponents.size() > 1)
614-
{
615-
draggableTabComponents.removeObject (draggableTabComponent);
616-
activeTabbedComponent--;
617-
618-
tabbedComponentLayout.clearAllItems();
619-
620-
tabbedComponentResizer->setVisible (draggableTabComponents.size() == 2);
621-
622-
resized();
623-
624-
if (draggableTabComponents[activeTabbedComponent]->getNumTabs() > 1)
625-
addTabbedComponentButton->setVisible (true);
626-
else
627-
addTabbedComponentButton->setVisible (false);
628-
}
629-
613+
// remove the tabbed component if it's empty
614+
removeTabbedComponent (draggableTabComponent);
630615
return;
631616
}
632617
}
@@ -641,11 +626,14 @@ void DataViewport::buttonClicked (Button* button)
641626
addAndMakeVisible (d);
642627
draggableTabComponents.add (d);
643628

644-
tabbedComponentResizer->setVisible (true);
629+
if (draggableTabComponents.size() == 2)
630+
{
631+
tabbedComponentResizer->setVisible (true);
645632

646-
tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5);
647-
tabbedComponentLayout.setItemLayout (1, 12, 12, 12);
648-
tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5);
633+
tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5);
634+
tabbedComponentLayout.setItemLayout (1, 12, 12, 12);
635+
tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5);
636+
}
649637

650638
resized();
651639

@@ -684,7 +672,18 @@ void DataViewport::removeTabbedComponent (DraggableTabComponent* draggableTabCom
684672

685673
tabbedComponentLayout.clearAllItems();
686674

687-
tabbedComponentResizer->setVisible (draggableTabComponents.size() == 2);
675+
if (draggableTabComponents.size() == 2)
676+
{
677+
tabbedComponentResizer->setVisible (true);
678+
679+
tabbedComponentLayout.setItemLayout (0, -0.25, -0.75, -0.5);
680+
tabbedComponentLayout.setItemLayout (1, 12, 12, 12);
681+
tabbedComponentLayout.setItemLayout (2, -0.25, -0.75, -0.5);
682+
}
683+
else
684+
{
685+
tabbedComponentResizer->setVisible (false);
686+
}
688687

689688
resized();
690689
}

Source/UI/PopupComponent.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323

2424
#include "PopupComponent.h"
25+
#include "EditorViewport.h"
2526
#include "UIComponent.h"
2627

2728
#include "../CoreServices.h"
@@ -89,6 +90,13 @@ bool PopupComponent::keyPressed (const KeyPress& key)
8990
return false;
9091
}
9192

93+
if (CoreServices::getAcquisitionStatus()
94+
&& undoManager->getUndoDescription().contains ("Disabled during acquisition"))
95+
return false;
96+
97+
if (AccessClass::getEditorViewport()->isSignalChainLocked())
98+
return false;
99+
92100
undoManager->undo();
93101

94102
if (parent != nullptr)
@@ -109,6 +117,13 @@ bool PopupComponent::keyPressed (const KeyPress& key)
109117
return false;
110118
}
111119

120+
if (CoreServices::getAcquisitionStatus()
121+
&& undoManager->getRedoDescription().contains ("Disabled during acquisition"))
122+
return false;
123+
124+
if (AccessClass::getEditorViewport()->isSignalChainLocked())
125+
return false;
126+
112127
undoManager->redo();
113128

114129
if (parent != nullptr)

0 commit comments

Comments
 (0)