Skip to content

Commit

Permalink
Use path set in ControlPanel as default for RecordNode
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Oct 20, 2023
1 parent 5a8d02b commit 190adff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/Processors/RecordNode/RecordNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ RecordNode::~RecordNode()

void RecordNode::registerParameters()
{
addPathParameter(Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", CoreServices::getDefaultUserSaveDirectory().getFullPathName(), {}, true);
addCategoricalParameter(Parameter::PROCESSOR_SCOPE, "engine", "Engine", "Recording data format", {}, 0, true);
addBooleanParameter(Parameter::PROCESSOR_SCOPE, "events", "Record Events", "Toggle saving events coming into this node", true);
addBooleanParameter(Parameter::PROCESSOR_SCOPE, "spikes", "Record Spikes", "Toggle saving spikes coming into this node", true);
String defaultRecordDirectory = CoreServices::getRecordingParentDirectory().getFullPathName();
addPathParameter(Parameter::PROCESSOR_SCOPE, "directory", "Directory", "Path to write data to", defaultRecordDirectory, {}, true);
addCategoricalParameter(Parameter::PROCESSOR_SCOPE, "engine", "Engine", "Recording data format", {}, 0, true);
addBooleanParameter(Parameter::PROCESSOR_SCOPE, "events", "Record Events", "Toggle saving events coming into this node", true);
addBooleanParameter(Parameter::PROCESSOR_SCOPE, "spikes", "Record Spikes", "Toggle saving spikes coming into this node", true);

Array<String> recordEngines;
std::vector<RecordEngineManager*> engines = getAvailableRecordEngines();
Expand All @@ -110,6 +111,8 @@ void RecordNode::parameterValueChanged(Parameter* p)
if (p->getName() == "directory")
{
String newPath = static_cast<PathParameter*>(p)->getValue();
if (newPath == "default" || !File(newPath).exists())
newPath = CoreServices::getRecordingParentDirectory().getFullPathName();
setDataDirectory(File(newPath));
}
else if (p->getName() == "engine")
Expand Down

0 comments on commit 190adff

Please sign in to comment.