mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 17:11:17 +02:00
Some steps of ResetProjectToEmpty into a new function
This commit is contained in:
parent
582b0ee40c
commit
0bd9bb3b90
@ -5335,6 +5335,7 @@ bool AudacityProject::IsProjectSaved() {
|
|||||||
// This is done to empty out the tracks, but without creating a new project.
|
// This is done to empty out the tracks, but without creating a new project.
|
||||||
void AudacityProject::ResetProjectToEmpty() {
|
void AudacityProject::ResetProjectToEmpty() {
|
||||||
auto &project = *this;
|
auto &project = *this;
|
||||||
|
auto &projectFileIO = project;
|
||||||
|
|
||||||
SelectActions::DoSelectAll( project );
|
SelectActions::DoSelectAll( project );
|
||||||
TrackActions::DoRemoveTracks( project );
|
TrackActions::DoRemoveTracks( project );
|
||||||
@ -5342,20 +5343,26 @@ void AudacityProject::ResetProjectToEmpty() {
|
|||||||
mDirManager = DirManager::Create();
|
mDirManager = DirManager::Create();
|
||||||
mTrackFactory.reset(safenew TrackFactory{ mDirManager, &mViewInfo });
|
mTrackFactory.reset(safenew TrackFactory{ mDirManager, &mViewInfo });
|
||||||
|
|
||||||
|
projectFileIO.ResetProjectFileIO();
|
||||||
|
|
||||||
|
mDirty = false;
|
||||||
|
GetUndoManager()->ClearStates();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AudacityProject::ResetProjectFileIO()
|
||||||
|
{
|
||||||
// mLastSavedTrack code copied from OnCloseWindow.
|
// mLastSavedTrack code copied from OnCloseWindow.
|
||||||
// Lock all blocks in all tracks of the last saved version, so that
|
// Lock all blocks in all tracks of the last saved version, so that
|
||||||
// the blockfiles aren't deleted on disk when we DELETE the blockfiles
|
// the blockfiles aren't deleted on disk when we DELETE the blockfiles
|
||||||
// in memory. After it's locked, DELETE the data structure so that
|
// in memory. After it's locked, DELETE the data structure so that
|
||||||
// there's no memory leak.
|
// there's no memory leak.
|
||||||
project.CloseLock();
|
CloseLock();
|
||||||
|
|
||||||
//mLastSavedTracks = TrackList::Create();
|
//mLastSavedTracks = TrackList::Create();
|
||||||
mFileName = "";
|
mFileName = "";
|
||||||
mIsRecovered = false;
|
mIsRecovered = false;
|
||||||
mbLoadedFromAup = false;
|
mbLoadedFromAup = false;
|
||||||
SetProjectTitle();
|
SetProjectTitle();
|
||||||
mDirty = false;
|
|
||||||
GetUndoManager()->ClearStates();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudacityProject::SaveFromTimerRecording(wxFileName fnFile) {
|
bool AudacityProject::SaveFromTimerRecording(wxFileName fnFile) {
|
||||||
|
@ -352,6 +352,7 @@ public:
|
|||||||
static int GetOpenProjectCount();
|
static int GetOpenProjectCount();
|
||||||
bool IsProjectSaved();
|
bool IsProjectSaved();
|
||||||
void ResetProjectToEmpty();
|
void ResetProjectToEmpty();
|
||||||
|
void ResetProjectFileIO();
|
||||||
|
|
||||||
// Routine to estimate how many minutes of recording time are left on disk
|
// Routine to estimate how many minutes of recording time are left on disk
|
||||||
int GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels = 0);
|
int GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user