Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
InvisibleTemporaryProject Class Reference

Makes a temporary project that doesn't display on the screen. More...

#include <ProjectFileIO.h>

Collaboration diagram for InvisibleTemporaryProject:
[legend]

Public Member Functions

 InvisibleTemporaryProject ()
 
 ~InvisibleTemporaryProject ()
 
AudacityProjectProject ()
 

Private Attributes

std::shared_ptr< AudacityProjectmpProject
 

Detailed Description

Makes a temporary project that doesn't display on the screen.

Definition at line 330 of file ProjectFileIO.h.

Constructor & Destructor Documentation

◆ InvisibleTemporaryProject()

InvisibleTemporaryProject::InvisibleTemporaryProject ( )

Definition at line 2679 of file ProjectFileIO.cpp.

2680  : mpProject{ std::make_shared< AudacityProject >() }
2681 {
2682 }

◆ ~InvisibleTemporaryProject()

InvisibleTemporaryProject::~InvisibleTemporaryProject ( )

Definition at line 2684 of file ProjectFileIO.cpp.

2685 {
2686  auto &projectFileIO = ProjectFileIO::Get( Project() );
2687  projectFileIO.SetBypass();
2688  auto &tracks = TrackList::Get( Project() );
2689  tracks.Clear();
2690 
2691  // Consume some delayed track list related events before destroying the
2692  // temporary project
2693  try { wxTheApp->Yield(); } catch(...) {}
2694 
2695  // Destroy the project and yield again to let delayed window deletions happen
2696  projectFileIO.CloseProject();
2697  mpProject.reset();
2698  try { wxTheApp->Yield(); } catch(...) {}
2699 }

References ProjectFileIO::Get(), TrackList::Get(), mpProject, and Project().

Here is the call graph for this function:

Member Function Documentation

◆ Project()

AudacityProject& InvisibleTemporaryProject::Project ( )
inline

Definition at line 335 of file ProjectFileIO.h.

336  {
337  return *mpProject;
338  }

Referenced by ProjectFileManager::DiscardAutosave(), anonymous_namespace{ProjectFileManager.cpp}::ImportProject(), and ~InvisibleTemporaryProject().

Here is the caller graph for this function:

Member Data Documentation

◆ mpProject

std::shared_ptr<AudacityProject> InvisibleTemporaryProject::mpProject
private

Definition at line 340 of file ProjectFileIO.h.

Referenced by ~InvisibleTemporaryProject().


The documentation for this class was generated from the following files:
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:268
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:495
InvisibleTemporaryProject::Project
AudacityProject & Project()
Definition: ProjectFileIO.h:335
InvisibleTemporaryProject::mpProject
std::shared_ptr< AudacityProject > mpProject
Definition: ProjectFileIO.h:340