Audacity  3.0.3
Classes | Namespaces | Functions | Variables
ProjectWindows.cpp File Reference
#include "ProjectWindows.h"
#include "Project.h"
#include "widgets/wxWidgetsWindowPlacement.h"
#include <wx/frame.h>
Include dependency graph for ProjectWindows.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{ProjectWindows.cpp}::ProjectWindows
 

Namespaces

 anonymous_namespace{ProjectWindows.cpp}
 

Functions

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 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)
 
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...
 
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...
 
std::unique_ptr< const BasicUI::WindowPlacementProjectFramePlacement (AudacityProject *project)
 Make a WindowPlacement object suitable for project (which may be null) More...
 
void SetProjectFrame (AudacityProject &project, wxFrame &frame)
 
AUDACITY_DLL_API AttachedWindowsGetAttachedWindows (AudacityProject &project)
 

Variables

const AudacityProject::AttachedObjects::RegisteredFactory anonymous_namespace{ProjectWindows.cpp}::key
 

Detailed Description


Audacity: A Digital Audio Editor

Paul Licameli split from Project.cpp

Definition in file ProjectWindows.cpp.

Function Documentation

◆ FindProjectFrame() [1/2]

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 }

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]

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 }

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{PluginMenus.cpp}::DoManagePluginsMenu(), ToolManager::DoneDragging(), DoReloadPreferences(), ProjectFileManager::DoSave(), anonymous_namespace{ExtraMenus.cpp}::ExtraMiscItems(), GetNextWindowPlacement(), MenuManager::GetUpdateFlags(), AUPImportFileHandle::HandleNoteTrack(), AUPImportFileHandle::HandleProject(), AUPImportFileHandle::HandleTimeTrack(), 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(), 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(), anonymous_namespace{HelpMenus.cpp}::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()

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 }

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()

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().

Here is the call 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:
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
THROW_INCONSISTENCY_EXCEPTION
#define THROW_INCONSISTENCY_EXCEPTION
Throw InconsistencyException, using C++ preprocessor to identify the source code location.
Definition: InconsistencyException.h:79
GetProjectFrame
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 ...
Definition: ProjectWindows.cpp:72