Skip to content

Commit 87f8c68

Browse files
committed
Prevent changing recording parent directory while recording is active
1 parent f408aa2 commit 87f8c68

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Source/UI/ControlPanel.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,13 @@ int64 ControlPanel::getRecordingTime() const
585585

586586
void ControlPanel::setRecordingParentDirectory (String path)
587587
{
588+
if (getRecordingState())
589+
{
590+
LOGE ("Cannot change recording parent directory while recording is active. "
591+
"Please stop recording before changing the directory.");
592+
return;
593+
}
594+
588595
File newFile (path);
589596
filenameComponent->setCurrentFile (newFile, true, sendNotificationSync);
590597

@@ -840,6 +847,7 @@ void ControlPanel::paint (Graphics& g)
840847
// Fill record engine selector background area with control panel background colour
841848
g.setColour (findColour (ThemeColours::controlPanelBackground));
842849
g.fillRoundedRectangle (recordSelector->getBounds().toFloat(), 3.0f);
850+
g.fillRoundedRectangle (filenameComponent->getBounds().toFloat(), 3.0f);
843851
}
844852
}
845853

@@ -1034,6 +1042,8 @@ void ControlPanel::startRecording()
10341042
}
10351043
}
10361044

1045+
filenameComponent->setEnabled (false);
1046+
10371047
graph->setRecordState (true);
10381048

10391049
repaint();
@@ -1065,6 +1075,8 @@ void ControlPanel::stopRecording()
10651075

10661076
recordButton->setToggleState (false, dontSendNotification);
10671077

1078+
filenameComponent->setEnabled (true);
1079+
10681080
repaint();
10691081
}
10701082

0 commit comments

Comments
 (0)