![]() |
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)> |
![]() | |
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 |
bool | AutoSave (bool recording=false) |
bool | AutoSaveDelete (sqlite3 *db=nullptr) |
bool | OpenProject () |
bool | 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... | |
![]() | |
virtual | ~Base () |
![]() | |
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) |
![]() | |
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 () |
![]() | |
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 unsigned int | get2 (const unsigned char *ptr) |
static unsigned int | get4 (const unsigned char *ptr) |
static int | get_varint (const unsigned char *ptr, int64_t *out) |
![]() | |
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 constexpr bool | notifies_all |
![]() | |
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 59 of file ProjectFileIO.h.
using ProjectFileIO::ExecCB = std::function<int(int cols, char **vals, char **names)> |
Definition at line 217 of file ProjectFileIO.h.
|
explicit |
Definition at line 444 of file ProjectFileIO.cpp.
References FileNames::AbbreviatePath(), mModified, mPrevConn, mRecovered, mTemporary, SetProjectTitle(), BasicUI::ShowErrorDialog(), TempDirectory::TempDir(), and XO().
|
delete |
ProjectFileIO::~ProjectFileIO | ( | ) |
Definition at line 475 of file ProjectFileIO.cpp.
bool ProjectFileIO::AutoSave | ( | bool | recording = false | ) |
Definition at line 1800 of file ProjectFileIO.cpp.
References mModified, WriteDoc(), WriteXML(), and WriteXMLHeader().
bool ProjectFileIO::AutoSaveDelete | ( | sqlite3 * | db = nullptr | ) |
Definition at line 1815 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 1255 of file ProjectFileIO.cpp.
Referenced by MoveProject(), RemoveProject(), SafetyFileName(), and ProjectFileIO::BackupProject::~BackupProject().
|
private |
Definition at line 764 of file ProjectFileIO.cpp.
References DB(), ProjectFormatVersion::FromPacked(), GetLastErrorCode(), GetLibraryError(), GetValue(), InstallSchema(), ProjectFileID, SetError(), SupportedProjectFormatVersion, and XO().
Referenced by OpenConnection().
|
private |
Definition at line 582 of file ProjectFileIO.cpp.
References CurrConn(), and SetFileName().
Referenced by CloseProject(), Compact(), OpenConnection(), ReopenProject(), and SaveProject().
bool ProjectFileIO::CloseProject | ( | ) |
Definition at line 2382 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 1431 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 939 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, CurrConn(), DB(), 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 1249 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 515 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 863 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, DB(), InSet(), mRecovered, SetDBError(), and XO().
Referenced by LoadProject(), and SaveProject().
|
private |
Definition at line 614 of file ProjectFileIO.cpp.
References mPrevConn, mPrevFileName, mPrevTemporary, RemoveProject(), SetDBError(), TempDirectory::TempDir(), wxT(), and XO().
Referenced by SaveConnection().
|
private |
Definition at line 688 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 505 of file ProjectFileIO.cpp.
References TrackList::Get(), mProject, WriteXML(), and WriteXMLHeader().
|
static |
Definition at line 433 of file ProjectFileIO.cpp.
References project, and sFileIOKey.
Referenced by ProjectFileManager::AddImportedTracks(), OpenProjectCommand::Apply(), ProjectFileManager::CloseProject(), ProjectFileManager::Compact(), ProjectFileManager::CompactProjectOnClose(), DoImportMIDI(), ProjectFileManager::DoSave(), Get(), ProjectManager::GetEstimatedRecordingMinsLeftOnDisk(), ProjectFileManager::Import(), anonymous_namespace{ProjectFileManager.cpp}::ImportProject(), ProjectFileManager::IsAlreadyOpen(), ProjectAudioManager::OnAudioIONewBlocks(), ProjectAudioManager::OnAudioIOStopRecording(), TimerRecordDialog::OnAutoSavePathButton_Click(), ProjectManager::OnCloseWindow(), HistoryDialog::OnCompact(), ContrastDialog::OnExport(), ProjectWindow::OnProjectTitleChange(), ProjectManager::OnTimer(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), ProjectFileManager::OpenNewProject(), ProjectFileManager::OpenProject(), ProjectManager::OpenProject(), ProjectFileManager::OpenProjectFile(), AutoRecoveryDialog::PopulateList(), TimerRecordDialog::PopulateOrExchange(), ProjectAudioManager::ProjectAudioManager(), ProjectManager::ProjectManager(), ProjectWindow::ProjectWindow(), ProjectFileManager::ReadProjectFile(), RefreshAllTitles(), ProjectManager::ResetProjectToEmpty(), ProjectFileManager::Save(), ProjectFileManager::SaveAs(), ProjectFileManager::SaveCopy(), and ProjectFileManager::SaveFromTimerRecording().
|
static |
Definition at line 439 of file ProjectFileIO.cpp.
References Get(), and project.
|
staticprivate |
|
staticprivate |
|
staticprivate |
int64_t ProjectFileIO::GetBlockUsage | ( | SampleBlockID | blockid | ) |
Definition at line 2549 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 485 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 2557 of file ProjectFileIO.cpp.
References BlockSpaceUsageAccumulator(), fn, and InspectBlocks().
|
static |
Definition at line 2586 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 1618 of file ProjectFileIO.cpp.
References mFileName.
Referenced by ProjectFileManager::IsAlreadyOpen(), ContrastDialog::OnExport(), OpenConnection(), TimerRecordDialog::PopulateOrExchange(), and ProjectFileManager::SaveAs().
wxLongLong ProjectFileIO::GetFreeDiskSpace | ( | ) | const |
Definition at line 2440 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 2479 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by SaveProject().
int ProjectFileIO::GetLastErrorCode | ( | ) | const |
Definition at line 2489 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by CheckVersion().
const wxString & ProjectFileIO::GetLastLog | ( | ) | const |
Definition at line 2494 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by ShowError().
const TranslatableString & ProjectFileIO::GetLibraryError | ( | ) | const |
Definition at line 2484 of file ProjectFileIO.cpp.
References mpErrors.
Referenced by CheckVersion().
|
inline |
Definition at line 95 of file ProjectFileIO.h.
Referenced by ProjectWindow::OnProjectTitleChange().
int64_t ProjectFileIO::GetTotalUsage | ( | ) |
Definition at line 2573 of file ProjectFileIO.cpp.
References CurrConn(), and GetDiskUsage().
Referenced by ShouldCompact().
|
private |
Definition at line 742 of file ProjectFileIO.cpp.
References FromCharsResult::ec, FromChars(), and Query().
|
private |
Definition at line 728 of file ProjectFileIO.cpp.
References Query().
Referenced by CheckVersion(), LoadProject(), and WriteDoc().
bool ProjectFileIO::HadUnused | ( | ) |
Definition at line 1569 of file ProjectFileIO.cpp.
References mHadUnused.
Referenced by SetBypass().
|
overrideprivatevirtual |
Implements XMLTagHandler.
Definition at line 1730 of file ProjectFileIO.cpp.
References XMLMethodRegistry< Host >::CallObjectAccessor(), XMLMethodRegistry< Host >::Get(), mProject, and project.
|
overrideprivatevirtual |
Implements XMLTagHandler.
Definition at line 1651 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 479 of file ProjectFileIO.cpp.
References ConnectionPtr::Get(), and mProject.
|
static |
Definition at line 420 of file ProjectFileIO.cpp.
References SQLiteIniter::mRc.
Referenced by AudacityApp::OnInit0().
|
staticprivate |
Definition at line 855 of file ProjectFileIO.cpp.
References CommandLineArgs::argv.
Referenced by DeleteBlocks().
|
private |
Definition at line 829 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 2425 of file ProjectFileIO.cpp.
References mModified.
Referenced by Compact(), and anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord().
bool ProjectFileIO::IsRecovered | ( | ) | const |
Definition at line 2435 of file ProjectFileIO.cpp.
References mRecovered.
bool ProjectFileIO::IsTemporary | ( | ) | const |
Definition at line 2430 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 2042 of file ProjectFileIO.cpp.
References DB(), ProjectSerializer::Decode(), DeleteBlocks(), WaveTrackFactory::Get(), WaveTrackFactory::GetSampleBlockFactory(), GetValue(), mModified, mProject, mRecovered, mTemporary, OpenConnection(), SetError(), wxT(), and XO().
Definition at line 1342 of file ProjectFileIO.cpp.
References AuxiliaryFileSuffixes(), and RenameOrWarn().
Referenced by ProjectFileIO::BackupProject::BackupProject(), and SaveProject().
|
private |
Definition at line 1736 of file ProjectFileIO.cpp.
References CheckpointFailure, and Observer::Publisher< ProjectFileIOMessage >::Publish().
|
private |
Definition at line 524 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 2377 of file ProjectFileIO.cpp.
References OpenConnection().
|
delete |
|
private |
Definition at line 715 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 1379 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 1301 of file ProjectFileIO.cpp.
References BasicUI::MakeGenericProgress(), mProject, ProjectFramePlacement(), ShowError(), and XO().
Referenced by MoveProject().
bool ProjectFileIO::ReopenProject | ( | ) |
Definition at line 2414 of file ProjectFileIO.cpp.
References CloseConnection(), mFileName, and OpenConnection().
|
private |
Definition at line 648 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 1266 of file ProjectFileIO.cpp.
References AuxiliaryFileSuffixes(), fn, name, and wxT().
Referenced by ProjectFileIO::BackupProject::BackupProject().
|
private |
Definition at line 601 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 2371 of file ProjectFileIO.cpp.
References CopyTo(), TrackList::Get(), mProject, and XO().
Definition at line 2163 of file ProjectFileIO.cpp.
References AutoSaveDelete(), BasicUI::CallAfter(), CloseConnection(), CloseProject(), Compact(), CopyTo(), TrackList::Create(), DeleteBlocks(), GetLastError(), 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 2515 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 2507 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 2499 of file ProjectFileIO.cpp.
References CurrConn().
Referenced by CheckVersion(), LoadProject(), OpenConnection(), and SaveProject().
void ProjectFileIO::SetFileName | ( | const FilePath & | fileName | ) |
Definition at line 1623 of file ProjectFileIO.cpp.
References ActiveProjects::Add(), IsTemporary(), mFileName, mProject, project, ActiveProjects::Remove(), and SetProjectTitle().
Referenced by CloseConnection(), OpenConnection(), RestoreConnection(), SaveConnection(), and UseConnection().
void ProjectFileIO::SetProjectTitle | ( | int | number = -1 | ) |
Definition at line 1580 of file ProjectFileIO.cpp.
References _, _TS, BasicUI::CallAfter(), TranslatableString::empty(), mProject, mRecovered, mTitle, name, project, ProjectTitleChange, Verbatim(), wxT(), and XO().
Referenced by ProjectFileIO(), RefreshAllTitles(), SaveProject(), SetFileName(), and UpdatePrefs().
|
private |
Definition at line 1201 of file ProjectFileIO.cpp.
References BlockSpaceUsageAccumulator(), fn, GetTotalUsage(), 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 2467 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 1574 of file ProjectFileIO.cpp.
References SetProjectTitle().
bool ProjectFileIO::UpdateSaved | ( | const TrackList * | tracks = nullptr | ) |
Definition at line 2140 of file ProjectFileIO.cpp.
References AutoSaveDelete(), tracks, WriteDoc(), WriteXML(), and WriteXMLHeader().
Referenced by SaveProject().
|
private |
Definition at line 669 of file ProjectFileIO.cpp.
References CurrConn(), and SetFileName().
Referenced by SaveProject().
bool ProjectFileIO::WasCompacted | ( | ) |
Definition at line 1564 of file ProjectFileIO.cpp.
References mWasCompacted.
Referenced by SetBypass().
|
private |
Definition at line 1841 of file ProjectFileIO.cpp.
References ADD_EXCEPTION_CONTEXT, TransactionScope::Commit(), DB(), ProjectFormatExtensionsRegistry::Get(), ProjectSerializer::GetData(), ProjectSerializer::GetDict(), ProjectFormatExtensionsRegistry::GetRequiredVersion(), MemoryStream::GetSize(), GetValue(), mProject, SQLiteBlobStream::Open(), Query(), SetDBError(), and XO().
Referenced by AutoSave(), CopyTo(), and UpdateSaved().
|
private |
Definition at line 1758 of file ProjectFileIO.cpp.
References AUDACITY_FILE_FORMAT_VERSION, XMLMethodRegistry< Host >::CallWriters(), XMLWriter::EndTag(), XMLMethodRegistry< Host >::Get(), TrackList::Get(), mProject, XMLWriter::StartTag(), Track::SubstitutePendingChangedTrack(), tracks, XMLWriter::WriteAttr(), and wxT().
Referenced by AutoSave(), CopyTo(), GenerateDoc(), and UpdateSaved().
|
private |
Definition at line 1743 of file ProjectFileIO.cpp.
References XMLWriter::Write(), and wxT().
Referenced by AutoSave(), CopyTo(), GenerateDoc(), and UpdateSaved().
|
private |
Definition at line 317 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 332 of file ProjectFileIO.h.
Referenced by Compact(), HadUnused(), and ShouldCompact().
|
private |
Definition at line 323 of file ProjectFileIO.h.
Referenced by AutoSave(), AutoSaveDelete(), IsModified(), LoadProject(), ProjectFileIO(), and SaveProject().
|
private |
Definition at line 314 of file ProjectFileIO.h.
Referenced by GetLastError(), GetLastErrorCode(), GetLastLog(), GetLibraryError(), OpenConnection(), and SaveProject().
|
private |
Definition at line 334 of file ProjectFileIO.h.
Referenced by DiscardConnection(), ProjectFileIO(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 335 of file ProjectFileIO.h.
Referenced by DiscardConnection(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 336 of file ProjectFileIO.h.
Referenced by DiscardConnection(), RestoreConnection(), and SaveConnection().
|
private |
Definition at line 310 of file ProjectFileIO.h.
Referenced by CopyTo(), CurrConn(), GenerateDoc(), HandleXMLChild(), HandleXMLTag(), HasConnection(), LoadProject(), OpenConnection(), RenameOrWarn(), SaveCopy(), SaveProject(), SetFileName(), SetProjectTitle(), WriteDoc(), and WriteXML().
|
private |
Definition at line 320 of file ProjectFileIO.h.
Referenced by DeleteBlocks(), IsRecovered(), LoadProject(), ProjectFileIO(), SaveProject(), and SetProjectTitle().
|
private |
Definition at line 326 of file ProjectFileIO.h.
Referenced by IsTemporary(), LoadProject(), OpenConnection(), ProjectFileIO(), RestoreConnection(), SaveConnection(), and SaveProject().
|
private |
Definition at line 312 of file ProjectFileIO.h.
Referenced by SetProjectTitle().
|
private |
Definition at line 329 of file ProjectFileIO.h.
Referenced by Compact(), and WasCompacted().