Audacity 3.2.0
Classes | Macros | Functions | Variables
ProjectFileIO.cpp File Reference
#include "ProjectFileIO.h"
#include <atomic>
#include <sqlite3.h>
#include <optional>
#include <cstring>
#include <wx/app.h>
#include <wx/crt.h>
#include <wx/frame.h>
#include <wx/log.h>
#include <wx/sstream.h>
#include "ActiveProjects.h"
#include "CodeConversions.h"
#include "DBConnection.h"
#include "Project.h"
#include "ProjectHistory.h"
#include "ProjectSerializer.h"
#include "ProjectWindows.h"
#include "SampleBlock.h"
#include "TempDirectory.h"
#include "TransactionScope.h"
#include "WaveTrack.h"
#include "widgets/AudacityMessageBox.h"
#include "BasicUI.h"
#include "widgets/ProgressDialog.h"
#include "wxFileNameWrapper.h"
#include "XMLFileReader.h"
#include "SentryHelper.h"
#include "MemoryX.h"
#include "ProjectFormatExtensionsRegistry.h"
#include "BufferedStreamReader.h"
#include "FromChars.h"
Include dependency graph for ProjectFileIO.cpp:

Go to the source code of this file.


class  SQLiteIniter
class  SQLiteBlobStream
class  BufferedProjectBlobStream


#define PACK(b1, b2, b3, b4)   ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4)


static void RefreshAllTitles (bool bShowProjectNumbers)
static int ExecCallback (void *data, int cols, char **vals, char **names)


static const int ProjectFileID = PACK('A', 'U', 'D', 'Y')
static const char * ProjectFileSchema
static const AudacityProject::AttachedObjects::RegisteredFactory sFileIOKey
static ProjectHistory::AutoSave::Scope scope
 Install the callback from undo manager. More...

Macro Definition Documentation



Definition at line 50 of file ProjectFileIO.cpp.


#define PACK (   b1,
)    ((b1 << 24) | (b2 << 16) | (b3 << 8) | b4)

Definition at line 62 of file ProjectFileIO.cpp.

Function Documentation

◆ ExecCallback()

static int ExecCallback ( void *  data,
int  cols,
char **  vals,
char **  names 

Definition at line 722 of file ProjectFileIO.cpp.

724 auto &cb = *static_cast<const ProjectFileIO::ExecCB *>(data);
725 // Be careful not to throw anything across sqlite3's stack frames.
726 return GuardedCall<int>(
727 [&]{ return cb(cols, vals, names); },
728 MakeSimpleGuard( 1 )
729 );
SimpleGuard< R > MakeSimpleGuard(R value) noexcept(noexcept(SimpleGuard< R >{ value }))
Convert a value to a handler function returning that value, suitable for GuardedCall<R>
static TranslatableStrings names
Definition: TagsEditor.cpp:152
std::function< int(int cols, char **vals, char **names)> ExecCB

References MakeSimpleGuard(), and names.

Referenced by ProjectFileIO::Exec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RefreshAllTitles()

static void RefreshAllTitles ( bool  bShowProjectNumbers)

Definition at line 428 of file ProjectFileIO.cpp.

430 for ( auto pProject : AllProjects{} ) {
431 if ( !GetProjectFrame( *pProject ).IsIconized() ) {
433 bShowProjectNumbers ? pProject->GetProjectNumber() : -1 );
434 }
435 }
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
void SetProjectTitle(int number=-1)
static ProjectFileIO & Get(AudacityProject &project)

References ProjectFileIO::Get(), GetProjectFrame(), and ProjectFileIO::SetProjectTitle().

Referenced by TitleRestorer::TitleRestorer(), and TitleRestorer::~TitleRestorer().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ProjectFileID

const int ProjectFileID = PACK('A', 'U', 'D', 'Y')

Definition at line 67 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::CheckVersion(), and ProjectFileIO::InstallSchema().

◆ ProjectFileSchema

const char* ProjectFileSchema

Definition at line 93 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::InstallSchema().

◆ scope

ProjectHistory::AutoSave::Scope scope
Initial value:
[](AudacityProject &project) {
auto &projectFileIO = ProjectFileIO::Get(project);
if ( !projectFileIO.AutoSave() )
XO("Automatic database backup failed."),
} }
@ Internal
Indicates internal failure from Audacity.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A MessageBoxException that shows a given, unvarying string.

Install the callback from undo manager.

Definition at line 2705 of file ProjectFileIO.cpp.

◆ sFileIOKey

Initial value:
[]( AudacityProject &parent ){
auto result = std::make_shared< ProjectFileIO >( parent );
return result;

Definition at line 470 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::Get().