Audacity 3.2.0
Classes | Namespaces | Macros | Functions | Variables
ProjectFileIO.cpp File Reference
#include "ProjectFileIO.h"
#include <atomic>
#include <sqlite3.h>
#include <optional>
#include <cstring>
#include <wx/crt.h>
#include <wx/log.h>
#include <wx/sstream.h>
#include <wx/utils.h>
#include "ActiveProjects.h"
#include "CodeConversions.h"
#include "DBConnection.h"
#include "FileNames.h"
#include "PendingTracks.h"
#include "Project.h"
#include "ProjectFileIOExtension.h"
#include "ProjectHistory.h"
#include "ProjectSerializer.h"
#include "SampleBlock.h"
#include "TempDirectory.h"
#include "TransactionScope.h"
#include "WaveTrack.h"
#include "WaveTrackUtilities.h"
#include "BasicUI.h"
#include "wxFileNameWrapper.h"
#include "XMLFileReader.h"
#include "SentryHelper.h"
#include "MemoryX.h"
#include "ProjectFormatVersion.h"
#include "BufferedStreamReader.h"
#include "FromChars.h"
#include "sqlite/SQLiteUtils.h"
Include dependency graph for ProjectFileIO.cpp:

Go to the source code of this file.

Classes

class  SQLiteBlobStream
 
class  BufferedProjectBlobStream
 
struct  anonymous_namespace{ProjectFileIO.cpp}::ContextData
 

Namespaces

namespace  anonymous_namespace{ProjectFileIO.cpp}
 

Macros

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

Functions

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

Variables

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

◆ AUDACITY_FILE_FORMAT_VERSION

#define AUDACITY_FILE_FORMAT_VERSION   "1.3.0"

Definition at line 54 of file ProjectFileIO.cpp.

◆ PACK

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

Definition at line 66 of file ProjectFileIO.cpp.

Function Documentation

◆ ExecCallback()

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

Definition at line 641 of file ProjectFileIO.cpp.

642{
643 auto &cb = *static_cast<const ProjectFileIO::ExecCB *>(data);
644 // Be careful not to throw anything across sqlite3's stack frames.
645 return GuardedCall<int>(
646 [&]{ return cb(cols, vals, names); },
647 MakeSimpleGuard( 1 )
648 );
649}
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:153
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:

Variable Documentation

◆ ProjectFileID

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

Definition at line 71 of file ProjectFileIO.cpp.

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

◆ ProjectFileSchema

const char* ProjectFileSchema
static

Definition at line 97 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::InstallSchema().

◆ scope

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

Install the callback from undo manager.

Definition at line 2661 of file ProjectFileIO.cpp.

◆ sFileIOKey

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

Definition at line 389 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::Get().