Audacity  3.0.3
Classes | Macros | Functions | Variables
ProjectFileIO.cpp File Reference
#include "ProjectFileIO.h"
#include <atomic>
#include <sqlite3.h>
#include <wx/crt.h>
#include <wx/frame.h>
#include <wx/progdlg.h>
#include <wx/sstream.h>
#include <wx/xml/xml.h>
#include "ActiveProjects.h"
#include "DBConnection.h"
#include "Project.h"
#include "ProjectFileIORegistry.h"
#include "ProjectSerializer.h"
#include "ProjectSettings.h"
#include "SampleBlock.h"
#include "Tags.h"
#include "TempDirectory.h"
#include "ViewInfo.h"
#include "WaveTrack.h"
#include "widgets/AudacityMessageBox.h"
#include "widgets/ErrorDialog.h"
#include "widgets/NumericTextCtrl.h"
#include "widgets/ProgressDialog.h"
#include "wxFileNameWrapper.h"
#include "xml/XMLFileReader.h"
#include "SentryHelper.h"
Include dependency graph for ProjectFileIO.cpp:

Go to the source code of this file.

Classes

class  SQLiteIniter
 

Macros

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

Functions

 wxDEFINE_EVENT (EVT_PROJECT_TITLE_CHANGE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_CHECKPOINT_FAILURE, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_RECONNECTION_FAILURE, wxCommandEvent)
 
static void RefreshAllTitles (bool bShowProjectNumbers)
 
static int ExecCallback (void *data, int cols, char **vals, char **names)
 

Variables

static const int ProjectFileID = PACK('A', 'U', 'D', 'Y')
 
static const int ProjectFileVersion = PACK(3, 0, 0, 0)
 
static const char * ProjectFileSchema
 
static const AudacityProject::AttachedObjects::RegisteredFactory sFileIOKey
 

Macro Definition Documentation

◆ AUDACITY_FILE_FORMAT_VERSION

#define AUDACITY_FILE_FORMAT_VERSION   "1.3.0"

Definition at line 42 of file ProjectFileIO.cpp.

◆ NO_SHM

#define NO_SHM

Definition at line 46 of file ProjectFileIO.cpp.

◆ PACK

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

Definition at line 58 of file ProjectFileIO.cpp.

Function Documentation

◆ ExecCallback()

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

Definition at line 495 of file ProjectFileIO.cpp.

496 {
497  auto &cb = *static_cast<const ProjectFileIO::ExecCB *>(data);
498  // Be careful not to throw anything across sqlite3's stack frames.
499  return GuardedCall<int>(
500  [&]{ return cb(cols, vals, names); },
501  MakeSimpleGuard( 1 )
502  );
503 }

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)
static

Definition at line 219 of file ProjectFileIO.cpp.

220 {
221  for ( auto pProject : AllProjects{} ) {
222  if ( !GetProjectFrame( *pProject ).IsIconized() ) {
223  ProjectFileIO::Get( *pProject ).SetProjectTitle(
224  bShowProjectNumbers ? pProject->GetProjectNumber() : -1 );
225  }
226  }
227 }

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:

◆ wxDEFINE_EVENT() [1/3]

wxDEFINE_EVENT ( EVT_CHECKPOINT_FAILURE  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [2/3]

wxDEFINE_EVENT ( EVT_PROJECT_TITLE_CHANGE  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [3/3]

wxDEFINE_EVENT ( EVT_RECONNECTION_FAILURE  ,
wxCommandEvent   
)

Variable Documentation

◆ ProjectFileID

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

Definition at line 63 of file ProjectFileIO.cpp.

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

◆ ProjectFileSchema

const char* ProjectFileSchema
static

Definition at line 88 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::InstallSchema().

◆ ProjectFileVersion

const int ProjectFileVersion = PACK(3, 0, 0, 0)
static

Definition at line 78 of file ProjectFileIO.cpp.

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

◆ sFileIOKey

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

Definition at line 261 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::Get().

ProjectFileIO::ExecCB
std::function< int(int cols, char **vals, char **names)> ExecCB
Definition: ProjectFileIO.h:191
MakeSimpleGuard
SimpleGuard< R > MakeSimpleGuard(R value)
Convert a value to a handler function returning that value, suitable for GuardedCall<R>
Definition: AudacityException.h:163
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:268
GetProjectFrame
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 ...
Definition: Project.cpp:186
names
static TranslatableStrings names
Definition: Tags.cpp:743
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
AllProjects
an object of class AllProjects acts like a standard library container, but refers to a global array o...
Definition: Project.h:38
ProjectFileIO::SetProjectTitle
void SetProjectTitle(int number=-1)
Definition: ProjectFileIO.cpp:1445