Audacity  3.0.3
Classes | Macros | Functions | Variables
ProjectFileIO.cpp File Reference
#include "ProjectFileIO.h"
#include <atomic>
#include <sqlite3.h>
#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 "ProjectSerializer.h"
#include "ProjectWindows.h"
#include "SampleBlock.h"
#include "TempDirectory.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 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 39 of file ProjectFileIO.cpp.

◆ NO_SHM

#define NO_SHM

Definition at line 43 of file ProjectFileIO.cpp.

◆ PACK

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

Definition at line 55 of file ProjectFileIO.cpp.

Function Documentation

◆ ExecCallback()

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

Definition at line 510 of file ProjectFileIO.cpp.

511 {
512  auto &cb = *static_cast<const ProjectFileIO::ExecCB *>(data);
513  // Be careful not to throw anything across sqlite3's stack frames.
514  return GuardedCall<int>(
515  [&]{ return cb(cols, vals, names); },
516  MakeSimpleGuard( 1 )
517  );
518 }

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 216 of file ProjectFileIO.cpp.

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

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 60 of file ProjectFileIO.cpp.

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

◆ ProjectFileSchema

const char* ProjectFileSchema
static

Definition at line 85 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::InstallSchema().

◆ ProjectFileVersion

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

Definition at line 75 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 258 of file ProjectFileIO.cpp.

Referenced by ProjectFileIO::Get().

ProjectFileIO::ExecCB
std::function< int(int cols, char **vals, char **names)> ExecCB
Definition: ProjectFileIO.h:193
MakeSimpleGuard
SimpleGuard< R > MakeSimpleGuard(R value)
Convert a value to a handler function returning that value, suitable for GuardedCall<R>
Definition: AudacityException.h:167
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:265
names
static TranslatableStrings names
Definition: Tags.cpp:744
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
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: ProjectWindows.cpp:72
AllProjects
Definition: Project.h:35
ProjectFileIO::SetProjectTitle
void SetProjectTitle(int number=-1)
Definition: ProjectFileIO.cpp:1456