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 |
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) |
wxStatusBar * | CreateProjectStatusBar () |
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< AudacityProject > | FindProject () |
std::shared_ptr< const AudacityProject > | FindProject () 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 | |
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 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< PlaybackScroller > | mPlaybackScroller |
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< 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 526 of file ProjectWindow.cpp.
References _, 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 618 of file ProjectWindow.cpp.
void ProjectWindow::ApplyUpdatedTheme | ( | ) |
Definition at line 644 of file ProjectWindow.cpp.
References ThemeBase::Colour(), and theTheme.
Referenced by OnThemeChange().
wxStatusBar * ProjectWindow::CreateProjectStatusBar | ( | ) |
Definition at line 877 of file ProjectWindow.cpp.
References ProjectStatusFieldsRegistry::Count(), field, ProjectWindowBase::FindProject(), ProjectStatusFieldsRegistry::OnSize(), and ProjectStatusFieldsRegistry::Visit().
Referenced by InitProjectWindow(), and UpdateStatusWidths().
|
static |
Definition at line 418 of file ProjectWindow.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), GetAttachedWindows(), and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.
Referenced by Find(), anonymous_namespace{AudioComMenus.cpp}::OnOpenFromCloud(), anonymous_namespace{AudioComMenus.cpp}::OnShareAudio(), ProjectManager::OnStatusChange(), and ProjectManager::SetStatusText().
|
static |
Definition at line 425 of file ProjectWindow.cpp.
References Find().
|
static |
Definition at line 408 of file ProjectWindow.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), project, and anonymous_namespace{ProjectWindow.cpp}::sProjectWindowKey.
Referenced by AdornedRulerPanel::DoIdle(), Get(), GetNextWindowPlacement(), audacity::cloud::audiocom::sync::anonymous_namespace{AudioComDialogBase.cpp}::GetProjectWindow(), audacity::cloud::audiocom::sync::CloudSyncStatusField::GetStatusWidget(), audacity::cloud::audiocom::sync::HandleMixdownLink(), RealtimeEffectPanel::HidePanel(), audacity::cloud::ShareAudioToolbar::MakeShareAudioButton(), MixerBoard::MixerBoard(), ProjectManager::New(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), ProjectManager::OnCloseWindow(), ProjectManager::OnReconnectionFailure(), anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::OnSave(), audacity::cloud::audiocom::sync::anonymous_namespace{CloudSyncStatusField.cpp}::CloudSyncStatusBarFieldItem::OnSize(), PlayIndicatorOverlay::OnTimer(), TrackPanel::OnTimer(), audacity::cloud::audiocom::sync::OpenProjectFromCloud(), PlayIndicatorOverlay::PlayIndicatorOverlay(), ProjectManager::ProjectManager(), anonymous_namespace{CloudProjectFileIOExtensions.cpp}::IOExtension::SaveCloudProject(), ProjectManager::SaveWindowSize(), ScrubbingOverlay::ScrubbingOverlay(), ScrubForwarder::ScrubForwarder(), RealtimeEffectStateUI::Show(), RealtimeEffectPanel::ShowPanel(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StopScrolling(), audacity::cloud::audiocom::sync::SyncCloudProject(), SelectHandle::TimerHandler::TimerHandler(), and TrackPanel::TrackPanel().
|
static |
Definition at line 413 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 859 of file ProjectWindow.cpp.
References mContainerWindow.
Referenced by InitProjectWindow().
int ProjectWindow::GetHorizontalRange | ( | ) | const |
Definition at line 745 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 735 of file ProjectWindow.cpp.
References mHsbar.
int ProjectWindow::GetHorizontalThumbSize | ( | ) | const |
Definition at line 740 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 864 of file ProjectWindow.cpp.
References mTopPanel.
Referenced by InitProjectWindow().
int ProjectWindow::GetTotalHeight | ( | const TrackList & | trackList | ) |
Definition at line 724 of file ProjectWindow.cpp.
References ChannelView::GetTotalHeight().
wxSize ProjectWindow::GetTPTracksUsableArea | ( | ) |
int ProjectWindow::GetTrackHeight | ( | const Track & | track | ) |
Definition at line 719 of file ProjectWindow.cpp.
References ChannelView::GetChannelGroupHeight().
|
noexcept |
Track list window is the parent container for TrackPanel.
Definition at line 854 of file ProjectWindow.cpp.
References mTrackListWindow.
Referenced by InitProjectWindow().
int ProjectWindow::GetVerticalRange | ( | ) | const |
Definition at line 780 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 770 of file ProjectWindow.cpp.
References mVsbar.
int ProjectWindow::GetVerticalThumbSize | ( | ) | const |
Definition at line 775 of file ProjectWindow.cpp.
References mVsbar.
|
override |
Definition at line 1224 of file ProjectWindow.cpp.
References mActive.
|
inline |
Definition at line 56 of file ProjectWindow.h.
Referenced by anonymous_namespace{ProjectWindow.cpp}::IsWindowValid(), and OnActivate().
|
override |
Definition at line 849 of file ProjectWindow.cpp.
References mIconized.
Referenced by AdornedRulerPanel::DoIdle(), GetNextWindowPlacement(), OnMove(), and OnSize().
bool ProjectWindow::IsTrackMinimized | ( | const Track & | track | ) |
Definition at line 708 of file ProjectWindow.cpp.
References ChannelView::Get(), ChannelGroup::GetChannel(), and ChannelView::GetMinimized().
void ProjectWindow::MacShowUndockedToolbars | ( | bool | show | ) |
Definition at line 979 of file ProjectWindow.cpp.
References BasicUI::FindFocus().
Referenced by OnIconize().
unsigned ProjectWindow::MinimumTrackHeight | ( | ) |
Definition at line 703 of file ProjectWindow.cpp.
References CommonTrackInfo::MinimumTrackHeight().
int ProjectWindow::NextWindowID | ( | ) |
Definition at line 430 of file ProjectWindow.cpp.
References mNextWindowID.
void ProjectWindow::OnActivate | ( | wxActivateEvent & | event | ) |
Definition at line 1189 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), IsBeingDeleted(), mActive, project, and SetActiveProject().
void ProjectWindow::OnIconize | ( | wxIconizeEvent & | event | ) |
Definition at line 1011 of file ProjectWindow.cpp.
References AllProjects::begin(), AllProjects::end(), GetProjectFrame(), MacShowUndockedToolbars(), mIconized, and OnShow().
void ProjectWindow::OnMenu | ( | wxCommandEvent & | event | ) |
Definition at line 1148 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), CommandManager::Get(), CommandManager::GetUpdateFlags(), and project.
void ProjectWindow::OnMouseEvent | ( | wxMouseEvent & | event | ) |
Definition at line 1229 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), project, and SetActiveProject().
void ProjectWindow::OnMove | ( | wxMoveEvent & | event | ) |
Definition at line 1050 of file ProjectWindow.cpp.
References IsIconized(), and SetNormalizedWindowState().
void ProjectWindow::OnProjectTitleChange | ( | ProjectFileIOMessage | message | ) |
Definition at line 1125 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 1140 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScroll().
void ProjectWindow::OnScrollLeftButton | ( | wxScrollEvent & | event | ) |
Definition at line 675 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollLeftButton().
void ProjectWindow::OnScrollRightButton | ( | wxScrollEvent & | event | ) |
Definition at line 683 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::OnScrollRightButton().
void ProjectWindow::OnShow | ( | wxShowEvent & | event | ) |
Definition at line 1077 of file ProjectWindow.cpp.
References mShownOnce, and safenew.
Referenced by OnIconize().
void ProjectWindow::OnSize | ( | wxSizeEvent & | event | ) |
Definition at line 1057 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), Viewport::HandleResize(), IsIconized(), mShownOnce, and SetNormalizedWindowState().
|
private |
Definition at line 650 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 1117 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), Viewport::Get(), and Viewport::HandleResize().
void ProjectWindow::OnUpdateUI | ( | wxUpdateUIEvent & | event | ) |
Definition at line 1180 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), CommandManager::Get(), project, and CommandManager::UpdateMenus().
|
private |
Definition at line 1294 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 729 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 755 of file ProjectWindow.cpp.
References mHsbar.
void ProjectWindow::SetHorizontalThumbPosition | ( | int | viewStart | ) |
Definition at line 750 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 713 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 869 of file ProjectWindow.cpp.
References GetDefaultWindowRect().
void ProjectWindow::SetVerticalScrollbar | ( | int | position, |
int | thumbSize, | ||
int | range, | ||
int | pageSize, | ||
bool | refresh | ||
) |
Definition at line 790 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::SetVerticalThumbPosition | ( | int | viewStart | ) |
Definition at line 785 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::ShowHorizontalScrollbar | ( | bool | shown | ) |
Definition at line 761 of file ProjectWindow.cpp.
References mHsbar.
void ProjectWindow::ShowVerticalScrollbar | ( | bool | shown | ) |
Definition at line 796 of file ProjectWindow.cpp.
References mVsbar.
void ProjectWindow::UpdateLayout | ( | ) |
Definition at line 805 of file ProjectWindow.cpp.
References ProjectWindowBase::FindProject(), ToolManager::Get(), GetProjectPanel(), and project.
Referenced by OnViewportMessage().
|
overrideprivatevirtual |
Implements PrefsListener.
Definition at line 667 of file ProjectWindow.cpp.
References UpdateStatusWidths().
void ProjectWindow::UpdateStatusWidths | ( | ) |
Definition at line 922 of file ProjectWindow.cpp.
References ProjectStatusFieldsRegistry::Count(), CreateProjectStatusBar(), field, ProjectWindowBase::FindProject(), ProjectStatus::GetStatusWidthFunctions(), ProjectStatusFieldsRegistry::OnSize(), project, and ProjectStatusFieldsRegistry::Visit().
Referenced by InitProjectWindow(), and UpdatePrefs().
std::pair< int, int > ProjectWindow::ViewportSize | ( | ) | const |
Definition at line 691 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 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().