Audacity 3.2.0
|
Object associated with a project that manages reading and writing of Audacity project file formats, and autosave. More...
#include <ProjectFileIO.h>
Classes | |
class | BackupProject |
struct | TentativeConnection |
Public Types | |
using | ExecCB = std::function< int(int cols, char **vals, char **names)> |
Public Types inherited from Observer::Publisher< ProjectFileIOMessage > | |
using | message_type = ProjectFileIOMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const ProjectFileIOMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Public Member Functions | |
ProjectFileIO (AudacityProject &project) | |
ProjectFileIO (const ProjectFileIO &)=delete | |
ProjectFileIO & | operator= (const ProjectFileIO &)=delete |
~ProjectFileIO () | |
const wxString & | GetProjectTitle () const |
void | SetProjectTitle (int number=-1) |
const FilePath & | GetFileName () const |
void | SetFileName (const FilePath &fileName) |
bool | IsModified () const |
bool | IsTemporary () const |
bool | IsRecovered () const |
void | MarkTemporary () |
bool | AutoSave (bool recording=false) |
bool | AutoSaveDelete (sqlite3 *db=nullptr) |
bool | OpenProject () |
void | CloseProject () |
bool | ReopenProject () |
std::optional< TentativeConnection > | LoadProject (const FilePath &fileName, bool ignoreAutosave) |
bool | UpdateSaved (const TrackList *tracks=nullptr) |
bool | SaveProject (const FilePath &fileName, const TrackList *lastSaved) |
bool | SaveCopy (const FilePath &fileName) |
wxLongLong | GetFreeDiskSpace () const |
int64_t | GetBlockUsage (SampleBlockID blockid) |
int64_t | GetCurrentUsage (const std::vector< const TrackList * > &trackLists) const |
int64_t | GetTotalUsage () |
void | ShowError (const BasicUI::WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const wxString &helpPage) |
Displays an error dialog with a button that offers help. More... | |
const TranslatableString & | GetLastError () const |
const TranslatableString & | GetLibraryError () const |
int | GetLastErrorCode () const |
const wxString & | GetLastLog () const |
void | SetBypass () |
void | Compact (const std::vector< const TrackList * > &tracks, bool force=false) |
bool | WasCompacted () |
bool | HadUnused () |
bool | DeleteBlocks (const BlockIDs &blockids, bool complement) |
bool | HasConnection () const |
Return true if a connection is now open. More... | |
DBConnection & | GetConnection () |
Return a reference to a connection, creating it as needed on demand; throw on failure. More... | |
wxString | GenerateDoc () |
Return a strings representation of the active project XML doc. More... | |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from XMLTagHandler | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
Public Member Functions inherited from Observer::Publisher< ProjectFileIOMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static bool | InitializeSQL () |
static ProjectFileIO & | Get (AudacityProject &project) |
static const ProjectFileIO & | Get (const AudacityProject &project) |
static int64_t | GetDiskUsage (DBConnection &conn, SampleBlockID blockid) |
static bool | RemoveProject (const FilePath &filename) |
Remove any files associated with a project at given path; return true if successful. More... | |
Private Member Functions | |
bool | RenameOrWarn (const FilePath &src, const FilePath &dst) |
Rename a file or put up appropriate warning message. More... | |
bool | MoveProject (const FilePath &src, const FilePath &dst) |
void | OnCheckpointFailure () |
void | WriteXMLHeader (XMLWriter &xmlFile) const |
void | WriteXML (XMLWriter &xmlFile, bool recording=false, const TrackList *tracks=nullptr) |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
void | UpdatePrefs () override |
int | Exec (const char *query, const ExecCB &callback, bool silent=false) |
sqlite3 * | DB () |
bool | OpenConnection (FilePath fileName={}) |
bool | CloseConnection () |
void | SaveConnection () |
void | DiscardConnection () |
void | RestoreConnection () |
void | UseConnection (Connection &&conn, const FilePath &filePath) |
bool | Query (const char *sql, const ExecCB &callback, bool silent=false) |
bool | GetValue (const char *sql, wxString &value, bool silent=false) |
bool | GetValue (const char *sql, int64_t &value, bool silent=false) |
bool | CheckVersion () |
bool | InstallSchema (sqlite3 *db, const char *schema="main") |
bool | WriteDoc (const char *table, const ProjectSerializer &autosave, const char *schema="main") |
bool | CopyTo (const FilePath &destpath, const TranslatableString &msg, bool isTemporary, bool prune=false, const std::vector< const TrackList * > &tracks={}) |
void | SetError (const TranslatableString &msg, const TranslatableString &libraryError={}, int errorCode={}) |
Just set stored errors. More... | |
void | SetDBError (const TranslatableString &msg, const TranslatableString &libraryError={}, int errorCode=-1) |
Set stored errors and write to log; and default libraryError to what database library reports. More... | |
bool | ShouldCompact (const std::vector< const TrackList * > &tracks) |
Connection & | CurrConn () |
Private Member Functions inherited from PrefsListener | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
virtual void | UpdateSelectedPrefs (int id) |
Static Private Member Functions | |
static const std::vector< wxString > & | AuxiliaryFileSuffixes () |
static FilePath | SafetyFileName (const FilePath &src) |
Generate a name for short-lived backup project files from an existing project. More... | |
static void | InSet (sqlite3_context *context, int argc, sqlite3_value **argv) |
Static Private Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Private Attributes | |
AudacityProject & | mProject |
wxString | mTitle |
std::shared_ptr< DBConnectionErrors > | mpErrors |
FilePath | mFileName |
bool | mRecovered |
bool | mModified |
bool | mTemporary |
bool | mWasCompacted |
bool | mHadUnused |
Connection | mPrevConn |
FilePath | mPrevFileName |
bool | mPrevTemporary |
Additional Inherited Members | |
Static Public Attributes inherited from Observer::Publisher< ProjectFileIOMessage > | |
static constexpr bool | notifies_all |
Protected Member Functions inherited from Observer::Publisher< ProjectFileIOMessage > | |
CallbackReturn | Publish (const ProjectFileIOMessage &message) |
Send a message to connected callbacks. More... | |
Object associated with a project that manages reading and writing of Audacity project file formats, and autosave.
Definition at line 60 of file ProjectFileIO.h.
using ProjectFileIO::ExecCB = std::function<int(int cols, char **vals, char **names)> |
Definition at line 220 of file ProjectFileIO.h.
|
explicit |
Definition at line 407 of file ProjectFileIO.cpp.
References FileNames::AbbreviatePath(), mModified, mPrevConn, mRecovered, mTemporary, SetProjectTitle(), BasicUI::ShowErrorDialog(), TempDirectory::TempDir(), and XO().
|
delete |
ProjectFileIO::~ProjectFileIO | ( | ) |
Definition at line 438 of file ProjectFileIO.cpp.
bool ProjectFileIO::AutoSave | ( | bool | recording = false | ) |
Definition at line 1788 of file ProjectFileIO.cpp.
References mModified, WriteDoc(), WriteXML(), and WriteXMLHeader().
bool ProjectFileIO::AutoSaveDelete | ( | sqlite3 * | db = nullptr | ) |
Definition at line 1803 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, DB(), mModified, SetDBError(), and XO().
Referenced by Compact(), SaveProject(), and UpdateSaved().
|
staticprivate |
Strings like -wal that may be appended to main project name to get other files created by the database system
Definition at line 1232 of file ProjectFileIO.cpp.
Referenced by MoveProject(), RemoveProject(), SafetyFileName(), and ProjectFileIO::BackupProject::~BackupProject().
|
private |
Definition at line 727 of file ProjectFileIO.cpp.
References DB(), ProjectFormatVersion::FromPacked(), GetLastErrorCode(), GetLibraryError(), GetValue(), InstallSchema(), ProjectFileID, SetError(), SupportedProjectFormatVersion, and XO().
Referenced by OpenConnection().
|
private |
Definition at line 545 of file ProjectFileIO.cpp.
References CurrConn(), and SetFileName().
Referenced by CloseProject(), Compact(), OpenConnection(), ReopenProject(), and SaveProject().
void ProjectFileIO::CloseProject | ( | ) |
Definition at line 2368 of file ProjectFileIO.cpp.
References CloseConnection(), CurrConn(), IsTemporary(), mFileName, RemoveProject(), TempDirectory::TempDir(), and wxT().
Referenced by SaveProject().
void ProjectFileIO::Compact | ( | const std::vector< const TrackList * > & | tracks, |
bool | force = false |
||
) |
Definition at line 1408 of file ProjectFileIO.cpp.
References AutoSaveDelete(), CloseConnection(), CopyTo(), IsModified(), IsTemporary(), mFileName, mHadUnused, mWasCompacted, OpenConnection(), ShouldCompact(), tracks, wxT(), and XO().
Referenced by SaveProject().
|
private |
tracks | First track list (or if none, then the project's track list) are tracks to write into document blob; That list, plus any others, contain tracks whose sample blocks must be kept |
Definition at line 916 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, CurrConn(), DB(), WaveTrackUtilities::InspectBlocks(), InstallSchema(), BasicUI::MakeProgress(), mProject, BasicUI::ProgressShowCancel, Query(), SetDBError(), BasicUI::Success, THROW_INCONSISTENCY_EXCEPTION, tracks, WriteDoc(), WriteXML(), WriteXMLHeader(), and XO().
Referenced by Compact(), SaveCopy(), and SaveProject().
|
private |
Definition at line 1226 of file ProjectFileIO.cpp.
References ConnectionPtr::Get(), and mProject.
Referenced by CloseConnection(), CloseProject(), CopyTo(), GetBlockUsage(), GetConnection(), GetTotalUsage(), OpenConnection(), RestoreConnection(), SaveConnection(), SetBypass(), SetDBError(), SetError(), and UseConnection().
|
private |
Definition at line 478 of file ProjectFileIO.cpp.
References DBConnection::DB(), and GetConnection().
Referenced by AutoSaveDelete(), CheckVersion(), CopyTo(), DeleteBlocks(), Exec(), LoadProject(), and WriteDoc().
bool ProjectFileIO::DeleteBlocks | ( | const BlockIDs & | blockids, |
bool | complement | ||
) |
Definition at line 839 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, DB(), InSet(), mProject, mRecovered, SetDBError(), and XO().
Referenced by LoadProject(), and SaveProject().
|
private |
Definition at line 577 of file ProjectFileIO.cpp.
References mPrevConn, mPrevFileName, mPrevTemporary, RemoveProject(), SetDBError(), TempDirectory::TempDir(), wxT(), and XO().
Referenced by SaveConnection().
|
private |
Definition at line 651 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, DB(), ExecCallback(), SetDBError(), Verbatim(), and XO().
Referenced by Query().
wxString ProjectFileIO::GenerateDoc | ( | ) |
Return a strings representation of the active project XML doc.
Definition at line 468 of file ProjectFileIO.cpp.
References TrackList::Get(), mProject, WriteXML(), and WriteXMLHeader().
|
static |
Definition at line 396 of file ProjectFileIO.cpp.
References project, and sFileIOKey.
Referenced by ProjectFileManager::AddImportedTracks(), OpenProjectCommand::Apply(), ProjectFileManager::CloseProject(), ProjectFileManager::Compact(), ProjectFileManager::CompactProjectOnClose(), ProjectFileManager::DoImport(), anonymous_namespace{ImportMIDI.cpp}::DoImportMIDI(), ProjectFileManager::DoSave(), Get(), ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(), anonymous_namespace{ProjectFileManager.cpp}::ImportProject(), ProjectFileManager::IsAlreadyOpen(), audacity::cloud::audiocom::sync::ProjectCloudExtension::MarkProjectSynced(), ProjectAudioManager::OnAudioIONewBlocks(), ProjectAudioManager::OnAudioIOStopRecording(), TimerRecordDialog::OnAutoSavePathButton_Click(), ProjectManager::OnCloseWindow(), HistoryDialog::OnCompact(), ContrastDialog::OnExport(), ProjectWindow::OnProjectTitleChange(), anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::OnSave(), audacity::cloud::audiocom::sync::ProjectCloudExtension::OnSnapshotCreated(), audacity::cloud::audiocom::sync::ProjectCloudExtension::OnSyncCompleted(), ProjectManager::OnTimer(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), audacity::cloud::audiocom::sync::ProjectCloudExtension::OnUpdateSaved(), ProjectFileManager::OpenNewProject(), ProjectFileManager::OpenProject(), ProjectManager::OpenProject(), ProjectFileManager::OpenProjectFile(), audacity::cloud::audiocom::sync::OpenProjectFromCloud(), AutoRecoveryDialog::PopulateList(), TimerRecordDialog::PopulateOrExchange(), ProjectAudioManager::ProjectAudioManager(), ProjectManager::ProjectManager(), ProjectWindow::ProjectWindow(), ProjectFileManager::ReadProjectFile(), RefreshAllTitles(), ProjectManager::ResetProjectToEmpty(), ProjectFileManager::Save(), ProjectFileManager::SaveAs(), anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::SaveCloudProject(), ProjectFileManager::SaveCopy(), ProjectFileManager::SaveFromTimerRecording(), audacity::cloud::audiocom::CloudSyncService::SyncCloudSnapshot(), and audacity::cloud::audiocom::sync::ProjectCloudExtension::UpdateIdFromDatabase().
|
static |
Definition at line 402 of file ProjectFileIO.cpp.
References Get(), and project.
int64_t ProjectFileIO::GetBlockUsage | ( | SampleBlockID | blockid | ) |
Definition at line 2538 of file ProjectFileIO.cpp.
References CurrConn(), and GetDiskUsage().
DBConnection & ProjectFileIO::GetConnection | ( | ) |
Return a reference to a connection, creating it as needed on demand; throw on failure.
Definition at line 448 of file ProjectFileIO.cpp.
References CurrConn(), Internal, OpenConnection(), and XO().
Referenced by DB().
int64_t ProjectFileIO::GetCurrentUsage | ( | const std::vector< const TrackList * > & | trackLists | ) | const |
Definition at line 2546 of file ProjectFileIO.cpp.
References BlockSpaceUsageAccumulator(), fn, and WaveTrackUtilities::InspectBlocks().
|
static |
Definition at line 2576 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, DBConnection::GetAllSampleBlocksSize, DBConnection::GetSampleBlockSize, DBConnection::Prepare(), and DBConnection::ThrowException().
Referenced by GetBlockUsage(), SqliteSampleBlock::GetSpaceUsage(), and GetTotalUsage().
const FilePath & ProjectFileIO::GetFileName | ( | ) | const |
Definition at line 1595 of file ProjectFileIO.cpp.
References mFileName.
Referenced by ProjectFileManager::IsAlreadyOpen(), ContrastDialog::OnExport(), OpenConnection(), TimerRecordDialog::PopulateOrExchange(), ProjectFileManager::SaveAs(), and anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::SaveCloudProject().
wxLongLong ProjectFileIO::GetFreeDiskSpace | ( | ) | const |
Definition at line 2429 of file ProjectFileIO.cpp.
References staffpad::vo::free(), FileNames::IsOnFATFileSystem(), mFileName, and min().
Referenced by ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(), and ProjectManager::OnTimer().
const TranslatableString & ProjectFileIO::GetLastError | ( | ) | const |
Definition at line 2468 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by SaveProject().
int ProjectFileIO::GetLastErrorCode | ( | ) | const |
Definition at line 2478 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by CheckVersion().
const wxString & ProjectFileIO::GetLastLog | ( | ) | const |
Definition at line 2483 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by ShowError().
const TranslatableString & ProjectFileIO::GetLibraryError | ( | ) | const |
Definition at line 2473 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by CheckVersion().
|
inline |
Definition at line 96 of file ProjectFileIO.h.
Referenced by ProjectWindow::OnProjectTitleChange().
int64_t ProjectFileIO::GetTotalUsage | ( | ) |
Definition at line 2563 of file ProjectFileIO.cpp.
References CurrConn(), and GetDiskUsage().
Referenced by ShouldCompact().
|
private |
Definition at line 705 of file ProjectFileIO.cpp.
References FromCharsResult::ec, FromChars(), and Query().
|
private |
Definition at line 691 of file ProjectFileIO.cpp.
References Query().
Referenced by CheckVersion(), LoadProject(), and WriteDoc().
bool ProjectFileIO::HadUnused | ( | ) |
Definition at line 1546 of file ProjectFileIO.cpp.
References mHadUnused.
Referenced by SetBypass().
|
overrideprivatevirtual |
Implements XMLTagHandler.
Definition at line 1717 of file ProjectFileIO.cpp.
References XMLMethodRegistry< Host >::CallObjectAccessor(), XMLMethodRegistry< Host >::Get(), mProject, and project.
|
overrideprivatevirtual |
Implements XMLTagHandler.
Definition at line 1638 of file ProjectFileIO.cpp.
References AUDACITY_FILE_FORMAT_VERSION, XMLMethodRegistry< Host >::Get(), mProject, project, ProjectFramePlacement(), ShowError(), wxT(), and XO().
bool ProjectFileIO::HasConnection | ( | ) | const |
Return true if a connection is now open.
Definition at line 442 of file ProjectFileIO.cpp.
References ConnectionPtr::Get(), and mProject.
|
static |
Definition at line 375 of file ProjectFileIO.cpp.
References audacity::sqlite::Initialize(), and audacity::sqlite::SetLogCallback().
Referenced by AudacityApp::OnInit0().
|
staticprivate |
Definition at line 827 of file ProjectFileIO.cpp.
References CommandLineArgs::argv, and ProjectFileIOExtensionRegistry::IsBlockLocked().
Referenced by DeleteBlocks().
|
private |
Definition at line 792 of file ProjectFileIO.cpp.
References BaseProjectFormatVersion, ProjectFormatVersion::GetPacked(), ProjectFileID, ProjectFileSchema, SetDBError(), and XO().
Referenced by CheckVersion(), and CopyTo().
bool ProjectFileIO::IsModified | ( | ) | const |
Definition at line 2409 of file ProjectFileIO.cpp.
References mModified.
Referenced by Compact(), and anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord().
bool ProjectFileIO::IsRecovered | ( | ) | const |
Definition at line 2419 of file ProjectFileIO.cpp.
References mRecovered.
bool ProjectFileIO::IsTemporary | ( | ) | const |
Definition at line 2414 of file ProjectFileIO.cpp.
References mTemporary.
Referenced by CloseProject(), Compact(), SaveProject(), SetBypass(), and SetFileName().
auto ProjectFileIO::LoadProject | ( | const FilePath & | fileName, |
bool | ignoreAutosave | ||
) |
If successful, return non-empty; the caller must commit to keep the association of the opened file with the project
Definition at line 2027 of file ProjectFileIO.cpp.
References DB(), ProjectSerializer::Decode(), DeleteBlocks(), WaveTrackFactory::Get(), WaveTrackFactory::GetSampleBlockFactory(), GetValue(), mModified, mProject, mRecovered, mTemporary, OpenConnection(), SetError(), wxT(), and XO().
Referenced by audacity::cloud::audiocom::CloudSyncService::SyncCloudSnapshot().
void ProjectFileIO::MarkTemporary | ( | ) |
Definition at line 2424 of file ProjectFileIO.cpp.
References mTemporary.
Referenced by audacity::cloud::audiocom::sync::OpenProjectFromCloud(), and anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::SaveCloudProject().
Definition at line 1319 of file ProjectFileIO.cpp.
References AuxiliaryFileSuffixes(), and RenameOrWarn().
Referenced by ProjectFileIO::BackupProject::BackupProject(), and SaveProject().
|
private |
Definition at line 1723 of file ProjectFileIO.cpp.
References CheckpointFailure, and Observer::Publisher< ProjectFileIOMessage >::Publish().
|
private |
Definition at line 487 of file ProjectFileIO.cpp.
References CheckVersion(), CloseConnection(), CurrConn(), GetFileName(), mpErrors, mProject, mTemporary, SetError(), SetFileName(), TempDirectory::TempDir(), TempDirectory::UnsavedProjectFileName(), wxT(), and XO().
Referenced by Compact(), GetConnection(), LoadProject(), OpenProject(), ReopenProject(), and SaveProject().
bool ProjectFileIO::OpenProject | ( | ) |
Definition at line 2363 of file ProjectFileIO.cpp.
References OpenConnection().
|
delete |
|
private |
Definition at line 678 of file ProjectFileIO.cpp.
References Exec().
Referenced by CopyTo(), GetValue(), ShouldCompact(), and WriteDoc().
|
static |
Remove any files associated with a project at given path; return true if successful.
Definition at line 1356 of file ProjectFileIO.cpp.
References AuxiliaryFileSuffixes().
Referenced by CloseProject(), ProjectFileIO::BackupProject::Discard(), DiscardConnection(), and AutoRecoveryDialog::OnDiscardSelected().
Rename a file or put up appropriate warning message.
Failure might happen when renaming onto another device, doing copy of contents
Definition at line 1278 of file ProjectFileIO.cpp.
References BasicUI::MakeGenericProgress(), mProject, ProjectFramePlacement(), ShowError(), and XO().
Referenced by MoveProject().
bool ProjectFileIO::ReopenProject | ( | ) |
Definition at line 2398 of file ProjectFileIO.cpp.
References CloseConnection(), mFileName, and OpenConnection().
|
private |
Definition at line 611 of file ProjectFileIO.cpp.
References CurrConn(), mPrevConn, mPrevFileName, mPrevTemporary, mTemporary, SetDBError(), SetFileName(), and XO().
Generate a name for short-lived backup project files from an existing project.
Definition at line 1243 of file ProjectFileIO.cpp.
References AuxiliaryFileSuffixes(), fn, name, and wxT().
Referenced by ProjectFileIO::BackupProject::BackupProject().
|
private |
Definition at line 564 of file ProjectFileIO.cpp.
References CurrConn(), DiscardConnection(), mFileName, mPrevConn, mPrevFileName, mPrevTemporary, mTemporary, and SetFileName().
Referenced by ProjectFileIO::TentativeConnection::TentativeConnection().
bool ProjectFileIO::SaveCopy | ( | const FilePath & | fileName | ) |
Definition at line 2357 of file ProjectFileIO.cpp.
References CopyTo(), TrackList::Get(), mProject, and XO().
Definition at line 2150 of file ProjectFileIO.cpp.
References AutoSaveDelete(), BasicUI::CallAfter(), CloseConnection(), CloseProject(), Compact(), CopyTo(), TrackList::Create(), DeleteBlocks(), GetLastError(), WaveTrackUtilities::InspectBlocks(), IsTemporary(), BasicUI::MakeGenericProgress(), mFileName, mModified, MoveProject(), mpErrors, mProject, mRecovered, mTemporary, OpenConnection(), Observer::Publisher< ProjectFileIOMessage >::Publish(), ReconnectionFailure, SetError(), SetProjectTitle(), ShowError(), UpdateSaved(), UseConnection(), Verbatim(), FileException::WriteFailureMessage(), and XO().
void ProjectFileIO::SetBypass | ( | ) |
Definition at line 2504 of file ProjectFileIO.cpp.
References CurrConn(), HadUnused(), IsTemporary(), and WasCompacted().
|
private |
Set stored errors and write to log; and default libraryError to what database library reports.
Definition at line 2496 of file ProjectFileIO.cpp.
References CurrConn().
Referenced by AutoSaveDelete(), CopyTo(), DeleteBlocks(), DiscardConnection(), Exec(), InstallSchema(), RestoreConnection(), and WriteDoc().
|
private |
Just set stored errors.
Definition at line 2488 of file ProjectFileIO.cpp.
References CurrConn().
Referenced by CheckVersion(), LoadProject(), OpenConnection(), and SaveProject().
void ProjectFileIO::SetFileName | ( | const FilePath & | fileName | ) |
Definition at line 1600 of file ProjectFileIO.cpp.
References ActiveProjects::Add(), BasicUI::CallAfter(), IsTemporary(), mFileName, mProject, project, ProjectFilePathChange, ActiveProjects::Remove(), and SetProjectTitle().
Referenced by CloseConnection(), OpenConnection(), RestoreConnection(), SaveConnection(), and UseConnection().
void ProjectFileIO::SetProjectTitle | ( | int | number = -1 | ) |
Definition at line 1557 of file ProjectFileIO.cpp.
References _, _TS, BasicUI::CallAfter(), mProject, mRecovered, mTitle, name, project, ProjectTitleChange, Verbatim(), wxT(), and XO().
Referenced by ProjectFileIO(), RefreshAllTitles(), SaveProject(), SetFileName(), and UpdatePrefs().
|
private |
Definition at line 1178 of file ProjectFileIO.cpp.
References BlockSpaceUsageAccumulator(), fn, GetTotalUsage(), WaveTrackUtilities::InspectBlocks(), mHadUnused, Query(), tracks, and wxT().
Referenced by Compact().
void ProjectFileIO::ShowError | ( | const BasicUI::WindowPlacement & | placement, |
const TranslatableString & | dlogTitle, | ||
const TranslatableString & | message, | ||
const wxString & | helpPage | ||
) |
Displays an error dialog with a button that offers help.
Definition at line 2456 of file ProjectFileIO.cpp.
References GetLastLog(), BasicUI::ErrorDialogOptions::Log(), BasicUI::ShowErrorDialog(), and audacity::ToWString().
Referenced by HandleXMLTag(), RenameOrWarn(), and SaveProject().
|
overrideprivatevirtual |
Implements PrefsListener.
Definition at line 1551 of file ProjectFileIO.cpp.
References SetProjectTitle().
bool ProjectFileIO::UpdateSaved | ( | const TrackList * | tracks = nullptr | ) |
Definition at line 2125 of file ProjectFileIO.cpp.
References AutoSaveDelete(), mProject, ProjectFileIOExtensionRegistry::OnUpdateSaved(), tracks, WriteDoc(), WriteXML(), and WriteXMLHeader().
Referenced by SaveProject().
|
private |
Definition at line 632 of file ProjectFileIO.cpp.
References CurrConn(), and SetFileName().
Referenced by SaveProject().
bool ProjectFileIO::WasCompacted | ( | ) |
Definition at line 1541 of file ProjectFileIO.cpp.
References mWasCompacted.
Referenced by SetBypass().
|
private |
Definition at line 1829 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, BaseProjectFormatVersion, TransactionScope::Commit(), DB(), ProjectSerializer::GetData(), ProjectSerializer::GetDict(), ProjectFormatVersion::GetPacked(), MemoryStream::GetSize(), GetValue(), mProject, SQLiteBlobStream::Open(), Query(), SetDBError(), and XO().
Referenced by AutoSave(), CopyTo(), and UpdateSaved().
|
private |
Definition at line 1745 of file ProjectFileIO.cpp.
References AUDACITY_FILE_FORMAT_VERSION, XMLMethodRegistry< Host >::CallWriters(), XMLWriter::EndTag(), XMLMethodRegistry< Host >::Get(), PendingTracks::Get(), TrackList::Get(), mProject, XMLWriter::StartTag(), tracks, XMLWriter::WriteAttr(), Track::WriteXML(), and wxT().
Referenced by AutoSave(), CopyTo(), GenerateDoc(), and UpdateSaved().
|
private |
Definition at line 1730 of file ProjectFileIO.cpp.
References XMLWriter::Write(), and wxT().
Referenced by AutoSave(), CopyTo(), GenerateDoc(), and UpdateSaved().
|
private |
Definition at line 315 of file ProjectFileIO.h.
Referenced by CloseProject(), ProjectFileIO::TentativeConnection::Commit(), Compact(), GetFileName(), GetFreeDiskSpace(), ReopenProject(), SaveConnection(), SaveProject(), ProjectFileIO::TentativeConnection::SetFileName(), and SetFileName().
|
private |
Definition at line 330 of file ProjectFileIO.h.
Referenced by Compact(), HadUnused(), and ShouldCompact().
|
private |
Definition at line 321 of file ProjectFileIO.h.
Referenced by AutoSave(), AutoSaveDelete(), IsModified(), LoadProject(), ProjectFileIO(), and SaveProject().
|
private |
Definition at line 312 of file ProjectFileIO.h.
Referenced by GetLastError(), GetLastErrorCode(), GetLastLog(), GetLibraryError(), OpenConnection(), and SaveProject().
|
private |
Definition at line 332 of file ProjectFileIO.h.
Referenced by DiscardConnection(), ProjectFileIO(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 333 of file ProjectFileIO.h.
Referenced by DiscardConnection(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 334 of file ProjectFileIO.h.
Referenced by DiscardConnection(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 308 of file ProjectFileIO.h.
Referenced by CopyTo(), CurrConn(), DeleteBlocks(), GenerateDoc(), HandleXMLChild(), HandleXMLTag(), HasConnection(), LoadProject(), OpenConnection(), RenameOrWarn(), SaveCopy(), SaveProject(), SetFileName(), SetProjectTitle(), UpdateSaved(), WriteDoc(), and WriteXML().
|
private |
Definition at line 318 of file ProjectFileIO.h.
Referenced by DeleteBlocks(), IsRecovered(), LoadProject(), ProjectFileIO(), SaveProject(), and SetProjectTitle().
|
private |
Definition at line 324 of file ProjectFileIO.h.
Referenced by IsTemporary(), LoadProject(), MarkTemporary(), OpenConnection(), ProjectFileIO(), RestoreConnection(), SaveConnection(), and SaveProject().
|
private |
Definition at line 310 of file ProjectFileIO.h.
Referenced by SetProjectTitle().
|
private |
Definition at line 327 of file ProjectFileIO.h.
Referenced by Compact(), and WasCompacted().