![]() |
Audacity 3.2.0
|
#include <TrackView.h>
Public Types | |
enum | : unsigned { DefaultHeight = 150 } |
using | Refinement = std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > > |
Public Member Functions | |
TrackView (const std::shared_ptr< Track > &pTrack) | |
virtual | ~TrackView ()=0 |
void | CopyTo (Track &track) const override |
Copy state, for undo/redo purposes. More... | |
bool | GetMinimized () const |
void | SetMinimized (bool minimized) |
int | GetCumulativeHeightBefore () const |
int | GetExpandedHeight () const |
virtual int | GetMinimizedHeight () const =0 |
int | GetHeight () const |
void | SetCumulativeHeightBefore (int y) |
Set cached value dependent on position within the track list. More... | |
void | SetExpandedHeight (int height) |
std::shared_ptr< TrackVRulerControls > | GetVRulerControls () |
std::shared_ptr< const TrackVRulerControls > | GetVRulerControls () const |
virtual std::shared_ptr< CommonTrackCell > | GetAffordanceControls () |
void | WriteXMLAttributes (XMLWriter &) const override |
Serialize persistent attributes. More... | |
bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) override |
Deserialize an attribute, returning true if recognized. More... | |
virtual Refinement | GetSubViews (const wxRect &rect) |
virtual bool | IsSpectral () const |
virtual void | DoSetMinimized (bool isMinimized) |
![]() | |
CommonTrackCell (const std::shared_ptr< Track > &pTrack) | |
~CommonTrackCell () | |
std::shared_ptr< Track > | DoFindTrack () override |
void | Reparent (const std::shared_ptr< Track > &parent) override |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
![]() | |
CommonTrackPanelCell () | |
virtual | ~CommonTrackPanelCell ()=0 |
HitTestPreview | DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override |
std::shared_ptr< Track > | FindTrack () |
std::shared_ptr< const Track > | FindTrack () const |
virtual std::vector< MenuItem > | GetMenuItems (const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject) |
Return a list of items for DoContextMenu() (empties for separators) More... | |
![]() | |
TrackPanelCell ()=default | |
TrackPanelCell (const TrackPanelCell &) PROHIBITED | |
TrackPanelCell & | operator= (const TrackPanelCell &) PROHIBITED |
virtual | ~TrackPanelCell ()=0 |
virtual HitTestPreview | DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject) |
virtual std::vector< UIHandlePtr > | HitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0 |
virtual unsigned | HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) |
virtual std::shared_ptr< TrackPanelCell > | ContextMenuDelegate () |
virtual unsigned | DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) |
virtual unsigned | CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project) |
virtual unsigned | LoseFocus (AudacityProject *project) |
![]() | |
TrackPanelNode () | |
virtual | ~TrackPanelNode ()=0 |
![]() | |
virtual | ~TrackPanelDrawable ()=0 |
virtual void | Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) |
virtual wxRect | DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) |
![]() | |
virtual | ~TrackAttachment () |
virtual void | CopyTo (Track &track) const |
Copy state, for undo/redo purposes. More... | |
virtual void | Reparent (const std::shared_ptr< Track > &parent) |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
virtual void | WriteXMLAttributes (XMLWriter &) const |
Serialize persistent attributes. More... | |
virtual bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
Deserialize an attribute, returning true if recognized. More... | |
![]() | |
virtual | ~Base () |
Static Public Member Functions | |
static int | GetTrackHeight (const Track *pTrack) |
static int | GetChannelGroupHeight (const Track *pTrack) |
static int | GetCumulativeHeight (const Track *pTrack) |
static int | GetTotalHeight (const TrackList &list) |
static TrackView & | Get (Track &) |
static const TrackView & | Get (const Track &) |
static TrackView * | Find (Track *) |
static const TrackView * | Find (const Track *) |
![]() | |
static wxRect | MaximizeWidth (const wxRect &rect, const wxRect &panelRect) |
static wxRect | MaximizeHeight (const wxRect &rect, const wxRect &panelRect) |
Protected Member Functions | |
virtual std::shared_ptr< TrackVRulerControls > | DoGetVRulerControls ()=0 |
![]() | |
virtual std::shared_ptr< Track > | DoFindTrack ()=0 |
unsigned | DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override |
unsigned | HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override |
Protected Attributes | |
std::shared_ptr< TrackVRulerControls > | mpVRulerControls |
Private Member Functions | |
TrackView (const TrackView &)=delete | |
TrackView & | operator= (const TrackView &)=delete |
void | DoSetY (int y) |
void | DoSetHeight (int h) |
Private Attributes | |
bool | mMinimized { false } |
int | mY { 0 } |
int | mHeight { DefaultHeight } |
Definition at line 23 of file TrackView.h.
using TrackView::Refinement = std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > > |
Definition at line 102 of file TrackView.h.
anonymous enum : unsigned |
|
privatedelete |
|
explicit |
Definition at line 19 of file TrackView.cpp.
References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), and DoSetHeight().
|
pure virtual |
Definition at line 25 of file TrackView.cpp.
|
overridevirtual |
Copy state, for undo/redo purposes.
Reimplemented from TrackAttachment.
Definition at line 52 of file TrackView.cpp.
References Get(), mHeight, and mMinimized.
Referenced by LabelTrackView::CopyTo(), and WaveTrackView::CopyTo().
|
protectedpure virtual |
Implemented in LabelTrackView, NoteTrackView, SpectrumView, WaveformView, WaveTrackView, and TimeTrackView.
Referenced by GetVRulerControls().
|
private |
Definition at line 178 of file TrackView.cpp.
References mHeight.
Referenced by SetExpandedHeight(), and TrackView().
|
virtual |
Reimplemented in SpectrumView, WaveformView, and WaveTrackView.
Definition at line 141 of file TrackView.cpp.
References mMinimized.
Referenced by WaveTrackView::BuildSubViews(), SpectrumView::DoSetMinimized(), WaveformView::DoSetMinimized(), WaveTrackView::DoSetMinimized(), and SetMinimized().
|
private |
Definition at line 159 of file TrackView.cpp.
References mY.
Definition at line 88 of file TrackView.cpp.
References Find().
Definition at line 79 of file TrackView.cpp.
References key.
Referenced by Find(), and WaveTrackView::Find().
Definition at line 74 of file TrackView.cpp.
References Get().
Definition at line 69 of file TrackView.cpp.
References key.
Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Cancel(), anonymous_namespace{TrackPanel.cpp}::Subgroup::Children(), anonymous_namespace{TrackPanel.cpp}::ChannelGroup::Children(), TrackPanelResizeHandle::Click(), LabelDefaultClickHandle::Click(), MinimizeButtonHandle::CommitChanges(), WaveTrackView::CopySelectedText(), LabelTrackView::CopyTo(), WaveTrackView::CopyTo(), CopyTo(), WaveTrackView::CutSelectedText(), ProjectAudioManager::DoRecord(), anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), TrackPanelResizeHandle::Drag(), anonymous_namespace{TrackPanel.cpp}::ChannelGroup::Draw(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::FindAffordance(), SpectrumView::ForAll(), Get(), LabelTrackView::Get(), WaveTrackView::Get(), GetCumulativeHeight(), TrackPanel::GetFocusedCell(), GetTrackHeight(), NoteTrackAffordanceControls::HitTest(), WaveTrackAffordanceControls::HitTest(), TrackInfo::MinimizeSyncLockDrawFunction(), ViewActions::Handler::OnCollapseAllTracks(), ViewActions::Handler::OnExpandAllTracks(), WaveTrackMenuTable::OnMergeStereo(), anonymous_namespace{Printing.cpp}::AudacityPrintout::OnPrintPage(), ScreenshotBigDialog::OnShortTracks(), SelectHandle::TimerHandler::OnTimer(), TrackPanel::OnTrackMenu(), anonymous_namespace{TrackView.cpp}::TrackPositioner::OnUpdate(), WaveTrackView::PasteText(), SpectralDataManager::ProcessTracks(), TrackPanel::RefreshTrack(), WaveTrackView::SelectAllText(), ScreenshotBigDialog::SizeTracks(), WaveTrackMenuTable::SplitStereo(), MinimizeButtonHandle::Tip(), TrackPanelResizeHandle::TrackPanelResizeHandle(), and TrackPanel::UpdateTrackVRuler().
|
virtual |
Reimplemented in NoteTrackView, and WaveTrackView.
Definition at line 183 of file TrackView.cpp.
|
static |
Definition at line 34 of file TrackView.cpp.
References TrackList::Channels(), and GetTrackHeight().
Referenced by TrackSelectHandle::CalculateRearrangingThresholds(), and TrackPanel::VerticalScroll().
|
static |
Definition at line 39 of file TrackView.cpp.
References Get().
Referenced by GetTotalHeight(), and anonymous_namespace{TrackView.cpp}::TrackPositioner::OnUpdate().
|
inline |
|
inline |
See other comments for GetHeight
Definition at line 60 of file TrackView.h.
Referenced by WriteXMLAttributes().
int TrackView::GetHeight | ( | ) | const |
Total "height" of channels of a track includes padding areas above and below it, and is pixel-accurate for the channel group. The "heights" of channels within a group determine the proportions of heights of the track data shown – but the actual total pixel heights may differ when other fixed-height adornments and paddings are added, according to other rules for allocation of height.
Definition at line 164 of file TrackView.cpp.
References GetMinimized(), GetMinimizedHeight(), and mHeight.
Referenced by TrackPanelResizeHandle::Click(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), and GetTrackHeight().
|
inline |
Definition at line 52 of file TrackView.h.
Referenced by WaveTrackView::BuildSubViews(), TrackPanelResizeHandle::Click(), MinimizeButtonHandle::CommitChanges(), anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), GetHeight(), TrackInfo::MinimizeSyncLockDrawFunction(), WaveTrackMenuTable::OnMergeStereo(), MinimizeButtonHandle::Tip(), and WriteXMLAttributes().
|
pure virtual |
See other comments for GetHeight
Implemented in CommonTrackView.
Referenced by GetHeight().
|
virtual |
Reimplemented in WaveTrackView.
Definition at line 131 of file TrackView.cpp.
Referenced by anonymous_namespace{TrackPanel.cpp}::ChannelGroup::Children().
|
static |
Definition at line 47 of file TrackView.cpp.
References TrackList::Any(), and GetCumulativeHeight().
Referenced by ProjectWindow::FixScrollbars(), and anonymous_namespace{Printing.cpp}::AudacityPrintout::OnPrintPage().
|
static |
Definition at line 29 of file TrackView.cpp.
References Get(), and GetHeight().
Referenced by anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), GetChannelGroupHeight(), TrackPanel::OnEnsureVisible(), and TrackPanel::RefreshTrack().
std::shared_ptr< TrackVRulerControls > TrackView::GetVRulerControls | ( | ) |
Definition at line 146 of file TrackView.cpp.
References DoGetVRulerControls(), and mpVRulerControls.
Referenced by TrackVRulerControls::Get(), and GetVRulerControls().
std::shared_ptr< const TrackVRulerControls > TrackView::GetVRulerControls | ( | ) | const |
Definition at line 154 of file TrackView.cpp.
References GetVRulerControls().
|
overridevirtual |
Deserialize an attribute, returning true if recognized.
default recognizes no attributes, and returns false
Reimplemented from TrackAttachment.
Definition at line 110 of file TrackView.cpp.
References min(), SetExpandedHeight(), SetMinimized(), and XMLAttributeValueView::TryGet().
|
virtual |
Reimplemented in SpectrumView.
Definition at line 136 of file TrackView.cpp.
Referenced by anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView(), and anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView().
|
inline |
Set cached value dependent on position within the track list.
Definition at line 78 of file TrackView.h.
void TrackView::SetExpandedHeight | ( | int | height | ) |
Sets height for expanded state. Does not expand a track if it is now collapsed. See other comments for GetHeight
Definition at line 172 of file TrackView.cpp.
References DoSetHeight(), and CommonTrackPanelCell::FindTrack().
Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Click(), anonymous_namespace{ViewMenus.cpp}::DoZoomFitV(), HandleXMLAttribute(), ScreenshotBigDialog::SizeTracks(), and WaveTrackMenuTable::SplitStereo().
void TrackView::SetMinimized | ( | bool | minimized | ) |
Definition at line 93 of file TrackView.cpp.
References TrackList::Channels(), DoSetMinimized(), and CommonTrackPanelCell::FindTrack().
Referenced by MinimizeButtonHandle::CommitChanges(), ProjectAudioManager::DoRecord(), HandleXMLAttribute(), ViewActions::Handler::OnCollapseAllTracks(), and ViewActions::Handler::OnExpandAllTracks().
|
overridevirtual |
Serialize persistent attributes.
default does nothing
Reimplemented from TrackAttachment.
Definition at line 104 of file TrackView.cpp.
References GetExpandedHeight(), GetMinimized(), XMLWriter::WriteAttr(), and wxT().
|
private |
Definition at line 130 of file TrackView.h.
Referenced by CopyTo(), DoSetHeight(), and GetHeight().
|
private |
Definition at line 128 of file TrackView.h.
Referenced by CopyTo(), and DoSetMinimized().
|
protected |
Definition at line 125 of file TrackView.h.
Referenced by GetVRulerControls().
|
private |
Definition at line 129 of file TrackView.h.
Referenced by DoSetY().