Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ProjectWindow Class Referencefinal

A top-level window associated with a project, and handling scrollbars and zooming. More...

#include <ProjectWindow.h>

Inheritance diagram for ProjectWindow:
[legend]
Collaboration diagram for ProjectWindow:
[legend]

Classes

class  PlaybackScroller
 
struct  PlaybackScrollerMessage
 

Public Member Functions

 ProjectWindow (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project)
 
 ~ProjectWindow () override
 
int NextWindowID ()
 
bool IsActive () override
 
bool IsIconized () const override
 
bool IsBeingDeleted () const
 
void SetIsBeingDeleted ()
 
wxWindow * GetTrackListWindow () noexcept
 Track list window is the parent container for TrackPanel. More...
 
wxSplitterWindow * GetContainerWindow () noexcept
 Container is a parent window for both effects panel and track list windows. More...
 
wxPanel * GetTopPanel () noexcept
 Top panel contains project-related controls and tools. More...
 
void UpdateStatusWidths ()
 
PlaybackScrollerGetPlaybackScroller ()
 
void SetNormalizedWindowState (wxRect pSizeAndLocation)
 
wxRect GetNormalizedWindowState () const
 
void ApplyUpdatedTheme ()
 
wxScrollBar & GetVerticalScrollBar ()
 
wxScrollBar & GetHorizontalScrollBar ()
 
void OnScrollLeftButton (wxScrollEvent &event)
 
void OnScrollRightButton (wxScrollEvent &event)
 
std::pair< int, int > ViewportSize () const
 
bool MayScrollBeyondZero () const
 
unsigned MinimumTrackHeight ()
 
bool IsTrackMinimized (const Track &track)
 
void SetMinimized (Track &track, bool minimized)
 
int GetTrackHeight (const Track &track)
 
void SetChannelHeights (Track &track, unsigned height)
 
int GetTotalHeight (const TrackList &trackList)
 
int GetHorizontalThumbPosition () const
 
int GetHorizontalThumbSize () const
 
int GetHorizontalRange () const
 
void SetHorizontalThumbPosition (int viewStart)
 
void SetHorizontalScrollbar (int position, int thumbSize, int range, int pageSize, bool refresh)
 
void ShowHorizontalScrollbar (bool shown)
 
int GetVerticalThumbPosition () const
 
int GetVerticalThumbSize () const
 
int GetVerticalRange () const
 
void SetVerticalThumbPosition (int viewStart)
 
void SetVerticalScrollbar (int position, int thumbSize, int range, int pageSize, bool refresh)
 
void ShowVerticalScrollbar (bool shown)
 
void SetToDefaultSize ()
 
wxSize GetTPTracksUsableArea ()
 
void RefreshTPTrack (Track *pTrk, bool refreshbacking=true)
 
void OnMenu (wxCommandEvent &event)
 
void OnUpdateUI (wxUpdateUIEvent &event)
 
void MacShowUndockedToolbars (bool show)
 
void OnActivate (wxActivateEvent &event)
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnIconize (wxIconizeEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void UpdateLayout ()
 
void OnShow (wxShowEvent &event)
 
void OnMove (wxMoveEvent &event)
 
void OnScroll (wxScrollEvent &event)
 
void OnToolBarUpdate (wxCommandEvent &event)
 
void OnProjectTitleChange (ProjectFileIOMessage)
 
- Public Member Functions inherited from ProjectWindowBase
 ProjectWindowBase (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project)
 
 ~ProjectWindowBase () override
 
std::shared_ptr< AudacityProjectFindProject ()
 
std::shared_ptr< const AudacityProjectFindProject () const
 
- Public Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 
- Public Member Functions inherited from Observer::Publisher< ProjectWindowDestroyedMessage >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 

Static Public Member Functions

static ProjectWindowGet (AudacityProject &project)
 
static const ProjectWindowGet (const AudacityProject &project)
 
static ProjectWindowFind (AudacityProject *pProject)
 
static const ProjectWindowFind (const AudacityProject *pProject)
 
- Static Public Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Private Member Functions

void OnThemeChange (struct ThemeChangeMessage)
 
void UpdatePrefs () override
 
void OnViewportMessage (const ViewportMessage &message)
 

Private Attributes

wxRect mNormalizedWindowState
 
wxPanel * mTopPanel {}
 
wxSplitterWindow * mContainerWindow
 
wxWindow * mTrackListWindow {}
 
wxScrollBar * mHsbar {}
 
wxScrollBar * mVsbar {}
 
int mNextWindowID {}
 
bool mActive { true }
 
bool mIconized { false }
 
bool mShownOnce { false }
 
bool mIsDeleting { false }
 
Observer::Subscription mThemeChangeSubscription
 
Observer::Subscription mTitleChangeSubscription
 
Observer::Subscription mSnappingChangedSubscription
 
std::unique_ptr< PlaybackScrollermPlaybackScroller
 
const Observer::Subscription mViewportSubscription
 

Additional Inherited Members

- Public Types inherited from Observer::Publisher< ProjectWindowDestroyedMessage >
using message_type = ProjectWindowDestroyedMessage
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const ProjectWindowDestroyedMessage &) >
 Type of functions that can be connected to the Publisher. More...
 
- Static Public Attributes inherited from Observer::Publisher< ProjectWindowDestroyedMessage >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from PrefsListener
virtual void UpdateSelectedPrefs (int id)
 
- Protected Member Functions inherited from Observer::Publisher< ProjectWindowDestroyedMessage >
CallbackReturn Publish (const ProjectWindowDestroyedMessage &message)
 Send a message to connected callbacks. More...
 
- Protected Attributes inherited from ProjectWindowBase
std::weak_ptr< AudacityProjectmwProject
 

Detailed Description

A top-level window associated with a project, and handling scrollbars and zooming.

Definition at line 33 of file ProjectWindow.h.

Constructor & Destructor Documentation

◆ ProjectWindow()

ProjectWindow::ProjectWindow ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
AudacityProject project 
)
explicit

Definition at line 527 of file ProjectWindow.cpp.

530 : ProjectWindowBase{ parent, id, pos, size, project }
534{
535 Viewport::Get(project).SetCallbacks(std::make_unique<Adapter>(*this));
536
538
539 constexpr auto EffectsPanelMaxWidth { 500 };
540 constexpr auto TrackPanelMinWidth { 250 };
541
542 // Two sub-windows need to be made before Init(),
543 // so that this constructor can complete, and then TrackPanel and
544 // AdornedRulerPanel can retrieve those windows from this in their
545 // factory functions
546
547 // PRL: this panel groups the top tool dock and the ruler into one
548 // tab cycle.
549 // Must create it with non-default width equal to the main window width,
550 // or else the device toolbar doesn't make initial widths of the choice
551 // controls correct.
553 this, wxID_ANY, wxDefaultPosition,
554 wxSize{ this->GetSize().GetWidth(), -1 }
555 };
556 mTopPanel->SetLabel( "Top Panel" );// Not localised
557 mTopPanel->SetLayoutDirection(wxLayout_LeftToRight);
558 mTopPanel->SetAutoLayout(true);
559#ifdef EXPERIMENTAL_DA2
560 mTopPanel->SetBackgroundColour(theTheme.Colour( clrMedium ));
561#endif
562
563 auto container = safenew wxSplitterWindow(this, wxID_ANY,
564 wxDefaultPosition,
565 wxDefaultSize,
566 wxNO_BORDER | wxSP_LIVE_UPDATE | wxSP_THIN_SASH);
567 container->Bind(wxEVT_SPLITTER_DOUBLECLICKED, [](wxSplitterEvent& event){
568 //"The default behaviour is to unsplit the window"
569 event.Veto();//do noting instead
570 });
571 container->Bind(wxEVT_SPLITTER_SASH_POS_CHANGING, [=](wxSplitterEvent& event){
572 if(event.GetSashPosition() > EffectsPanelMaxWidth)
573 //Prevents left panel from expanding further
574 event.SetSashPosition(-1);
575 });
576 mContainerWindow = container;
577
579 wxDefaultPosition,
580 wxDefaultSize,
581 wxNO_BORDER);
582 mTrackListWindow->SetMinSize({TrackPanelMinWidth, -1});
583 mTrackListWindow->SetSizer( safenew wxBoxSizer(wxVERTICAL) );
584 mTrackListWindow->SetLabel("Main Panel");// Not localized.
585 mTrackListWindow->SetLayoutDirection(wxLayout_LeftToRight);
586
588
589#ifdef EXPERIMENTAL_DA2
590 mTrackListWindow->SetBackgroundColour(theTheme.Colour( clrMedium ));
591#endif
592
593 mPlaybackScroller = std::make_unique<PlaybackScroller>( &project );
594
595 // PRL: Old comments below. No longer observing the ordering that it
596 // recommends. ProjectWindow::OnActivate puts the focus directly into
597 // the TrackPanel, which avoids the problems.
598 // LLL: When Audacity starts or becomes active after returning from
599 // another application, the first window that can accept focus
600 // will be given the focus even if we try to SetFocus(). By
601 // creating the scrollbars after the TrackPanel, we resolve
602 // several focus problems.
603
604 mHsbar = safenew ScrollBar(mTrackListWindow, HSBarID, wxSB_HORIZONTAL);
605 mVsbar = safenew ScrollBar(mTrackListWindow, VSBarID, wxSB_VERTICAL);
606#if wxUSE_ACCESSIBILITY
607 // so that name can be set on a standard control
608 mHsbar->SetAccessible(safenew WindowAccessible(mHsbar));
609 mVsbar->SetAccessible(safenew WindowAccessible(mVsbar));
610#endif
611 mHsbar->SetLayoutDirection(wxLayout_LeftToRight);
612 mHsbar->SetName(_("Horizontal Scrollbar"));
613 mVsbar->SetName(_("Vertical Scrollbar"));
614
617
618 // Subscribe to title changes published by ProjectFileIO
621
622 // And also establish my initial consistency with it
624}
#define _(s)
Definition: Internat.h:73
#define safenew
Definition: MemoryX.h:10
@ ProjectTitleChange
A normal occurrence.
@ VSBarID
@ HSBarID
@ NextID
const auto project
THEME_API Theme theTheme
Definition: Theme.cpp:82
int id
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
static ProjectFileIO & Get(AudacityProject &project)
A top-level window associated with a project.
wxScrollBar * mHsbar
wxSplitterWindow * mContainerWindow
wxPanel * mTopPanel
Observer::Subscription mThemeChangeSubscription
void OnViewportMessage(const ViewportMessage &message)
Observer::Subscription mTitleChangeSubscription
std::unique_ptr< PlaybackScroller > mPlaybackScroller
void OnProjectTitleChange(ProjectFileIOMessage)
void OnThemeChange(struct ThemeChangeMessage)
wxScrollBar * mVsbar
wxWindow * mTrackListWindow
const Observer::Subscription mViewportSubscription
wxColour & Colour(int iIndex)
void SetCallbacks(std::unique_ptr< ViewportCallbacks > pCallbacks)
Definition: Viewport.cpp:63
static Viewport & Get(AudacityProject &project)
Definition: Viewport.cpp:32
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...

References _, ThemeBase::Colour(), ProjectFileIO::Get(), Viewport::Get(), HSBarID, mContainerWindow, mHsbar, mNextWindowID, mPlaybackScroller, mThemeChangeSubscription, mTitleChangeSubscription, mTopPanel, mTrackListWindow, mVsbar, NextID, OnProjectTitleChange(), OnThemeChange(), project, ProjectTitleChange, safenew, Viewport::SetCallbacks(), Observer::Publisher< Message, NotifyAll >::Subscribe(), theTheme, and VSBarID.

Here is the call graph for this function:

◆ ~ProjectWindow()

ProjectWindow::~ProjectWindow ( )
override

Definition at line 626 of file ProjectWindow.cpp.

627{
628 // Tool manager gives us capture sometimes
629 if(HasCapture())
630 ReleaseMouse();
631}

Member Function Documentation

◆ ApplyUpdatedTheme()

void ProjectWindow::ApplyUpdatedTheme ( )

Definition at line 652 of file ProjectWindow.cpp.

653{
654 SetBackgroundColour(theTheme.Colour( clrMedium ));
655 ClearBackground();// For wxGTK.
656}

References ThemeBase::Colour(), and theTheme.

Referenced by OnThemeChange().

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

◆ Find() [1/2]

ProjectWindow * ProjectWindow::Find ( AudacityProject pProject)
static

Definition at line 419 of file ProjectWindow.cpp.

420{
421 return pProject
423 : nullptr;
424}
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Subclass * Find(const RegisteredFactory &key)
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand...
Definition: ClientData.h:341
A top-level window associated with a project, and handling scrollbars and zooming.
Definition: ProjectWindow.h:36
AttachedWindows::RegisteredFactory sProjectWindowKey

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), GetAttachedWindows(), and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.

Referenced by Find(), ProjectManager::OnStatusChange(), and ProjectManager::SetStatusText().

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

◆ Find() [2/2]

const ProjectWindow * ProjectWindow::Find ( const AudacityProject pProject)
static

Definition at line 426 of file ProjectWindow.cpp.

427{
428 return Find( const_cast< AudacityProject * >( pProject ) );
429}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ProjectWindow * Find(AudacityProject *pProject)

References Find().

Here is the call graph for this function:

◆ Get() [1/2]

ProjectWindow & ProjectWindow::Get ( AudacityProject project)
static

Definition at line 409 of file ProjectWindow.cpp.

410{
412}
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:317

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), project, and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.

Referenced by Get(), GetNextWindowPlacement(), RealtimeEffectPanel::HidePanel(), cloud::ShareAudioToolbar::MakeShareAudioButton(), MixerBoard::MixerBoard(), ProjectManager::New(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), ProjectManager::OnCloseWindow(), ProjectManager::OnReconnectionFailure(), ProjectWindow::PlaybackScroller::OnTimer(), PlayIndicatorOverlay::OnTimer(), TrackPanel::OnTimer(), PlayIndicatorOverlay::PlayIndicatorOverlay(), ProjectManager::ProjectManager(), ProjectManager::SaveWindowSize(), ScrubbingOverlay::ScrubbingOverlay(), ScrubForwarder::ScrubForwarder(), RealtimeEffectStateUI::Show(), RealtimeEffectPanel::ShowPanel(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StopScrolling(), SelectHandle::TimerHandler::TimerHandler(), and TrackPanel::TrackPanel().

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

◆ Get() [2/2]

const ProjectWindow & ProjectWindow::Get ( const AudacityProject project)
static

Definition at line 414 of file ProjectWindow.cpp.

415{
416 return Get( const_cast< AudacityProject & >( project ) );
417}
static ProjectWindow & Get(AudacityProject &project)

References Get(), and project.

Here is the call graph for this function:

◆ GetContainerWindow()

wxSplitterWindow * ProjectWindow::GetContainerWindow ( )
noexcept

Container is a parent window for both effects panel and track list windows.

Returns
Pointer to a container window (not null)

Definition at line 891 of file ProjectWindow.cpp.

892{
893 return mContainerWindow;
894}

References mContainerWindow.

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetHorizontalRange()

int ProjectWindow::GetHorizontalRange ( ) const

Definition at line 777 of file ProjectWindow.cpp.

778{
779 return mHsbar->GetRange();
780}

References mHsbar.

◆ GetHorizontalScrollBar()

wxScrollBar & ProjectWindow::GetHorizontalScrollBar ( )
inline

Definition at line 122 of file ProjectWindow.h.

122{ return *mHsbar; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetHorizontalThumbPosition()

int ProjectWindow::GetHorizontalThumbPosition ( ) const

Definition at line 767 of file ProjectWindow.cpp.

768{
769 return mHsbar->GetThumbPosition();
770}

References mHsbar.

◆ GetHorizontalThumbSize()

int ProjectWindow::GetHorizontalThumbSize ( ) const

Definition at line 772 of file ProjectWindow.cpp.

773{
774 return mHsbar->GetThumbSize();
775}

References mHsbar.

◆ GetNormalizedWindowState()

wxRect ProjectWindow::GetNormalizedWindowState ( ) const
inline

Definition at line 114 of file ProjectWindow.h.

114{ return mNormalizedWindowState; }
wxRect mNormalizedWindowState

Referenced by ProjectManager::SaveWindowSize().

Here is the caller graph for this function:

◆ GetPlaybackScroller()

PlaybackScroller & ProjectWindow::GetPlaybackScroller ( )
inline

Definition at line 111 of file ProjectWindow.h.

111{ return *mPlaybackScroller; }

Referenced by MixerBoard::MixerBoard(), PlayIndicatorOverlay::PlayIndicatorOverlay(), ScrubbingOverlay::ScrubbingOverlay(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StopScrolling(), and SelectHandle::TimerHandler::TimerHandler().

Here is the caller graph for this function:

◆ GetTopPanel()

wxPanel * ProjectWindow::GetTopPanel ( )
noexcept

Top panel contains project-related controls and tools.

Returns
Pointer to a top panel window (not null)

Definition at line 896 of file ProjectWindow.cpp.

897{
898 return mTopPanel;
899}

References mTopPanel.

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetTotalHeight()

int ProjectWindow::GetTotalHeight ( const TrackList trackList)

Definition at line 756 of file ProjectWindow.cpp.

757{
758 return ChannelView::GetTotalHeight(trackList);
759}
static int GetTotalHeight(const TrackList &list)
Definition: ChannelView.cpp:55

References ChannelView::GetTotalHeight().

Here is the call graph for this function:

◆ GetTPTracksUsableArea()

wxSize ProjectWindow::GetTPTracksUsableArea ( )

◆ GetTrackHeight()

int ProjectWindow::GetTrackHeight ( const Track track)

Definition at line 751 of file ProjectWindow.cpp.

752{
754}
static int GetChannelGroupHeight(const Track *pTrack)
Definition: ChannelView.cpp:32

References ChannelView::GetChannelGroupHeight().

Here is the call graph for this function:

◆ GetTrackListWindow()

wxWindow * ProjectWindow::GetTrackListWindow ( )
noexcept

Track list window is the parent container for TrackPanel.

Returns
Pointer to a track list window (not null)

Definition at line 886 of file ProjectWindow.cpp.

887{
888 return mTrackListWindow;
889}

References mTrackListWindow.

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetVerticalRange()

int ProjectWindow::GetVerticalRange ( ) const

Definition at line 812 of file ProjectWindow.cpp.

813{
814 return mVsbar->GetRange();
815}

References mVsbar.

◆ GetVerticalScrollBar()

wxScrollBar & ProjectWindow::GetVerticalScrollBar ( )
inline

Definition at line 121 of file ProjectWindow.h.

121{ return *mVsbar; }

Referenced by InitProjectWindow().

Here is the caller graph for this function:

◆ GetVerticalThumbPosition()

int ProjectWindow::GetVerticalThumbPosition ( ) const

Definition at line 802 of file ProjectWindow.cpp.

803{
804 return mVsbar->GetThumbPosition();
805}

References mVsbar.

◆ GetVerticalThumbSize()

int ProjectWindow::GetVerticalThumbSize ( ) const

Definition at line 807 of file ProjectWindow.cpp.

808{
809 return mVsbar->GetThumbSize();
810}

References mVsbar.

◆ IsActive()

bool ProjectWindow::IsActive ( )
override

Definition at line 1185 of file ProjectWindow.cpp.

1186{
1187 return mActive;
1188}

References mActive.

◆ IsBeingDeleted()

bool ProjectWindow::IsBeingDeleted ( ) const
inline

Definition at line 56 of file ProjectWindow.h.

56{ return mIsDeleting; }

Referenced by OnActivate().

Here is the caller graph for this function:

◆ IsIconized()

bool ProjectWindow::IsIconized ( ) const
override

Definition at line 881 of file ProjectWindow.cpp.

882{
883 return mIconized;
884}

References mIconized.

Referenced by GetNextWindowPlacement(), OnMove(), and OnSize().

Here is the caller graph for this function:

◆ IsTrackMinimized()

bool ProjectWindow::IsTrackMinimized ( const Track track)

Definition at line 740 of file ProjectWindow.cpp.

741{
742 return ChannelView::Get(*track.GetChannel(0)).GetMinimized();
743}
std::shared_ptr< ChannelType > GetChannel(size_t iChannel)
Retrieve a channel, cast to the given type.
Definition: Channel.h:344
static ChannelView & Get(Channel &channel)
bool GetMinimized() const
Definition: ChannelView.h:68

References ChannelView::Get(), ChannelGroup::GetChannel(), and ChannelView::GetMinimized().

Here is the call graph for this function:

◆ MacShowUndockedToolbars()

void ProjectWindow::MacShowUndockedToolbars ( bool  show)

Definition at line 940 of file ProjectWindow.cpp.

941{
942 (void)show;//compiler food
943#ifdef __WXMAC__
944 // Save the focus so we can restore it to whatever had it before since
945 // showing a previously hidden toolbar will cause the focus to be set to
946 // its frame. If this is not done it will appear that activation events
947 // aren't being sent to the project window since they are actually being
948 // delivered to the last tool frame shown.
949 wxWindow *focused = FindFocus();
950
951 // Find all the floating toolbars, and show or hide them
952 const auto &children = GetChildren();
953 for(const auto &child : children) {
954 if (auto frame = dynamic_cast<ToolFrame*>(child)) {
955 if (!show) {
956 frame->Hide();
957 }
958 else if (frame->GetBar() &&
959 frame->GetBar()->IsVisible() ) {
960 frame->Show();
961 }
962 }
963 }
964
965 // Restore the focus if needed
966 if (focused) {
967 focused->SetFocus();
968 }
969#endif
970}
class ToolFrame
Definition: ToolManager.h:189
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:373

References BasicUI::FindFocus().

Referenced by OnIconize().

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

◆ MayScrollBeyondZero()

bool ProjectWindow::MayScrollBeyondZero ( ) const

Definition at line 711 of file ProjectWindow.cpp.

712{
713 auto pProject = FindProject();
714 if (!pProject)
715 return false;
716 auto &project = *pProject;
717 auto &scrubber = Scrubber::Get( project );
718 auto &viewInfo = ViewInfo::Get( project );
719 if (viewInfo.bScrollBeyondZero)
720 return true;
721
722 if (scrubber.HasMark() ||
724 if (mPlaybackScroller) {
725 auto mode = mPlaybackScroller->GetMode();
726 if (mode == PlaybackScroller::Mode::Pinned ||
728 return true;
729 }
730 }
731
732 return false;
733}
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
std::shared_ptr< AudacityProject > FindProject()
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:188
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References ProjectWindowBase::FindProject(), ProjectAudioIO::Get(), ViewInfo::Get(), Scrubber::Get(), ProjectAudioIO::IsAudioActive(), mPlaybackScroller, ProjectWindow::PlaybackScroller::Pinned, project, and ProjectWindow::PlaybackScroller::Right.

Referenced by ProjectWindow::PlaybackScroller::OnTimer().

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

◆ MinimumTrackHeight()

unsigned ProjectWindow::MinimumTrackHeight ( )

Definition at line 735 of file ProjectWindow.cpp.

736{
738}
AUDACITY_DLL_API unsigned MinimumTrackHeight()

References CommonTrackInfo::MinimumTrackHeight().

Here is the call graph for this function:

◆ NextWindowID()

int ProjectWindow::NextWindowID ( )

Definition at line 431 of file ProjectWindow.cpp.

432{
433 return mNextWindowID++;
434}

References mNextWindowID.

◆ OnActivate()

void ProjectWindow::OnActivate ( wxActivateEvent &  event)

Definition at line 1150 of file ProjectWindow.cpp.

1151{
1152 // Activate events can fire during window teardown, so just
1153 // ignore them.
1154 if (IsBeingDeleted()) {
1155 return;
1156 }
1157
1158 auto pProject = FindProject();
1159 if (!pProject)
1160 return;
1161 auto &project = *pProject;
1162
1163 mActive = event.GetActive();
1164
1165 // Under Windows, focus can be "lost" when returning to
1166 // Audacity from a different application.
1167 //
1168 // This was observed by minimizing all windows using WINDOWS+M and
1169 // then ALT+TAB to return to Audacity. Focus will be given to the
1170 // project window frame which is not at all useful.
1171 //
1172 // So, we use ToolManager's observation of focus changes in a wxEventFilter.
1173 // Then, when we receive the
1174 // activate event, we restore that focus to the child or the track
1175 // panel if no child had the focus (which probably should never happen).
1176 if (mActive) {
1177 auto &toolManager = ToolManager::Get( project );
1179 if ( ! toolManager.RestoreFocus() )
1180 GetProjectPanel( project ).SetFocus();
1181 }
1182 event.Skip();
1183}
void SetActiveProject(AudacityProject *project)
AUDACITY_DLL_API wxWindow & GetProjectPanel(AudacityProject &project)
Get the main sub-window of the project frame that displays track data.
bool IsBeingDeleted() const
Definition: ProjectWindow.h:56
static ToolManager & Get(AudacityProject &project)

References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), IsBeingDeleted(), mActive, project, and SetActiveProject().

Here is the call graph for this function:

◆ OnIconize()

void ProjectWindow::OnIconize ( wxIconizeEvent &  event)

Definition at line 972 of file ProjectWindow.cpp.

973{
974 //JKC: On Iconizing we get called twice. Don't know
975 // why but it does no harm.
976 // Should we be returning true/false rather than
977 // void return? I don't know.
978 mIconized = event.IsIconized();
979
980#if defined(__WXMAC__)
981 // Readdresses bug 1431 since a crash could occur when restoring iconized
982 // floating toolbars due to recursion (bug 2411).
984 if( !mIconized )
985 {
986 Raise();
987 }
988#endif
989
990 // VisibileProjectCount seems to be just a counter for debugging.
991 // It's not used outside this function.
992 auto VisibleProjectCount = std::count_if(
994 []( const AllProjects::value_type &ptr ){
995 return !GetProjectFrame( *ptr ).IsIconized();
996 }
997 );
998 event.Skip();
999
1000 // This step is to fix part of Bug 2040, where the BackingPanel
1001 // size was not restored after we leave Iconized state.
1002
1003 // Queue up a resize event using OnShow so that we
1004 // refresh the track panel. But skip this, if we're iconized.
1005 if( mIconized )
1006 return;
1007 wxShowEvent Evt;
1008 OnShow( Evt );
1009}
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 ...
const_iterator end() const
Definition: Project.cpp:27
Container::value_type value_type
Definition: Project.h:57
const_iterator begin() const
Definition: Project.cpp:22
void OnShow(wxShowEvent &event)
void MacShowUndockedToolbars(bool show)

References AllProjects::begin(), AllProjects::end(), GetProjectFrame(), MacShowUndockedToolbars(), mIconized, and OnShow().

Here is the call graph for this function:

◆ OnMenu()

void ProjectWindow::OnMenu ( wxCommandEvent &  event)

Definition at line 1109 of file ProjectWindow.cpp.

1110{
1111#ifdef __WXMSW__
1112 // Bug 1642: We can arrive here with bogus menu IDs, which we
1113 // proceed to process. So if bogus, don't.
1114 // The bogus menu IDs are probably generated by controls on the TrackPanel,
1115 // such as the Project Rate.
1116 // 17000 is the magic number at which we start our menu.
1117 // This code would probably NOT be OK on Mac, since we assign
1118 // some specific ID numbers.
1119 if( event.GetId() < 17000){
1120 event.Skip();
1121 return;
1122 }
1123#endif
1124 auto pProject = FindProject();
1125 if (!pProject)
1126 return;
1127 auto &project = *pProject;
1128 auto &commandManager = CommandManager::Get( project );
1129 bool handled = commandManager.HandleMenuID(
1130 event.GetId(), CommandManager::Get( project ).GetUpdateFlags(),
1131 false);
1132
1133 if (handled)
1134 event.Skip(false);
1135 else{
1136 event.ResumePropagation( 999 );
1137 event.Skip(true);
1138 }
1139}
static CommandManager & Get(AudacityProject &project)
CommandFlag GetUpdateFlags(bool quick=false) const

References ProjectWindowBase::FindProject(), CommandManager::Get(), CommandManager::GetUpdateFlags(), and project.

Here is the call graph for this function:

◆ OnMouseEvent()

void ProjectWindow::OnMouseEvent ( wxMouseEvent &  event)

Definition at line 1190 of file ProjectWindow.cpp.

1191{
1192 auto pProject = FindProject();
1193 if (!pProject)
1194 return;
1195 auto &project = *pProject;
1196 if (event.ButtonDown())
1198}

References ProjectWindowBase::FindProject(), project, and SetActiveProject().

Here is the call graph for this function:

◆ OnMove()

void ProjectWindow::OnMove ( wxMoveEvent &  event)

Definition at line 1011 of file ProjectWindow.cpp.

1012{
1013 if (!this->IsMaximized() && !this->IsIconized())
1014 SetNormalizedWindowState(this->GetRect());
1015 event.Skip();
1016}
void SetNormalizedWindowState(wxRect pSizeAndLocation)
bool IsIconized() const override

References IsIconized(), and SetNormalizedWindowState().

Here is the call graph for this function:

◆ OnProjectTitleChange()

void ProjectWindow::OnProjectTitleChange ( ProjectFileIOMessage  message)

Definition at line 1086 of file ProjectWindow.cpp.

1087{
1089 auto pProject = FindProject();
1090 if (!pProject)
1091 return;
1092 auto &project = *pProject;
1094 if (name != GetTitle()) {
1095 SetTitle(name);
1096 SetName(name); // to make the nvda screen reader read the correct title
1097 }
1098 }
1099}
const TranslatableString name
Definition: Distortion.cpp:76
const wxString & GetProjectTitle() const
Definition: ProjectFileIO.h:95

References ProjectWindowBase::FindProject(), ProjectFileIO::Get(), ProjectFileIO::GetProjectTitle(), name, project, and ProjectTitleChange.

Referenced by ProjectWindow().

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

◆ OnScroll()

void ProjectWindow::OnScroll ( wxScrollEvent &  event)

Definition at line 1101 of file ProjectWindow.cpp.

1102{
1103 auto pProject = FindProject();
1104 if (!pProject)
1105 return;
1106 Viewport::Get(*pProject).OnScroll();
1107}
void OnScroll()
Definition: Viewport.cpp:411

References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScroll().

Here is the call graph for this function:

◆ OnScrollLeftButton()

void ProjectWindow::OnScrollLeftButton ( wxScrollEvent &  event)

Definition at line 683 of file ProjectWindow.cpp.

684{
685 auto pProject = FindProject();
686 if (!pProject)
687 return;
689}
void OnScrollLeftButton()
Definition: Viewport.cpp:143

References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollLeftButton().

Here is the call graph for this function:

◆ OnScrollRightButton()

void ProjectWindow::OnScrollRightButton ( wxScrollEvent &  event)

Definition at line 691 of file ProjectWindow.cpp.

692{
693 auto pProject = FindProject();
694 if (!pProject)
695 return;
697}
void OnScrollRightButton()
Definition: Viewport.cpp:160

References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollRightButton().

Here is the call graph for this function:

◆ OnShow()

void ProjectWindow::OnShow ( wxShowEvent &  event)

Definition at line 1038 of file ProjectWindow.cpp.

1039{
1040 // Remember that the window has been shown at least once
1041 mShownOnce = true;
1042
1043 // (From Debian...see also TrackPanel::OnTimer and AudacityTimer::Notify)
1044 //
1045 // Description: Workaround for wxWidgets bug: Reentry in clipboard
1046 // The wxWidgets bug http://trac.wxwidgets.org/ticket/16636 prevents
1047 // us from doing clipboard operations in wxShowEvent and wxTimerEvent
1048 // processing because those event could possibly be processed during
1049 // the (not sufficiently protected) Yield() of a first clipboard
1050 // operation, causing reentry. Audacity had a workaround in place
1051 // for this problem (the class "CaptureEvents"), which however isn't
1052 // applicable with wxWidgets 3.0 because it's based on changing the
1053 // gdk event handler, a change that would be overridden by wxWidgets's
1054 // own gdk event handler change.
1055 // Instead, as a NEW workaround, specifically protect those processings
1056 // of wxShowEvent and wxTimerEvent that try to do clipboard operations
1057 // from being executed within Yield(). This is done by delaying their
1058 // execution by posting pure wxWidgets events - which are never executed
1059 // during Yield().
1060 // Author: Martin Stegh fer <[email protected]>
1061 // Bug-Debian: https://bugs.debian.org/765341
1062
1063 // the actual creation/showing of the window).
1064 // Post the event instead of calling OnSize(..) directly. This ensures that
1065 // this is a pure wxWidgets event (no GDK event behind it) and that it
1066 // therefore isn't processed within the YieldFor(..) of the clipboard
1067 // operations (workaround for Debian bug #765341).
1068 // QueueEvent() will take ownership of the event
1069 GetEventHandler()->QueueEvent(safenew wxSizeEvent(GetSize()));
1070
1071 // Further processing by default handlers
1072 event.Skip();
1073}

References mShownOnce, and safenew.

Referenced by OnIconize().

Here is the caller graph for this function:

◆ OnSize()

void ProjectWindow::OnSize ( wxSizeEvent &  event)

Definition at line 1018 of file ProjectWindow.cpp.

1019{
1020 // (From Debian)
1021 //
1022 // (3.) GTK critical warning "IA__gdk_window_get_origin: assertion
1023 // 'GDK_IS_WINDOW (window)' failed": Received events of type wxSizeEvent
1024 // on the main project window cause calls to "ClientToScreen" - which is
1025 // not available until the window is first shown. So the class has to
1026 // keep track of wxShowEvent events and inhibit those actions until the
1027 // window is first shown.
1028 if (mShownOnce) {
1029 auto pProject = FindProject();
1030 if (pProject)
1031 Viewport::Get(*pProject).HandleResize();
1032 if (!this->IsMaximized() && !this->IsIconized())
1033 SetNormalizedWindowState(this->GetRect());
1034 }
1035 event.Skip();
1036}
void HandleResize()
Definition: Viewport.cpp:401

References ProjectWindowBase::FindProject(), Viewport::Get(), Viewport::HandleResize(), IsIconized(), mShownOnce, and SetNormalizedWindowState().

Here is the call graph for this function:

◆ OnThemeChange()

void ProjectWindow::OnThemeChange ( struct ThemeChangeMessage  message)
private

Definition at line 658 of file ProjectWindow.cpp.

659{
660 auto pProject = FindProject();
661 if (!pProject)
662 return;
663 auto &project = *pProject;
664
665 if (message.appearance)
666 return;
667 this->ApplyUpdatedTheme();
668 auto &toolManager = ToolManager::Get( project );
669 toolManager.ForEach([](auto pToolBar){
670 if( pToolBar )
671 pToolBar->ReCreateButtons();
672 });
673}
void ApplyUpdatedTheme()
std::optional< PreferredSystemAppearance > appearance
Definition: Theme.h:112

References ThemeChangeMessage::appearance, ApplyUpdatedTheme(), ProjectWindowBase::FindProject(), ToolManager::Get(), and project.

Referenced by ProjectWindow().

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

◆ OnToolBarUpdate()

void ProjectWindow::OnToolBarUpdate ( wxCommandEvent &  event)

A toolbar has been updated, so handle it like a sizing event.

Definition at line 1078 of file ProjectWindow.cpp.

1079{
1080 auto pProject = FindProject();
1081 if (pProject)
1082 Viewport::Get(*pProject).HandleResize();
1083 event.Skip(false); /* No need to propagate any further */
1084}

References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::HandleResize().

Here is the call graph for this function:

◆ OnUpdateUI()

void ProjectWindow::OnUpdateUI ( wxUpdateUIEvent &  event)

Definition at line 1141 of file ProjectWindow.cpp.

1142{
1143 auto pProject = FindProject();
1144 if (!pProject)
1145 return;
1146 auto &project = *pProject;
1148}
void UpdateMenus(bool checkActive=true)

References ProjectWindowBase::FindProject(), CommandManager::Get(), project, and CommandManager::UpdateMenus().

Here is the call graph for this function:

◆ OnViewportMessage()

void ProjectWindow::OnViewportMessage ( const ViewportMessage message)
private

Definition at line 1256 of file ProjectWindow.cpp.

1257{
1258 // Activate events can fire during window teardown, so just
1259 // ignore them.
1260 if (mIsDeleting)
1261 return;
1262 auto pProject = FindProject();
1263 if (!pProject)
1264 return;
1265 auto &project = *pProject;
1266 auto &viewInfo = ViewInfo::Get(project);
1267 auto &trackPanel = GetProjectPanel(project);
1268
1269 auto [rescroll, scrollbarVisibilityChanged, resize] = message;
1270
1271 if (rescroll)
1272 trackPanel.Refresh(false);
1273
1274 // why? Is there a menu item whose availability depends on scroll position
1275 // or zoom level?
1277
1278 if (scrollbarVisibilityChanged || resize)
1279 UpdateLayout();
1280}

References ProjectWindowBase::FindProject(), CommandManager::Get(), ViewInfo::Get(), GetProjectPanel(), mIsDeleting, project, UpdateLayout(), and CommandManager::UpdateMenus().

Here is the call graph for this function:

◆ RefreshTPTrack()

void ProjectWindow::RefreshTPTrack ( Track pTrk,
bool  refreshbacking = true 
)

◆ SetChannelHeights()

void ProjectWindow::SetChannelHeights ( Track track,
unsigned  height 
)

Definition at line 761 of file ProjectWindow.cpp.

762{
763 for (auto pChannel : track.Channels())
764 ChannelView::Get(*pChannel).SetExpandedHeight(height);
765}
IteratorRange< ChannelIterator< ChannelType > > Channels()
Get range of channels with mutative access.
Definition: Channel.h:408
void SetExpandedHeight(int height)

References ChannelGroup::Channels(), ChannelView::Get(), and ChannelView::SetExpandedHeight().

Here is the call graph for this function:

◆ SetHorizontalScrollbar()

void ProjectWindow::SetHorizontalScrollbar ( int  position,
int  thumbSize,
int  range,
int  pageSize,
bool  refresh 
)

Definition at line 787 of file ProjectWindow.cpp.

789{
790 mHsbar->SetScrollbar(position, thumbSize, range, pageSize, refresh);
791}

References mHsbar.

◆ SetHorizontalThumbPosition()

void ProjectWindow::SetHorizontalThumbPosition ( int  viewStart)

Definition at line 782 of file ProjectWindow.cpp.

783{
784 mHsbar->SetThumbPosition(viewStart);
785}

References mHsbar.

◆ SetIsBeingDeleted()

void ProjectWindow::SetIsBeingDeleted ( )
inline

Definition at line 57 of file ProjectWindow.h.

57{ mIsDeleting = true; }

◆ SetMinimized()

void ProjectWindow::SetMinimized ( Track track,
bool  minimized 
)

Definition at line 745 of file ProjectWindow.cpp.

746{
747 for (auto pChannel : track.Channels())
748 ChannelView::Get(*pChannel).SetMinimized(minimized);
749}
void SetMinimized(bool minimized)

References ChannelGroup::Channels(), ChannelView::Get(), and ChannelView::SetMinimized().

Here is the call graph for this function:

◆ SetNormalizedWindowState()

void ProjectWindow::SetNormalizedWindowState ( wxRect  pSizeAndLocation)
inline

Definition at line 113 of file ProjectWindow.h.

113{ mNormalizedWindowState = pSizeAndLocation; }

Referenced by OnMove(), and OnSize().

Here is the caller graph for this function:

◆ SetToDefaultSize()

void ProjectWindow::SetToDefaultSize ( )

Definition at line 901 of file ProjectWindow.cpp.

902{
903 wxRect defaultRect;
904 GetDefaultWindowRect(&defaultRect);
905
906 SetSize(defaultRect.width, defaultRect.height);
907}
void GetDefaultWindowRect(wxRect *defRect)

References GetDefaultWindowRect().

Here is the call graph for this function:

◆ SetVerticalScrollbar()

void ProjectWindow::SetVerticalScrollbar ( int  position,
int  thumbSize,
int  range,
int  pageSize,
bool  refresh 
)

Definition at line 822 of file ProjectWindow.cpp.

824{
825 mVsbar->SetScrollbar(position, thumbSize, range, pageSize, refresh);
826}

References mVsbar.

◆ SetVerticalThumbPosition()

void ProjectWindow::SetVerticalThumbPosition ( int  viewStart)

Definition at line 817 of file ProjectWindow.cpp.

818{
819 mVsbar->SetThumbPosition(viewStart);
820}

References mVsbar.

◆ ShowHorizontalScrollbar()

void ProjectWindow::ShowHorizontalScrollbar ( bool  shown)

Definition at line 793 of file ProjectWindow.cpp.

794{
795#ifdef __WXGTK__
796 mHsbar->Show(shown);
797#else
798 mHsbar->Enable(shown);
799#endif
800}

References mHsbar.

◆ ShowVerticalScrollbar()

void ProjectWindow::ShowVerticalScrollbar ( bool  shown)

Definition at line 828 of file ProjectWindow.cpp.

829{
830#ifdef __WXGTK__
831 mVsbar->Show(shown);
832#else
833 mVsbar->Enable(shown);
834#endif
835}

References mVsbar.

◆ UpdateLayout()

void ProjectWindow::UpdateLayout ( )

Definition at line 837 of file ProjectWindow.cpp.

838{
839 auto pProject = FindProject();
840 if (!pProject)
841 return;
842 auto &project = *pProject;
843 auto &trackPanel = GetProjectPanel( project );
844 auto &toolManager = ToolManager::Get( project );
845
846 // 1. Layout panel, to get widths of the docks.
847 Layout();
848 // 2. Layout toolbars to pack the toolbars correctly in docks which
849 // are now the correct width.
850 toolManager.LayoutToolBars();
851 // 3. Layout panel, to resize docks, in particular reducing the height
852 // of any empty docks, or increasing the height of docks that need it.
853 Layout();
854
855 // Bug 2455
856 // The commented out code below is to calculate a nice minimum size for
857 // the window. However on Ubuntu when the window is minimised it leads to
858 // an insanely tall window.
859 // Using a fixed min size fixes that.
860 // However there is still something strange when minimised, as once
861 // UpdateLayout is called once, when minimised, it gets called repeatedly.
862#if 0
863 // Retrieve size of this projects window
864 wxSize mainsz = GetSize();
865
866 // Retrieve position of the track panel to use as the size of the top
867 // third of the window
868 wxPoint tppos = ClientToScreen(trackPanel.GetParent()->GetPosition());
869
870 // Retrieve position of bottom dock to use as the size of the bottom
871 // third of the window
872 wxPoint sbpos = ClientToScreen(toolManager.GetBotDock()->GetPosition());
873
874 // The "+ 50" is the minimum height of the TrackPanel
875 SetMinSize( wxSize(250, (mainsz.y - sbpos.y) + tppos.y + 50));
876#endif
877 SetMinSize( wxSize(250, 250));
878 SetMaxSize( wxSize(20000, 20000));
879}

References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), and project.

Referenced by OnViewportMessage().

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

◆ UpdatePrefs()

void ProjectWindow::UpdatePrefs ( )
overrideprivatevirtual

Implements PrefsListener.

Definition at line 675 of file ProjectWindow.cpp.

676{
677 // Update status bar widths in case of language change
679}
void UpdateStatusWidths()

References UpdateStatusWidths().

Here is the call graph for this function:

◆ UpdateStatusWidths()

void ProjectWindow::UpdateStatusWidths ( )

Definition at line 909 of file ProjectWindow.cpp.

910{
911 auto pProject = FindProject();
912 if (!pProject)
913 return;
914 auto &project = *pProject;
915 enum { nWidths = nStatusBarFields + 1 };
916 int widths[ nWidths ]{ 0 };
917 widths[ rateStatusBarField ] = 150;
918 const auto statusBar = GetStatusBar();
919 const auto &functions = ProjectStatus::GetStatusWidthFunctions();
920 // Start from 1 not 0
921 // Specifying a first column always of width 0 was needed for reasons
922 // I forget now
923 for ( int ii = 1; ii <= nStatusBarFields; ++ii ) {
924 int &width = widths[ ii ];
925 for ( const auto &function : functions ) {
926 auto results =
927 function( project, static_cast< StatusBarField >( ii ) );
928 for ( const auto &string : results.first ) {
929 int w;
930 statusBar->GetTextExtent(string.Translation(), &w, nullptr);
931 width = std::max<int>( width, w + results.second );
932 }
933 }
934 }
935 // The main status field is not fixed width
936 widths[ mainStatusBarField ] = -1;
937 statusBar->SetStatusWidths( nWidths, widths );
938}
StatusBarField
Definition: ProjectStatus.h:24
@ mainStatusBarField
Definition: ProjectStatus.h:26
@ nStatusBarFields
Definition: ProjectStatus.h:29
@ rateStatusBarField
Definition: ProjectStatus.h:27
static const StatusWidthFunctions & GetStatusWidthFunctions()

References ProjectWindowBase::FindProject(), ProjectStatus::GetStatusWidthFunctions(), mainStatusBarField, nStatusBarFields, project, and rateStatusBarField.

Referenced by InitProjectWindow(), and UpdatePrefs().

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

◆ ViewportSize()

std::pair< int, int > ProjectWindow::ViewportSize ( ) const

Definition at line 699 of file ProjectWindow.cpp.

700{
701 auto pProject = FindProject();
702 if (!pProject)
703 return { 0, 0 };
704 auto &project = *pProject;
705 auto &trackPanel = TrackPanel::Get(project);
706 int width, height;
707 trackPanel.GetSize(&width, &height);
708 return { width, height };
709}
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:233

References ProjectWindowBase::FindProject(), TrackPanel::Get(), and project.

Here is the call graph for this function:

Member Data Documentation

◆ mActive

bool ProjectWindow::mActive { true }
private

Definition at line 195 of file ProjectWindow.h.

Referenced by IsActive(), and OnActivate().

◆ mContainerWindow

wxSplitterWindow* ProjectWindow::mContainerWindow
private

Definition at line 187 of file ProjectWindow.h.

Referenced by GetContainerWindow(), and ProjectWindow().

◆ mHsbar

wxScrollBar* ProjectWindow::mHsbar {}
private

◆ mIconized

bool ProjectWindow::mIconized { false }
private

Definition at line 196 of file ProjectWindow.h.

Referenced by IsIconized(), and OnIconize().

◆ mIsDeleting

bool ProjectWindow::mIsDeleting { false }
private

Definition at line 201 of file ProjectWindow.h.

Referenced by OnViewportMessage().

◆ mNextWindowID

int ProjectWindow::mNextWindowID {}
private

Definition at line 193 of file ProjectWindow.h.

Referenced by NextWindowID(), and ProjectWindow().

◆ mNormalizedWindowState

wxRect ProjectWindow::mNormalizedWindowState
private

Definition at line 184 of file ProjectWindow.h.

◆ mPlaybackScroller

std::unique_ptr<PlaybackScroller> ProjectWindow::mPlaybackScroller
private

Definition at line 211 of file ProjectWindow.h.

Referenced by MayScrollBeyondZero(), and ProjectWindow().

◆ mShownOnce

bool ProjectWindow::mShownOnce { false }
private

Definition at line 197 of file ProjectWindow.h.

Referenced by OnShow(), and OnSize().

◆ mSnappingChangedSubscription

Observer::Subscription ProjectWindow::mSnappingChangedSubscription
private

Definition at line 209 of file ProjectWindow.h.

◆ mThemeChangeSubscription

Observer::Subscription ProjectWindow::mThemeChangeSubscription
private

Definition at line 207 of file ProjectWindow.h.

Referenced by ProjectWindow().

◆ mTitleChangeSubscription

Observer::Subscription ProjectWindow::mTitleChangeSubscription
private

Definition at line 208 of file ProjectWindow.h.

Referenced by ProjectWindow().

◆ mTopPanel

wxPanel* ProjectWindow::mTopPanel {}
private

Definition at line 186 of file ProjectWindow.h.

Referenced by GetTopPanel(), and ProjectWindow().

◆ mTrackListWindow

wxWindow* ProjectWindow::mTrackListWindow {}
private

Definition at line 188 of file ProjectWindow.h.

Referenced by GetTrackListWindow(), and ProjectWindow().

◆ mViewportSubscription

const Observer::Subscription ProjectWindow::mViewportSubscription
private

Definition at line 212 of file ProjectWindow.h.

◆ mVsbar

wxScrollBar* ProjectWindow::mVsbar {}
private

The documentation for this class was generated from the following files: