Audacity  3.0.3
Public Types | Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
AudacityProject Class Referencefinal

The top-level handle to an Audacity project. It serves as a source of events that other objects can bind to, and a container of associated sub-objects that it treats opaquely. It stores a filename and a status message and a few other things. There is very little in this class, most of the intelligence residing in the cooperating attached objects. More...

#include <Project.h>

Inheritance diagram for AudacityProject:
[legend]
Collaboration diagram for AudacityProject:
[legend]

Public Types

using AttachedObjects = ::AttachedProjectObjects
 
- Public Types inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >
using DataType = ClientData
 
using DataPointer = Pointer< ClientData >
 
using DataFactory = std::function< DataPointer(Host &) >
 Type of function from which RegisteredFactory is constructed; it builds attachments. More...
 

Public Member Functions

 AudacityProject ()
 
virtual ~AudacityProject ()
 
int GetProjectNumber ()
 
const wxString & GetProjectName () const
 
void SetProjectName (const wxString &name)
 
FilePath GetInitialImportPath () const
 
void SetInitialImportPath (const FilePath &path)
 
- Public Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >
 ~Site ()
 
 Site ()
 
 Site (const Site &other)
 
Siteoperator= (const Site &other)
 
 Site (Site &&other)
 
Siteoperator= (Site &&other)
 
size_t size () const
 How many attachment pointers are in the Site. More...
 
template<typename Subclass = ClientData>
Subclass & Get (const RegisteredFactory &key)
 Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More...
 
template<typename Subclass = const ClientData>
auto Get (const RegisteredFactory &key) const -> typename std::enable_if< std::is_const< Subclass >::value, Subclass & >::type
 Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More...
 
template<typename Subclass = ClientData>
Subclass * Find (const RegisteredFactory &key)
 Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More...
 
template<typename Subclass = const ClientData>
auto Find (const RegisteredFactory &key) const -> typename std::enable_if< std::is_const< Subclass >::value, Subclass * >::type
 Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More...
 
template<typename ReplacementPointer >
void Assign (const RegisteredFactory &key, ReplacementPointer &&replacement)
 Reassign Site's pointer to ClientData. More...
 

Public Attributes

bool mbBusyImporting { false }
 
int mBatchMode { 0 }
 

Private Attributes

wxString mName
 
int mProjectNo
 
FilePath mInitialImportPath
 

Static Private Attributes

static int mProjectCounter =0
 

Additional Inherited Members

- Static Public Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >
static size_t slots ()
 How many static factories have been registered with this specialization of Site. More...
 
- Protected Member Functions inherited from ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >
template<typename Function >
void ForEach (const Function &function)
 Invoke function on each ClientData object that has been created in this. More...
 
template<typename Function >
void ForEach (const Function &function) const
 Invoke function on each ClientData object that has been created in this. More...
 
template<typename Function >
ClientData * FindIf (const Function &function)
 Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More...
 
template<typename Function >
const ClientData * FindIf (const Function &function) const
 Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More...
 
void BuildAll ()
 For each RegisteredFactory, if the corresponding attachment is absent in this, build and store it. More...
 

Detailed Description

The top-level handle to an Audacity project. It serves as a source of events that other objects can bind to, and a container of associated sub-objects that it treats opaquely. It stores a filename and a status message and a few other things. There is very little in this class, most of the intelligence residing in the cooperating attached objects.

Definition at line 88 of file Project.h.

Member Typedef Documentation

◆ AttachedObjects

Definition at line 94 of file Project.h.

Constructor & Destructor Documentation

◆ AudacityProject()

AudacityProject::AudacityProject ( )

Definition at line 80 of file Project.cpp.

81 {
82  mProjectNo = mProjectCounter++; // Bug 322
84  // But not for the attached windows. They get built only on demand, such as
85  // from menu items.
86 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::BuildAll(), mProjectCounter, and mProjectNo.

Here is the call graph for this function:

◆ ~AudacityProject()

AudacityProject::~AudacityProject ( )
virtual

Definition at line 88 of file Project.cpp.

89 {
90 }

Member Function Documentation

◆ GetInitialImportPath()

FilePath AudacityProject::GetInitialImportPath ( ) const

Definition at line 102 of file Project.cpp.

103 {
104  return mInitialImportPath;
105 }

References mInitialImportPath.

◆ GetProjectName()

const wxString & AudacityProject::GetProjectName ( ) const

Definition at line 92 of file Project.cpp.

93 {
94  return mName;
95 }

References mName.

Referenced by anonymous_namespace{FileMenus.cpp}::DoExport(), Exporter::GetFilename(), ExportMultipleDialog::PopulateOrExchange(), MixerBoardFrame::SetWindowTitle(), and TitleRestorer::TitleRestorer().

Here is the caller graph for this function:

◆ GetProjectNumber()

int AudacityProject::GetProjectNumber ( )
inline

Definition at line 99 of file Project.h.

99 { return mProjectNo;}

Referenced by TitleRestorer::TitleRestorer().

Here is the caller graph for this function:

◆ SetInitialImportPath()

void AudacityProject::SetInitialImportPath ( const FilePath path)

Definition at line 107 of file Project.cpp.

108 {
109  if (mInitialImportPath.empty())
110  {
111  mInitialImportPath = path;
112  }
113 }

References mInitialImportPath.

Referenced by DoImportMIDI().

Here is the caller graph for this function:

◆ SetProjectName()

void AudacityProject::SetProjectName ( const wxString &  name)

Definition at line 97 of file Project.cpp.

98 {
99  mName = name;
100 }

References mName, and name.

Referenced by DoImportMIDI().

Here is the caller graph for this function:

Member Data Documentation

◆ mBatchMode

int AudacityProject::mBatchMode { 0 }

◆ mbBusyImporting

bool AudacityProject::mbBusyImporting { false }

Definition at line 128 of file Project.h.

Referenced by Importer::Import().

◆ mInitialImportPath

FilePath AudacityProject::mInitialImportPath
private

Definition at line 125 of file Project.h.

Referenced by GetInitialImportPath(), and SetInitialImportPath().

◆ mName

wxString AudacityProject::mName
private

Definition at line 120 of file Project.h.

Referenced by GetProjectName(), and SetProjectName().

◆ mProjectCounter

int AudacityProject::mProjectCounter =0
staticprivate

Definition at line 122 of file Project.h.

Referenced by AudacityProject().

◆ mProjectNo

int AudacityProject::mProjectNo
private

Definition at line 123 of file Project.h.

Referenced by AudacityProject().


The documentation for this class was generated from the following files:
AudacityProject::mProjectNo
int mProjectNo
Definition: Project.h:123
name
const TranslatableString name
Definition: Distortion.cpp:98
ClientData::Site::BuildAll
void BuildAll()
For each RegisteredFactory, if the corresponding attachment is absent in this, build and store it.
Definition: ClientData.h:441
AudacityProject::mName
wxString mName
Definition: Project.h:120
AudacityProject::mProjectCounter
static int mProjectCounter
Definition: Project.h:122
AudacityProject::mInitialImportPath
FilePath mInitialImportPath
Definition: Project.h:125