Audacity 3.2.0
Functions
ActiveProject.h File Reference

Handle changing of active project and keep global project pointer. More...

#include <wx/event.h>
#include <memory>
Include dependency graph for ActiveProject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AUDACITY_DLL_API std::weak_ptr< AudacityProjectGetActiveProject ()
 
AUDACITY_DLL_API void SetActiveProject (AudacityProject *project)
 

Detailed Description

Handle changing of active project and keep global project pointer.


Audacity: A Digital Audio Editor

Paul Licameli split from Project.h

Definition in file ActiveProject.h.

Function Documentation

◆ GetActiveProject()

AUDACITY_DLL_API std::weak_ptr< AudacityProject > GetActiveProject ( )

Definition at line 22 of file ActiveProject.cpp.

23{
24 return gActiveProject;
25}
static std::weak_ptr< AudacityProject > gActiveProject

References gActiveProject.

Referenced by EVT_MENU_RANGE(), ExecCommand(), AudacityApp::InitPart2(), ProjectManager::OnCloseWindow(), AudacityApp::OnExceptionInMainLoop(), NyqBench::OnGo(), AudacityApp::OnKeyDown(), CommandHandler::OnReceiveCommand(), NyqBench::OnRunUpdate(), and AudacityApp::OnTimer().

Here is the caller graph for this function:

◆ SetActiveProject()

AUDACITY_DLL_API void SetActiveProject ( AudacityProject project)

Definition at line 27 of file ActiveProject.cpp.

28{
29 auto pProject = project ? project->shared_from_this() : nullptr;
30 if ( gActiveProject.lock() != pProject ) {
31 gActiveProject = pProject;
32 KeyboardCapture::Capture( nullptr );
33 }
34 wxTheApp->SetTopWindow( FindProjectFrame( project ) );
35}
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
const auto project
void Capture(wxWindow *handler)

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

Referenced by ProjectManager::New(), ProjectWindow::OnActivate(), ProjectManager::OnCloseWindow(), and ProjectWindow::OnMouseEvent().

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