mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
AUP3: Don't molest project file when applying macros
Cliff reported that if you apply a macro to "Files" and you had a "saved project" open at the time, you would get the "not saved properly" dialog when you next open that "saved project". This should correct it...
This commit is contained in:
parent
bbd893c891
commit
0bbf1792fa
@ -338,6 +338,10 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
||||
return;
|
||||
}
|
||||
|
||||
// This insures that we start with an empty and temporary project
|
||||
ProjectFileManager::Get(*project).CloseProject();
|
||||
ProjectFileManager::Get(*project).OpenProject();
|
||||
|
||||
auto prompt = XO("Select file(s) for batch processing...");
|
||||
|
||||
const auto fileTypes = Importer::Get().GetFileTypes();
|
||||
@ -451,10 +455,11 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
||||
return true;
|
||||
});
|
||||
|
||||
// Ensure project is completely reset
|
||||
ProjectManager::Get(*project).ResetProjectToEmpty();
|
||||
|
||||
if (!success)
|
||||
break;
|
||||
|
||||
ProjectManager::Get(*project).ResetProjectToEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2083,16 +2083,6 @@ bool ProjectFileIO::IsRecovered() const
|
||||
return mRecovered;
|
||||
}
|
||||
|
||||
void ProjectFileIO::Reset()
|
||||
{
|
||||
wxASSERT_MSG(!CurrConn(), wxT("Resetting project with open project file"));
|
||||
|
||||
mModified = false;
|
||||
mRecovered = false;
|
||||
|
||||
SetFileName({});
|
||||
}
|
||||
|
||||
wxLongLong ProjectFileIO::GetFreeDiskSpace() const
|
||||
{
|
||||
wxLongLong freeSpace;
|
||||
|
@ -75,8 +75,6 @@ public:
|
||||
bool IsTemporary() const;
|
||||
bool IsRecovered() const;
|
||||
|
||||
void Reset();
|
||||
|
||||
bool AutoSave(bool recording = false);
|
||||
bool AutoSaveDelete(sqlite3 *db = nullptr);
|
||||
|
||||
|
@ -621,28 +621,6 @@ bool ProjectFileManager::SaveCopy(const FilePath &fileName /* = wxT("") */)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ProjectFileManager::Reset()
|
||||
{
|
||||
// Lock all blocks in all tracks of the last saved version, so that
|
||||
// the sample blocks aren't deleted from the database when we destroy the
|
||||
// sample block objects in memory.
|
||||
if (mLastSavedTracks)
|
||||
{
|
||||
auto &project = mProject;
|
||||
auto &projectFileIO = ProjectFileIO::Get(project);
|
||||
|
||||
for (auto wt : mLastSavedTracks->Any<WaveTrack>())
|
||||
{
|
||||
wt->CloseLock();
|
||||
}
|
||||
|
||||
mLastSavedTracks->Clear();
|
||||
mLastSavedTracks.reset();
|
||||
}
|
||||
|
||||
ProjectFileIO::Get( mProject ).Reset();
|
||||
}
|
||||
|
||||
bool ProjectFileManager::SaveFromTimerRecording(wxFileName fnFile)
|
||||
{
|
||||
auto &project = mProject;
|
||||
|
@ -62,8 +62,6 @@ public:
|
||||
bool SaveFromTimerRecording( wxFileName fnFile );
|
||||
bool SaveCopy(const FilePath &fileName = wxT(""));
|
||||
|
||||
void Reset();
|
||||
|
||||
/** @brief Show an open dialogue for opening audio files, and possibly other
|
||||
* sorts of files.
|
||||
*
|
||||
|
@ -920,11 +920,12 @@ void ProjectManager::ResetProjectToEmpty() {
|
||||
|
||||
WaveTrackFactory::Reset( project );
|
||||
|
||||
projectFileManager.Reset();
|
||||
|
||||
projectHistory.SetDirty( false );
|
||||
auto &undoManager = UndoManager::Get( project );
|
||||
undoManager.ClearStates();
|
||||
|
||||
projectFileManager.CloseProject();
|
||||
projectFileManager.OpenProject();
|
||||
}
|
||||
|
||||
void ProjectManager::RestartTimer()
|
||||
|
Loading…
x
Reference in New Issue
Block a user