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.


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


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 22 of file ActiveProject.cpp.

24 return gActiveProject;
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()

void SetActiveProject ( AudacityProject project)

Definition at line 27 of file ActiveProject.cpp.

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 ) );
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:

Variable Documentation

◆ gActiveProject

std::weak_ptr<AudacityProject> gActiveProject

Definition at line 20 of file ActiveProject.cpp.

Referenced by GetActiveProject(), and SetActiveProject().