Audacity  3.0.3
Functions | Variables
Project.cpp File Reference
#include "Project.h"
#include "KeyboardCapture.h"
#include "TempDirectory.h"
#include "./widgets/ErrorDialog.h"
#include <wx/display.h>
#include <wx/filename.h>
#include <wx/frame.h>
Include dependency graph for Project.cpp:

Go to the source code of this file.

Functions

 wxDEFINE_EVENT (EVT_TRACK_PANEL_TIMER, wxCommandEvent)
 
 wxDEFINE_EVENT (EVT_PROJECT_ACTIVATION, wxCommandEvent)
 
AUDACITY_DLL_API AudacityProjectGetActiveProject ()
 
void SetActiveProject (AudacityProject *project)
 
AUDACITY_DLL_API wxFrame & GetProjectFrame (AudacityProject &project)
 Get the top-level window associated with the project (as a wxFrame only, when you do not need to use the subclass ProjectWindow) More...
 
AUDACITY_DLL_API const wxFrame & GetProjectFrame (const AudacityProject &project)
 
AUDACITY_DLL_API wxWindow & GetProjectPanel (AudacityProject &project)
 Get the main sub-window of the project frame that displays track data. More...
 
AUDACITY_DLL_API const wxWindow & GetProjectPanel (const AudacityProject &project)
 

Variables

static AudacityProjectgActiveProject
 

Function Documentation

◆ GetActiveProject()

AUDACITY_DLL_API AudacityProject* GetActiveProject ( )

Definition at line 107 of file Project.cpp.

108 {
109  return gActiveProject;
110 }

References gActiveProject.

Referenced by TimeTrack::Clear(), EVT_MENU_RANGE(), ExecCommand(), AudacityApp::InitPart2(), InstallHandlers::InstallHandlers(), ProjectManager::OnCloseWindow(), AudacityApp::OnExceptionInMainLoop(), NyqBench::OnGo(), AudacityApp::OnKeyDown(), CommandHandler::OnReceiveCommand(), NyqBench::OnRunUpdate(), AudacityApp::OnTimer(), TimeTrack::Paste(), and ZoomInfo::SetZoom().

Here is the caller graph for this function:

◆ GetProjectFrame() [1/2]

AUDACITY_DLL_API wxFrame& GetProjectFrame ( AudacityProject project)

Get the top-level window associated with the project (as a wxFrame only, when you do not need to use the subclass ProjectWindow)

Definition at line 186 of file Project.cpp.

187 {
188  auto ptr = project.GetFrame();
189  if ( !ptr )
191  return *ptr;
192 }

References AudacityProject::GetFrame(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by DragCommand::Apply(), SetProjectCommand::Apply(), AllProjects::Close(), MenuCreator::CreateMenusAndCommands(), ToolManager::CreateWindows(), LabelTrackView::DialogForLabelName(), Exporter::DoEditMetadata(), SplashDialog::DoHelpWelcome(), DoImportMIDIProject(), SelectUtilities::DoListSelection(), anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu(), ToolManager::DoneDragging(), ProjectAudioManager::DoRecord(), DoReloadPreferences(), ProjectFileManager::DoSave(), anonymous_namespace{ExtraMenus.cpp}::ExtraMiscItems(), FindProjectFrame(), GetNextWindowPlacement(), MenuManager::GetUpdateFlags(), AUPImportFileHandle::HandleNoteTrack(), AUPImportFileHandle::HandleProject(), AUPImportFileHandle::HandleTimeTrack(), ProjectFileIO::HandleXMLTag(), ProjectFileManager::Import(), AUPImportFileHandle::Import(), InstallHandlers::InstallHandlers(), HelpActions::Handler::OnAbout(), ProjectAudioManager::OnAudioIOStopRecording(), PluginActions::Handler::OnBenchmark(), FileActions::Handler::OnExportLabels(), FileActions::Handler::OnExportMIDI(), ExtraActions::Handler::OnFullScreen(), ToolManager::OnGrabber(), ProjectWindow::OnIconize(), TrackPanel::OnIdle(), FileActions::Handler::OnImportMIDI(), HelpActions::Handler::OnManual(), ToolManager::OnMouse(), NavigationActions::Handler::OnNextWindow(), ProjectManager::OnOpenAudioFile(), FileActions::Handler::OnPageSetup(), EditActions::Handler::OnPreferences(), NavigationActions::Handler::OnPrevWindow(), FileActions::Handler::OnPrint(), HelpActions::Handler::OnQuickFix(), HelpActions::Handler::OnQuickHelp(), SelectActions::Handler::OnSetLeftSelection(), TrackMenuTable::OnSetName(), SelectActions::Handler::OnSetRightSelection(), TransportActions::Handler::OnSoundActivated(), AudacityApp::OnTimer(), AUPImportFileHandle::Open(), ProjectAudioManager::PlayPlayRegion(), ScreenshotBigDialog::PopulateOrExchange(), ProjectFileManager::ReadProjectFile(), MenuCreator::RebuildAllMenuBars(), MenuCreator::RebuildMenuBar(), RefreshAllTitles(), ProjectFileIO::RenameOrWarn(), ProjectFileManager::SaveAs(), ProjectFileManager::SaveCopy(), GetInfoCommand::SendBoxes(), GetInfoCommand::SendMenus(), GetInfoCommand::SendPreferences(), LabelTrackView::ShowContextMenu(), anonymous_namespace{HelpMenus.cpp}::ShowDiagnostics(), ScreenshotBigDialog::SizeMainWindow(), ToolManager::Updated(), and ProjectManager::ProjectChooser::~ProjectChooser().

Here is the call graph for this function:

◆ GetProjectFrame() [2/2]

AUDACITY_DLL_API const wxFrame& GetProjectFrame ( const AudacityProject project)

Definition at line 194 of file Project.cpp.

195 {
196  auto ptr = project.GetFrame();
197  if ( !ptr )
199  return *ptr;
200 }

References AudacityProject::GetFrame(), and THROW_INCONSISTENCY_EXCEPTION.

Here is the call graph for this function:

◆ GetProjectPanel() [1/2]

AUDACITY_DLL_API wxWindow& GetProjectPanel ( AudacityProject project)

Get the main sub-window of the project frame that displays track data.

Definition at line 202 of file Project.cpp.

203 {
204  auto ptr = project.GetPanel();
205  if ( !ptr )
207  return *ptr;
208 }

References AudacityProject::GetPanel(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by AdornedRulerPanel::CreateOverlays(), ProjectWindow::DoScroll(), AdornedRulerPanel::DrawBothOverlays(), ProjectWindow::FixScrollbars(), ProjectWindow::OnActivate(), ProjectWindow::PlaybackScroller::OnTimer(), ScrubbingOverlay::OnTimer(), ProjectWindow::RedrawProject(), ProjectWindow::ScrollIntoView(), ProjectWindow::UpdateLayout(), and ProjectWindow::ZoomAfterImport().

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

◆ GetProjectPanel() [2/2]

AUDACITY_DLL_API const wxWindow& GetProjectPanel ( const AudacityProject project)

Definition at line 210 of file Project.cpp.

212 {
213  auto ptr = project.GetPanel();
214  if ( !ptr )
216  return *ptr;
217 }

References AudacityProject::GetPanel(), and THROW_INCONSISTENCY_EXCEPTION.

Here is the call graph for this function:

◆ SetActiveProject()

void SetActiveProject ( AudacityProject project)

Definition at line 112 of file Project.cpp.

113 {
114  if ( gActiveProject != project ) {
115  gActiveProject = project;
116  KeyboardCapture::Capture( nullptr );
117  wxTheApp->QueueEvent( safenew wxCommandEvent{ EVT_PROJECT_ACTIVATION } );
118  }
119  wxTheApp->SetTopWindow( FindProjectFrame( project ) );
120 }

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

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:

◆ wxDEFINE_EVENT() [1/2]

wxDEFINE_EVENT ( EVT_PROJECT_ACTIVATION  ,
wxCommandEvent   
)

◆ wxDEFINE_EVENT() [2/2]

wxDEFINE_EVENT ( EVT_TRACK_PANEL_TIMER  ,
wxCommandEvent   
)

Variable Documentation

◆ gActiveProject

AudacityProject* gActiveProject
static

Definition at line 103 of file Project.cpp.

Referenced by GetActiveProject(), and SetActiveProject().

AudacityProject::GetPanel
wxWindow * GetPanel()
Definition: Project.h:124
gActiveProject
static AudacityProject * gActiveProject
Definition: Project.cpp:103
AudacityProject::GetFrame
wxFrame * GetFrame()
Definition: Project.h:120
FindProjectFrame
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null.
Definition: Project.h:172
KeyboardCapture::Capture
void Capture(wxWindow *handler)
Definition: KeyboardCapture.cpp:69
THROW_INCONSISTENCY_EXCEPTION
#define THROW_INCONSISTENCY_EXCEPTION
Throw InconsistencyException, using C++ preprocessor to identify the source code location.
Definition: InconsistencyException.h:79
safenew
#define safenew
Definition: MemoryX.h:10