Audacity 3.2.0
Classes | Namespaces | Functions
ProjectWindows.h File Reference

accessors for certain important windows associated with each project More...

#include "ClientData.h"
Include dependency graph for ProjectWindows.h:

Go to the source code of this file.

Classes

class  AttachedWindows
 

Namespaces

namespace  BasicUI
 

Functions

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 wxFrame * FindProjectFrame (AudacityProject *project)
 Get a pointer to the window associated with a project, or null if the given pointer is null, or the window was not yet set. More...
 
AUDACITY_DLL_API const wxFrame * FindProjectFrame (const AudacityProject *project)
 Get a pointer to the window associated with a project, or null if the given pointer is null, or the window was not yet set. More...
 
AUDACITY_DLL_API std::unique_ptr< const BasicUI::WindowPlacementProjectFramePlacement (AudacityProject *project)
 Make a WindowPlacement object suitable for project (which may be null) More...
 
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)
 
AUDACITY_DLL_API void SetProjectPanel (AudacityProject &project, wxWindow &panel)
 
AUDACITY_DLL_API void SetProjectFrame (AudacityProject &project, wxFrame &frame)
 
AUDACITY_DLL_API AttachedWindowsGetAttachedWindows (AudacityProject &project)
 

Detailed Description

accessors for certain important windows associated with each project


Audacity: A Digital Audio Editor

Paul Licameli split from Project.h

Definition in file ProjectWindows.h.

Function Documentation

◆ FindProjectFrame() [1/2]

AUDACITY_DLL_API wxFrame * FindProjectFrame ( AudacityProject project)

Get a pointer to the window associated with a project, or null if the given pointer is null, or the window was not yet set.

Definition at line 88 of file ProjectWindows.cpp.

88 {
89 if (!project)
90 return nullptr;
91 return ProjectWindows::Get(*project).mFrame;
92}
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26

References BasicUI::Get().

Referenced by Exporter::DisplayOptions(), ToolManager::FilterEvent(), CommandManager::FilterKeyEvent(), anonymous_namespace{WaveTrackControls.cpp}::GainSliderDrawFunction(), AudacityApp::InitPart2(), NotMinimizedFlag(), Exporter::OnHelp(), MeterPanel::OnPreferences(), anonymous_namespace{WaveTrackControls.cpp}::PanSliderDrawFunction(), SetActiveProject(), ProjectFileIO::SetProjectTitle(), and ShowDependencyDialogIfNeeded().

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

◆ FindProjectFrame() [2/2]

AUDACITY_DLL_API const wxFrame * FindProjectFrame ( const AudacityProject project)

Get a pointer to the window associated with a project, or null if the given pointer is null, or the window was not yet set.

Definition at line 94 of file ProjectWindows.cpp.

94 {
95 if (!project)
96 return nullptr;
97 return ProjectWindows::Get(*project).mFrame;
98}

References BasicUI::Get().

Here is the call graph for this function:

◆ GetAttachedWindows()

AUDACITY_DLL_API AttachedWindows & GetAttachedWindows ( AudacityProject project)

Definition at line 114 of file ProjectWindows.cpp.

115{
116 return ProjectWindows::Get(project).mAttachedWindows;
117}

References BasicUI::Get().

Referenced by AdornedRulerPanel::Destroy(), TrackPanel::Destroy(), ProjectWindow::Find(), AdornedRulerPanel::Get(), ProjectWindow::Get(), TrackPanel::Get(), PluginActions::Handler::OnApplyMacrosPalette(), anonymous_namespace{Contrast.cpp}::Handler::OnContrast(), anonymous_namespace{HistoryWindow.cpp}::Handler::OnHistory(), anonymous_namespace{LyricsWindow.cpp}::Handler::OnKaraoke(), PluginActions::Handler::OnManageMacros(), anonymous_namespace{MixerBoard.cpp}::Handler::OnMixerBoard(), and anonymous_namespace{FreqWindow.cpp}::Handler::OnPlotSpectrum().

Here is the call graph for this function:
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 72 of file ProjectWindows.cpp.

73{
74 auto ptr = ProjectWindows::Get(project).mFrame;
75 if ( !ptr )
77 return *ptr;
78}
#define THROW_INCONSISTENCY_EXCEPTION
Throw InconsistencyException, using C++ preprocessor to identify the source code location.

References BasicUI::Get(), and THROW_INCONSISTENCY_EXCEPTION.

Referenced by DragCommand::Apply(), SetProjectCommand::Apply(), CloseAllProjects(), MenuCreator::CreateMenusAndCommands(), ToolManager::CreateWindows(), LabelTrackView::DialogForLabelName(), Exporter::DoEditMetadata(), SplashDialog::DoHelpWelcome(), DoImportMIDIProject(), SelectUtilities::DoListSelection(), anonymous_namespace{WindowMenus.cpp}::DoMacMinimize(), anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu(), ToolManager::DoneDragging(), DoReloadPreferences(), ProjectFileManager::DoSave(), anonymous_namespace{ExtraMenus.cpp}::ExtraMiscItems(), GetNextWindowPlacement(), MenuManager::GetUpdateFlags(), AUPImportFileHandle::HandleNoteTrack(), AUPImportFileHandle::HandleProject(), AUPImportFileHandle::HandleTimeTrack(), AUPImportFileHandle::Import(), HelpActions::Handler::OnAbout(), PluginActions::Handler::OnBenchmark(), FileActions::Handler::OnExportLabels(), FileActions::Handler::OnExportMIDI(), ExtraActions::Handler::OnFullScreen(), ToolManager::OnGrabber(), ProjectWindow::OnIconize(), TrackPanel::OnIdle(), FileActions::Handler::OnImportMIDI(), WindowActions::Handler::OnMacBringAllToFront(), WindowActions::Handler::OnMacZoom(), HelpActions::Handler::OnManual(), AudioSetupToolBar::OnMenu(), 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(), TrackMenuTable::OnSetName(), SelectUtilities::OnSetRegion(), TransportActions::Handler::OnSoundActivated(), AudacityApp::OnTimer(), AUPImportFileHandle::Open(), ProjectAudioManager::PlayPlayRegion(), ScreenshotBigDialog::PopulateOrExchange(), ProjectFramePlacement(), ProjectFileManager::ReadProjectFile(), MenuCreator::RebuildAllMenuBars(), MenuCreator::RebuildMenuBar(), RefreshAllTitles(), ProjectFileManager::SaveAs(), ProjectFileManager::SaveCopy(), GetInfoCommand::SendBoxes(), GetInfoCommand::SendMenus(), GetInfoCommand::SendPreferences(), LabelTrackView::ShowContextMenu(), ShowDiagnostics(), ScreenshotBigDialog::SizeMainWindow(), WaveTrackAffordanceControls::StartEditClipName(), 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 80 of file ProjectWindows.cpp.

81{
82 auto ptr = ProjectWindows::Get(project).mFrame;
83 if ( !ptr )
85 return *ptr;
86}

References BasicUI::Get(), 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 49 of file ProjectWindows.cpp.

50{
51 auto ptr = ProjectWindows::Get(project).mPanel;
52 if ( !ptr )
54 return *ptr;
55}

References BasicUI::Get(), 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 57 of file ProjectWindows.cpp.

59{
60 auto ptr = ProjectWindows::Get(project).mPanel;
61 if ( !ptr )
63 return *ptr;
64}

References BasicUI::Get(), and THROW_INCONSISTENCY_EXCEPTION.

Here is the call graph for this function:

◆ ProjectFramePlacement()

AUDACITY_DLL_API std::unique_ptr< const BasicUI::WindowPlacement > ProjectFramePlacement ( AudacityProject project)

Make a WindowPlacement object suitable for project (which may be null)

Postcondition
return value is not null

Definition at line 101 of file ProjectWindows.cpp.

102{
103 if (!project)
104 return std::make_unique<BasicUI::WindowPlacement>();
105 return std::make_unique<wxWidgetsWindowPlacement>(
106 &GetProjectFrame(*project));
107}
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 ...

References GetProjectFrame().

Referenced by ProjectAudioManager::DoRecord(), ProjectFileManager::DoSave(), ProjectFileIO::HandleXMLTag(), ProjectFileManager::Import(), ProjectFileManager::OpenProjectFile(), ProjectAudioManager::PlayPlayRegion(), ProjectFileIO::RenameOrWarn(), ProjectFileManager::SaveCopy(), and AudioIO::StartMonitoring().

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

◆ SetProjectFrame()

AUDACITY_DLL_API void SetProjectFrame ( AudacityProject project,
wxFrame &  frame 
)

Definition at line 109 of file ProjectWindows.cpp.

110{
111 ProjectWindows::Get(project).mFrame = &frame;
112}

References BasicUI::Get().

Referenced by ProjectWindowBase::ProjectWindowBase().

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

◆ SetProjectPanel()

AUDACITY_DLL_API void SetProjectPanel ( AudacityProject project,
wxWindow &  panel 
)

Definition at line 66 of file ProjectWindows.cpp.

68{
69 ProjectWindows::Get(project).mPanel = &panel;
70}

References BasicUI::Get().

Here is the call graph for this function: