Skip to content

Commit

Permalink
Merge branch 'development-juce8' into testing-juce8
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Jan 10, 2025
2 parents 93fc365 + f066eea commit 661c0de
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 26 deletions.
3 changes: 2 additions & 1 deletion Source/Processors/DataThreads/DataThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions Source/Processors/DataThreads/DataThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Source/Processors/FileReader/FileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions Source/Processors/GenericProcessor/GenericProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ void GenericProcessor::addPathParameter (
const File& defaultValue,
const StringArray& validFileExtensions,
bool isDirectory,
bool isRequired,
bool deactivateDuringAcquisition)
{
PathParameter* p =
Expand All @@ -433,6 +434,7 @@ void GenericProcessor::addPathParameter (
defaultValue,
validFileExtensions,
isDirectory,
isRequired,
deactivateDuringAcquisition);

if (scope == Parameter::PROCESSOR_SCOPE)
Expand Down
1 change: 1 addition & 0 deletions Source/Processors/GenericProcessor/GenericProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
8 changes: 7 additions & 1 deletion Source/Processors/Parameter/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -1194,7 +1195,8 @@ PathParameter::PathParameter (ParameterOwner* owner,
defaultValue_.getFullPathName(),
deactivateDuringAcquisition),
filePatternsAllowed (fileExtensions_),
isDirectory (isDirectory_)
isDirectory (isDirectory_),
isRequired (isRequired_)
{
currentValue = defaultValue;
}
Expand Down Expand Up @@ -1257,6 +1259,10 @@ bool PathParameter::isValid()
{
return true;
}
else if (! isRequired)
{
return true;
}

return false;
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Processors/Parameter/Parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down Expand Up @@ -912,6 +913,7 @@ class PLUGIN_API PathParameter : public Parameter
private:
StringArray filePatternsAllowed;
bool isDirectory;
bool isRequired;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Processors/RecordNode/RecordNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> recordEngines;
std::vector<RecordEngineManager*> engines = getAvailableRecordEngines();
Expand Down
43 changes: 21 additions & 22 deletions Source/UI/DataViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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();

Expand Down Expand Up @@ -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();
}
Expand Down
15 changes: 15 additions & 0 deletions Source/UI/PopupComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

#include "PopupComponent.h"
#include "EditorViewport.h"
#include "UIComponent.h"

#include "../CoreServices.h"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 661c0de

Please sign in to comment.