![]() |
Audacity 3.2.0
|
A top-level window associated with a project, and handling scrollbars and zooming. More...
#include <ProjectWindow.h>
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 () |
PlaybackScroller & | GetPlaybackScroller () |
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) |
![]() | |
ProjectWindowBase (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, AudacityProject &project) | |
~ProjectWindowBase () override | |
std::shared_ptr< AudacityProject > | FindProject () |
std::shared_ptr< const AudacityProject > | FindProject () const |
![]() | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
![]() | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (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 ProjectWindow & | Get (AudacityProject &project) |
static const ProjectWindow & | Get (const AudacityProject &project) |
static ProjectWindow * | Find (AudacityProject *pProject) |
static const ProjectWindow * | Find (const AudacityProject *pProject) |
![]() | |
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< PlaybackScroller > | mPlaybackScroller |
const Observer::Subscription | mViewportSubscription |
Additional Inherited Members | |
![]() | |
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 constexpr bool | notifies_all |
![]() | |
virtual void | UpdateSelectedPrefs (int id) |
![]() | |
CallbackReturn | Publish (const ProjectWindowDestroyedMessage &message) |
Send a message to connected callbacks. More... | |
![]() | |
std::weak_ptr< AudacityProject > | mwProject |
A top-level window associated with a project, and handling scrollbars and zooming.
Definition at line 33 of file ProjectWindow.h.
|
explicit |
Definition at line 527 of file ProjectWindow.cpp.
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.
|
override |
Definition at line 626 of file ProjectWindow.cpp.
void ProjectWindow::ApplyUpdatedTheme | ( | ) |
Definition at line 652 of file ProjectWindow.cpp.
References ThemeBase::Colour(), and theTheme.
Referenced by OnThemeChange().
|
static |
Definition at line 419 of file ProjectWindow.cpp.
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().
|
static |
Definition at line 426 of file ProjectWindow.cpp.
References Find().
|
static |
Definition at line 409 of file ProjectWindow.cpp.
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().
|
static |
Definition at line 414 of file ProjectWindow.cpp.
References Get(), and project.
|
noexcept |
Container is a parent window for both effects panel and track list windows.
Definition at line 891 of file ProjectWindow.cpp.
References mContainerWindow.
Referenced by InitProjectWindow().
int ProjectWindow::GetHorizontalRange | ( | ) | const |
Definition at line 777 of file ProjectWindow.cpp.
References mHsbar.
|
inline |
Definition at line 122 of file ProjectWindow.h.
Referenced by InitProjectWindow().
int ProjectWindow::GetHorizontalThumbPosition | ( | ) | const |
Definition at line 767 of file ProjectWindow.cpp.
References mHsbar.
int ProjectWindow::GetHorizontalThumbSize | ( | ) | const |
Definition at line 772 of file ProjectWindow.cpp.
References mHsbar.
|
inline |
Definition at line 114 of file ProjectWindow.h.
Referenced by ProjectManager::SaveWindowSize().
|
inline |
Definition at line 111 of file ProjectWindow.h.
Referenced by MixerBoard::MixerBoard(), PlayIndicatorOverlay::PlayIndicatorOverlay(), ScrubbingOverlay::ScrubbingOverlay(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StopScrolling(), and SelectHandle::TimerHandler::TimerHandler().
|
noexcept |
Top panel contains project-related controls and tools.
Definition at line 896 of file ProjectWindow.cpp.
References mTopPanel.
Referenced by InitProjectWindow().
int ProjectWindow::GetTotalHeight | ( | const TrackList & | trackList | ) |
Definition at line 756 of file ProjectWindow.cpp.
References ChannelView::GetTotalHeight().
wxSize ProjectWindow::GetTPTracksUsableArea | ( | ) |
int ProjectWindow::GetTrackHeight | ( | const Track & | track | ) |
Definition at line 751 of file ProjectWindow.cpp.
References ChannelView::GetChannelGroupHeight().
|
noexcept |
Track list window is the parent container for TrackPanel.
Definition at line 886 of file ProjectWindow.cpp.
References mTrackListWindow.
Referenced by InitProjectWindow().
int ProjectWindow::GetVerticalRange | ( | ) | const |
Definition at line 812 of file ProjectWindow.cpp.
References mVsbar.
|
inline |
Definition at line 121 of file ProjectWindow.h.
Referenced by InitProjectWindow().
int ProjectWindow::GetVerticalThumbPosition | ( | ) | const |
Definition at line 802 of file ProjectWindow.cpp.
References mVsbar.
int ProjectWindow::GetVerticalThumbSize | ( | ) | const |
Definition at line 807 of file ProjectWindow.cpp.
References mVsbar.
|
override |
Definition at line 1185 of file ProjectWindow.cpp.
References mActive.
|
inline |
Definition at line 56 of file ProjectWindow.h.
Referenced by OnActivate().
|
override |
Definition at line 881 of file ProjectWindow.cpp.
References mIconized.
Referenced by GetNextWindowPlacement(), OnMove(), and OnSize().
bool ProjectWindow::IsTrackMinimized | ( | const Track & | track | ) |
Definition at line 740 of file ProjectWindow.cpp.
References ChannelView::Get(), ChannelGroup::GetChannel(), and ChannelView::GetMinimized().
void ProjectWindow::MacShowUndockedToolbars | ( | bool | show | ) |
Definition at line 940 of file ProjectWindow.cpp.
References BasicUI::FindFocus().
Referenced by OnIconize().
bool ProjectWindow::MayScrollBeyondZero | ( | ) | const |
Definition at line 711 of file ProjectWindow.cpp.
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().
unsigned ProjectWindow::MinimumTrackHeight | ( | ) |
Definition at line 735 of file ProjectWindow.cpp.
References CommonTrackInfo::MinimumTrackHeight().
int ProjectWindow::NextWindowID | ( | ) |
Definition at line 431 of file ProjectWindow.cpp.
References mNextWindowID.
void ProjectWindow::OnActivate | ( | wxActivateEvent & | event | ) |
Definition at line 1150 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), IsBeingDeleted(), mActive, project, and SetActiveProject().
void ProjectWindow::OnIconize | ( | wxIconizeEvent & | event | ) |
Definition at line 972 of file ProjectWindow.cpp.
References AllProjects::begin(), AllProjects::end(), GetProjectFrame(), MacShowUndockedToolbars(), mIconized, and OnShow().
void ProjectWindow::OnMenu | ( | wxCommandEvent & | event | ) |
Definition at line 1109 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), CommandManager::Get(), CommandManager::GetUpdateFlags(), and project.
void ProjectWindow::OnMouseEvent | ( | wxMouseEvent & | event | ) |
Definition at line 1190 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), project, and SetActiveProject().
void ProjectWindow::OnMove | ( | wxMoveEvent & | event | ) |
Definition at line 1011 of file ProjectWindow.cpp.
References IsIconized(), and SetNormalizedWindowState().
void ProjectWindow::OnProjectTitleChange | ( | ProjectFileIOMessage | message | ) |
Definition at line 1086 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ProjectFileIO::Get(), ProjectFileIO::GetProjectTitle(), name, project, and ProjectTitleChange.
Referenced by ProjectWindow().
void ProjectWindow::OnScroll | ( | wxScrollEvent & | event | ) |
Definition at line 1101 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScroll().
void ProjectWindow::OnScrollLeftButton | ( | wxScrollEvent & | event | ) |
Definition at line 683 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollLeftButton().
void ProjectWindow::OnScrollRightButton | ( | wxScrollEvent & | event | ) |
Definition at line 691 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollRightButton().
void ProjectWindow::OnShow | ( | wxShowEvent & | event | ) |
Definition at line 1038 of file ProjectWindow.cpp.
References mShownOnce, and safenew.
Referenced by OnIconize().
void ProjectWindow::OnSize | ( | wxSizeEvent & | event | ) |
Definition at line 1018 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), Viewport::HandleResize(), IsIconized(), mShownOnce, and SetNormalizedWindowState().
|
private |
Definition at line 658 of file ProjectWindow.cpp.
References ThemeChangeMessage::appearance, ApplyUpdatedTheme(), ProjectWindowBase::FindProject(), ToolManager::Get(), and project.
Referenced by ProjectWindow().
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.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::HandleResize().
void ProjectWindow::OnUpdateUI | ( | wxUpdateUIEvent & | event | ) |
Definition at line 1141 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), CommandManager::Get(), project, and CommandManager::UpdateMenus().
|
private |
Definition at line 1256 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), CommandManager::Get(), ViewInfo::Get(), GetProjectPanel(), mIsDeleting, project, UpdateLayout(), and CommandManager::UpdateMenus().
void ProjectWindow::RefreshTPTrack | ( | Track * | pTrk, |
bool | refreshbacking = true |
||
) |
void ProjectWindow::SetChannelHeights | ( | Track & | track, |
unsigned | height | ||
) |
Definition at line 761 of file ProjectWindow.cpp.
References ChannelGroup::Channels(), ChannelView::Get(), and ChannelView::SetExpandedHeight().
void ProjectWindow::SetHorizontalScrollbar | ( | int | position, |
int | thumbSize, | ||
int | range, | ||
int | pageSize, | ||
bool | refresh | ||
) |
Definition at line 787 of file ProjectWindow.cpp.
References mHsbar.
void ProjectWindow::SetHorizontalThumbPosition | ( | int | viewStart | ) |
Definition at line 782 of file ProjectWindow.cpp.
References mHsbar.
|
inline |
Definition at line 57 of file ProjectWindow.h.
void ProjectWindow::SetMinimized | ( | Track & | track, |
bool | minimized | ||
) |
Definition at line 745 of file ProjectWindow.cpp.
References ChannelGroup::Channels(), ChannelView::Get(), and ChannelView::SetMinimized().
|
inline |
Definition at line 113 of file ProjectWindow.h.
Referenced by OnMove(), and OnSize().
void ProjectWindow::SetToDefaultSize | ( | ) |
Definition at line 901 of file ProjectWindow.cpp.
References GetDefaultWindowRect().
void ProjectWindow::SetVerticalScrollbar | ( | int | position, |
int | thumbSize, | ||
int | range, | ||
int | pageSize, | ||
bool | refresh | ||
) |
Definition at line 822 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::SetVerticalThumbPosition | ( | int | viewStart | ) |
Definition at line 817 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::ShowHorizontalScrollbar | ( | bool | shown | ) |
Definition at line 793 of file ProjectWindow.cpp.
References mHsbar.
void ProjectWindow::ShowVerticalScrollbar | ( | bool | shown | ) |
Definition at line 828 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::UpdateLayout | ( | ) |
Definition at line 837 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), and project.
Referenced by OnViewportMessage().
|
overrideprivatevirtual |
Implements PrefsListener.
Definition at line 675 of file ProjectWindow.cpp.
References UpdateStatusWidths().
void ProjectWindow::UpdateStatusWidths | ( | ) |
Definition at line 909 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ProjectStatus::GetStatusWidthFunctions(), mainStatusBarField, nStatusBarFields, project, and rateStatusBarField.
Referenced by InitProjectWindow(), and UpdatePrefs().
std::pair< int, int > ProjectWindow::ViewportSize | ( | ) | const |
Definition at line 699 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), TrackPanel::Get(), and project.
|
private |
Definition at line 195 of file ProjectWindow.h.
Referenced by IsActive(), and OnActivate().
|
private |
Definition at line 187 of file ProjectWindow.h.
Referenced by GetContainerWindow(), and ProjectWindow().
|
private |
Definition at line 190 of file ProjectWindow.h.
Referenced by GetHorizontalRange(), GetHorizontalThumbPosition(), GetHorizontalThumbSize(), ProjectWindow(), SetHorizontalScrollbar(), SetHorizontalThumbPosition(), and ShowHorizontalScrollbar().
|
private |
Definition at line 196 of file ProjectWindow.h.
Referenced by IsIconized(), and OnIconize().
|
private |
Definition at line 201 of file ProjectWindow.h.
Referenced by OnViewportMessage().
|
private |
Definition at line 193 of file ProjectWindow.h.
Referenced by NextWindowID(), and ProjectWindow().
|
private |
Definition at line 184 of file ProjectWindow.h.
|
private |
Definition at line 211 of file ProjectWindow.h.
Referenced by MayScrollBeyondZero(), and ProjectWindow().
|
private |
Definition at line 197 of file ProjectWindow.h.
|
private |
Definition at line 209 of file ProjectWindow.h.
|
private |
Definition at line 207 of file ProjectWindow.h.
Referenced by ProjectWindow().
|
private |
Definition at line 208 of file ProjectWindow.h.
Referenced by ProjectWindow().
|
private |
Definition at line 186 of file ProjectWindow.h.
Referenced by GetTopPanel(), and ProjectWindow().
|
private |
Definition at line 188 of file ProjectWindow.h.
Referenced by GetTrackListWindow(), and ProjectWindow().
|
private |
Definition at line 212 of file ProjectWindow.h.
|
private |
Definition at line 191 of file ProjectWindow.h.
Referenced by GetVerticalRange(), GetVerticalThumbPosition(), GetVerticalThumbSize(), ProjectWindow(), SetVerticalScrollbar(), SetVerticalThumbPosition(), and ShowVerticalScrollbar().