![]() |
Audacity 3.2.0
|
#include <ChannelView.h>
Public Types | |
enum | : unsigned { DefaultHeight = 150 } |
using | Refinement = std::vector< std::pair< wxCoord, std::shared_ptr< ChannelView > > > |
Public Member Functions | |
ChannelView (const std::shared_ptr< Track > &pTrack, size_t iChannel) | |
Construct from a track and a channel index. More... | |
virtual | ~ChannelView ()=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< ChannelVRulerControls > | GetVRulerControls () |
std::shared_ptr< const ChannelVRulerControls > | 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, size_t iChannel) | |
Construct from a track and a channel index. More... | |
CommonTrackCell (ChannelGroup &group, size_t iChannel) | |
Construct from a channel group and a channel index. More... | |
~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... | |
size_t | GetChannelIndex () const |
std::shared_ptr< Channel > | FindChannel () |
May return null. More... | |
std::shared_ptr< const Channel > | FindChannel () const |
May return null. 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 &)=delete | |
TrackPanelCell & | operator= (const TrackPanelCell &)=delete |
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 ChannelView & | Get (Channel &channel) |
static const ChannelView & | Get (const Channel &channel) |
static ChannelView * | Find (Channel *pChannel) |
static const ChannelView * | Find (const Channel *pChannel) |
static int | GetChannelGroupHeight (const Track *pTrack) |
static int | GetCumulativeHeight (const Channel *pChannel) |
static int | GetCumulativeHeight (const Track *pTrack) |
static int | GetTotalHeight (const TrackList &list) |
![]() | |
static wxRect | MaximizeWidth (const wxRect &rect, const wxRect &panelRect) |
static wxRect | MaximizeHeight (const wxRect &rect, const wxRect &panelRect) |
Public Attributes | |
std::pair< int, int > | vrulerSize |
Protected Member Functions | |
virtual std::shared_ptr< ChannelVRulerControls > | 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< ChannelVRulerControls > | mpVRulerControls |
Private Member Functions | |
ChannelView (const ChannelView &)=delete | |
ChannelView & | operator= (const ChannelView &)=delete |
void | DoSetY (int y) |
void | DoSetHeight (int h) |
Static Private Member Functions | |
static ChannelView & | GetFromChannelGroup (ChannelGroup &group, size_t iChannel=0) |
static const ChannelView & | GetFromChannelGroup (const ChannelGroup &group, size_t iChannel=0) |
static ChannelView * | FindFromChannelGroup (ChannelGroup *pGroup, size_t iChannel=0) |
Private Attributes | |
bool | mMinimized { false } |
int | mY { 0 } |
int | mHeight { DefaultHeight } |
Definition at line 24 of file ChannelView.h.
using ChannelView::Refinement = std::vector< std::pair<wxCoord, std::shared_ptr<ChannelView> > > |
Definition at line 118 of file ChannelView.h.
anonymous enum : unsigned |
|
privatedelete |
ChannelView::ChannelView | ( | const std::shared_ptr< Track > & | pTrack, |
size_t | iChannel | ||
) |
Construct from a track and a channel index.
Definition at line 21 of file ChannelView.cpp.
References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), and DoSetHeight().
|
pure virtual |
Definition at line 28 of file ChannelView.cpp.
|
overridevirtual |
Copy state, for undo/redo purposes.
Reimplemented from TrackAttachment.
Definition at line 60 of file ChannelView.cpp.
References GetFromChannelGroup(), mHeight, mMinimized, and vrulerSize.
Referenced by LabelTrackView::CopyTo(), and WaveChannelView::CopyTo().
|
protectedpure virtual |
Implemented in LabelTrackView, NoteTrackView, SpectrumView, WaveChannelView, WaveformView, and TimeTrackView.
Referenced by GetVRulerControls().
|
private |
Definition at line 209 of file ChannelView.cpp.
References mHeight.
Referenced by ChannelView(), and SetExpandedHeight().
|
virtual |
Reimplemented in SpectrumView, WaveChannelView, and WaveformView.
Definition at line 171 of file ChannelView.cpp.
References mMinimized.
Referenced by WaveChannelView::BuildSubViews(), SpectrumView::DoSetMinimized(), WaveChannelView::DoSetMinimized(), WaveformView::DoSetMinimized(), and SetMinimized().
|
private |
Definition at line 190 of file ChannelView.cpp.
References mY.
|
static |
!pChannel || dynamic_cast<Track*>(&pChannel->GetChannelGroup()) != nullptr
Definition at line 230 of file ChannelView.cpp.
References FindFromChannelGroup(), Channel::GetChannelGroup(), and Channel::GetChannelIndex().
Referenced by Find(), and WaveChannelView::Find().
|
static |
Definition at line 238 of file ChannelView.cpp.
References Find().
|
staticprivate |
!pGroup || iChannel < pGroup->NChannels()
Definition at line 98 of file ChannelView.cpp.
References ChannelAttachments< Attachment >::Find(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and keyC.
Referenced by Find().
|
static |
dynamic_cast<Track*>(&channel.GetChannelGroup()) != nullptr
Definition at line 219 of file ChannelView.cpp.
References Channel::GetChannelGroup(), Channel::GetChannelIndex(), and GetFromChannelGroup().
Referenced by anonymous_namespace{WaveChannelView.cpp}::AnyAffordance(), SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Cancel(), anonymous_namespace{TrackPanel.cpp}::Subgroup::Children(), anonymous_namespace{TrackPanel.cpp}::ChannelStack::Children(), TrackPanelResizeHandle::Click(), LabelDefaultClickHandle::Click(), MinimizeButtonHandle::CommitChanges(), LabelTrackView::CopyTo(), WaveChannelView::CopyTo(), ProjectAudioManager::DoRecord(), SpectrumVRulerControls::DoUpdateVRuler(), WaveformVRulerControls::DoUpdateVRuler(), TrackPanelResizeHandle::Drag(), anonymous_namespace{TrackPanel.cpp}::ChannelStack::Draw(), TimeTrackVRulerControls::Draw(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), anonymous_namespace{WaveTrackAffordanceControls.cpp}::FindAffordance(), anonymous_namespace{SpectralDataManager.cpp}::FindSpectralData(), SpectrumView::ForAll(), Get(), LabelTrackView::Get(), WaveChannelView::Get(), GetCumulativeHeight(), TrackPanel::GetFocusedCell(), NoteTrackAffordanceControls::HitTest(), WaveTrackAffordanceControls::HitTest(), ProjectWindow::IsTrackMinimized(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), WaveTrackMenuTable::OnMergeStereo(), ScreenshotBigDialog::OnShortTracks(), SelectHandle::TimerHandler::OnTimer(), TrackPanel::OnTrackMenu(), anonymous_namespace{ChannelView.cpp}::TrackPositioner::OnUpdate(), SpectralDataManager::ProcessTracks(), TrackPanel::RefreshTrack(), ProjectWindow::SetChannelHeights(), ProjectWindow::SetMinimized(), ScreenshotBigDialog::SizeTracks(), WaveTrackMenuTable::SplitStereo(), MinimizeButtonHandle::Tip(), TrackPanelResizeHandle::TrackPanelResizeHandle(), NoteTrackVRulerControls::UpdateRuler(), TimeTrackVRulerControls::UpdateRuler(), TrackPanel::UpdateTrackVRuler(), and TrackPanel::UpdateVRulerSize().
|
static |
dynamic_cast<Track*>(&channel.GetChannelGroup()) != nullptr
Definition at line 225 of file ChannelView.cpp.
References Get().
|
virtual |
Reimplemented in NoteTrackView, and WaveChannelView.
Definition at line 214 of file ChannelView.cpp.
|
static |
Definition at line 32 of file ChannelView.cpp.
References TrackList::Channels(), GetFromChannelGroup(), and GetHeight().
Referenced by TrackSelectHandle::CalculateRearrangingThresholds(), ProjectWindow::GetTrackHeight(), and TrackPanel::RefreshTrack().
|
static |
Definition at line 40 of file ChannelView.cpp.
References Get().
Referenced by GetTotalHeight(), and anonymous_namespace{ChannelView.cpp}::TrackPositioner::OnUpdate().
|
static |
Definition at line 48 of file ChannelView.cpp.
|
inline |
GetHeight()
of all preceding tracks Definition at line 72 of file ChannelView.h.
|
inline |
See other comments for GetHeight
Definition at line 76 of file ChannelView.h.
Referenced by WriteXMLAttributes().
|
staticprivate |
iChannel < group.NChannels()
Definition at line 85 of file ChannelView.cpp.
References ChannelAttachments< Attachment >::Get(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and keyC.
Referenced by CopyTo(), Get(), GetChannelGroupHeight(), and GetFromChannelGroup().
|
staticprivate |
Definition at line 92 of file ChannelView.cpp.
References GetFromChannelGroup(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
int ChannelView::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 195 of file ChannelView.cpp.
References GetMinimized(), GetMinimizedHeight(), and mHeight.
Referenced by TrackPanelResizeHandle::Click(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), GetChannelGroupHeight(), and WaveTrackMenuTable::OnMergeStereo().
|
inline |
Definition at line 68 of file ChannelView.h.
Referenced by WaveChannelView::BuildSubViews(), MinimizeButtonHandle::CommitChanges(), GetHeight(), ProjectWindow::IsTrackMinimized(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), WaveTrackMenuTable::OnMergeStereo(), MinimizeButtonHandle::Tip(), and WriteXMLAttributes().
|
pure virtual |
See other comments for GetHeight
Implemented in CommonChannelView.
Referenced by GetHeight().
|
virtual |
Reimplemented in WaveChannelView.
Definition at line 161 of file ChannelView.cpp.
Referenced by anonymous_namespace{TrackPanel.cpp}::ChannelStack::Children().
|
static |
Definition at line 55 of file ChannelView.cpp.
References GetCumulativeHeight(), and TrackList::rbegin().
Referenced by ProjectWindow::GetTotalHeight().
std::shared_ptr< ChannelVRulerControls > ChannelView::GetVRulerControls | ( | ) |
Definition at line 176 of file ChannelView.cpp.
References DoGetVRulerControls(), and mpVRulerControls.
Referenced by ChannelVRulerControls::Get(), and GetVRulerControls().
std::shared_ptr< const ChannelVRulerControls > ChannelView::GetVRulerControls | ( | ) | const |
Definition at line 185 of file ChannelView.cpp.
References GetVRulerControls().
|
overridevirtual |
Deserialize an attribute, returning true if recognized.
default recognizes no attributes, and returns false
Reimplemented from TrackAttachment.
Definition at line 140 of file ChannelView.cpp.
References anonymous_namespace{ChannelView.cpp}::HeightAttributeName(), min(), anonymous_namespace{ChannelView.cpp}::MinimizedAttributeName(), SetExpandedHeight(), SetMinimized(), and XMLAttributeValueView::TryGet().
|
virtual |
Reimplemented in SpectrumView.
Definition at line 166 of file ChannelView.cpp.
Referenced by anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView(), and anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView().
|
privatedelete |
|
inline |
Set cached value dependent on position within the track list.
Definition at line 94 of file ChannelView.h.
void ChannelView::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 203 of file ChannelView.cpp.
References DoSetHeight(), and CommonTrackPanelCell::FindTrack().
Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Click(), HandleXMLAttribute(), ProjectWindow::SetChannelHeights(), ScreenshotBigDialog::SizeTracks(), and WaveTrackMenuTable::SplitStereo().
void ChannelView::SetMinimized | ( | bool | minimized | ) |
Definition at line 105 of file ChannelView.cpp.
References TrackList::Channels(), DoSetMinimized(), and CommonTrackPanelCell::FindTrack().
Referenced by MinimizeButtonHandle::CommitChanges(), ProjectAudioManager::DoRecord(), HandleXMLAttribute(), and ProjectWindow::SetMinimized().
|
overridevirtual |
Serialize persistent attributes.
default does nothing
Reimplemented from TrackAttachment.
Definition at line 134 of file ChannelView.cpp.
References GetExpandedHeight(), GetMinimized(), anonymous_namespace{ChannelView.cpp}::HeightAttributeName(), anonymous_namespace{ChannelView.cpp}::MinimizedAttributeName(), and XMLWriter::WriteAttr().
|
private |
Definition at line 164 of file ChannelView.h.
Referenced by CopyTo(), DoSetHeight(), and GetHeight().
|
private |
Definition at line 162 of file ChannelView.h.
Referenced by CopyTo(), and DoSetMinimized().
|
protected |
Definition at line 143 of file ChannelView.h.
Referenced by GetVRulerControls().
|
private |
Definition at line 163 of file ChannelView.h.
Referenced by DoSetY().
|
mutable |
Definition at line 128 of file ChannelView.h.
Referenced by CopyTo(), SpectrumVRulerControls::DoUpdateVRuler(), WaveformVRulerControls::DoUpdateVRuler(), TimeTrackVRulerControls::Draw(), NoteTrackVRulerControls::UpdateRuler(), TimeTrackVRulerControls::UpdateRuler(), and TrackPanel::UpdateVRulerSize().