Audacity 3.2.0
Functions | Variables
ActiveProject.cpp File Reference
#include "ActiveProject.h"
#include "KeyboardCapture.h"
#include "Project.h"
#include "ProjectWindows.h"
#include <wx/app.h>
#include <wx/frame.h>
Include dependency graph for ActiveProject.cpp:

Go to the source code of this file.

Functions

 wxDEFINE_EVENT (EVT_PROJECT_ACTIVATION, wxCommandEvent)
 
AUDACITY_DLL_API std::weak_ptr< AudacityProjectGetActiveProject ()
 
void SetActiveProject (AudacityProject *project)
 

Variables

static std::weak_ptr< AudacityProjectgActiveProject
 

Detailed Description


Audacity: A Digital Audio Editor

Paul Licameli split from Project.cpp

Definition in file ActiveProject.cpp.

Function Documentation

◆ GetActiveProject()

AUDACITY_DLL_API std::weak_ptr< AudacityProject > GetActiveProject ( )

Definition at line 24 of file ActiveProject.cpp.

25{
26 return gActiveProject;
27}
static std::weak_ptr< AudacityProject > gActiveProject

References gActiveProject.

Referenced by EVT_MENU_RANGE(), ExecCommand(), anonymous_namespace{TimeTrack.cpp}::GetRate(), AudacityApp::InitPart2(), ProjectManager::OnCloseWindow(), AudacityApp::OnExceptionInMainLoop(), NyqBench::OnGo(), AudacityApp::OnKeyDown(), CommandHandler::OnReceiveCommand(), NyqBench::OnRunUpdate(), AudacityApp::OnTimer(), ZoomInfo::SetZoom(), and anonymous_namespace{WindowMenus.cpp}::WindowMenu().

Here is the caller graph for this function:

◆ SetActiveProject()

void SetActiveProject ( AudacityProject project)

Definition at line 29 of file ActiveProject.cpp.

30{
31 auto pProject = project ? project->shared_from_this() : nullptr;
32 if ( gActiveProject.lock() != pProject ) {
33 gActiveProject = pProject;
34 KeyboardCapture::Capture( nullptr );
35 wxTheApp->QueueEvent( safenew wxCommandEvent{ EVT_PROJECT_ACTIVATION } );
36 }
37 wxTheApp->SetTopWindow( FindProjectFrame( project ) );
38}
#define safenew
Definition: MemoryX.h:10
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
void Capture(wxWindow *handler)

References KeyboardCapture::Capture(), FindProjectFrame(), gActiveProject, and safenew.

Referenced by ProjectManager::New(), ProjectWindow::OnActivate(), ProjectManager::OnCloseWindow(), ProjectWindow::OnMouseEvent(), and anonymous_namespace{WindowMenus.cpp}::OnWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wxDEFINE_EVENT()

wxDEFINE_EVENT ( EVT_PROJECT_ACTIVATION  ,
wxCommandEvent   
)

Variable Documentation

◆ gActiveProject

std::weak_ptr<AudacityProject> gActiveProject
static

Definition at line 22 of file ActiveProject.cpp.

Referenced by GetActiveProject(), and SetActiveProject().