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< Channel > &pChannel) | |
virtual | ~ChannelView ()=0 |
void | Reparent (const std::shared_ptr< Track > &parent, size_t iChannel) override |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
void | CopyTo (Track &track, size_t iChannel) 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 &writer, size_t iChannel) const override |
Serialize persistent attributes. More... | |
bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView, size_t iChannel) override |
Deserialize an attribute, returning true if recognized. More... | |
virtual Refinement | GetSubViews (const wxRect &rect) |
virtual bool | IsSpectral () const |
virtual void | DoSetMinimized (bool isMinimized) |
Public Member Functions inherited from CommonChannelCell | |
CommonChannelCell (const std::shared_ptr< Channel > &pChannel) | |
Construct from a channel. More... | |
~CommonChannelCell () | |
std::shared_ptr< Track > | DoFindTrack () override |
void | Reparent (const std::shared_ptr< Track > &parent, size_t iChannel) override |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
template<typename Subtype = Channel> | |
auto | FindChannel () -> std::shared_ptr< Subtype > |
May return null. More... | |
template<typename Subtype = const Channel> | |
auto | FindChannel () const -> std::enable_if_t< std::is_const_v< Subtype >, std::shared_ptr< Subtype > > |
May return null. More... | |
Public Member Functions inherited from CommonTrackPanelCell | |
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... | |
Public Member Functions inherited from TrackPanelCell | |
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) |
Public Member Functions inherited from TrackPanelNode | |
TrackPanelNode () | |
virtual | ~TrackPanelNode ()=0 |
Public Member Functions inherited from TrackPanelDrawable | |
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) |
Public Member Functions inherited from ChannelAttachment | |
virtual | ~ChannelAttachment () |
virtual void | CopyTo (Track &track, size_t iChannel) const |
Copy state, for undo/redo purposes. More... | |
virtual void | Reparent (const std::shared_ptr< Track > &parent, size_t iChannel) |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More... | |
virtual void | WriteXMLAttributes (XMLWriter &writer, size_t iChannel) const |
Serialize persistent attributes. More... | |
virtual bool | HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView, size_t iChannel) |
Deserialize an attribute, returning true if recognized. More... | |
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 Public Member Functions inherited from TrackPanelDrawable | |
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 |
Protected Member Functions inherited from CommonTrackPanelCell | |
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 | AdjustPositions () |
void | DoSetY (int y) |
void | DoSetHeight (int h) |
Static Private Member Functions | |
static ChannelView & | GetFromChannelGroup (ChannelGroup &group, size_t iChannel) |
static ChannelView * | FindFromChannelGroup (ChannelGroup *pGroup, size_t iChannel=0) |
Private Attributes | |
bool | mMinimized { false } |
int | mY { 0 } |
int | mHeight { DefaultHeight } |
Definition at line 23 of file ChannelView.h.
using ChannelView::Refinement = std::vector< std::pair<wxCoord, std::shared_ptr<ChannelView> > > |
Definition at line 119 of file ChannelView.h.
anonymous enum : unsigned |
|
privatedelete |
|
explicit |
Definition at line 21 of file ChannelView.cpp.
References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), and DoSetHeight().
|
pure virtual |
Definition at line 27 of file ChannelView.cpp.
|
private |
Definition at line 113 of file ChannelView.cpp.
References CommonTrackPanelCell::FindTrack().
Referenced by SetExpandedHeight(), and SetMinimized().
|
overridevirtual |
Copy state, for undo/redo purposes.
iChannel | position of the attachment's channel in the group The default does nothing |
Reimplemented from ChannelAttachment.
Definition at line 67 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 213 of file ChannelView.cpp.
References mHeight.
Referenced by ChannelView(), and SetExpandedHeight().
|
virtual |
Reimplemented in SpectrumView, WaveChannelView, and WaveformView.
Definition at line 175 of file ChannelView.cpp.
References mMinimized.
Referenced by WaveChannelView::BuildSubViews(), SpectrumView::DoSetMinimized(), WaveChannelView::DoSetMinimized(), WaveformView::DoSetMinimized(), and SetMinimized().
|
private |
Definition at line 194 of file ChannelView.cpp.
References mY.
|
static |
!pChannel || dynamic_cast<Track*>(&pChannel->GetChannelGroup()) != nullptr
Definition at line 234 of file ChannelView.cpp.
References FindFromChannelGroup(), Channel::GetChannelGroup(), and Channel::GetChannelIndex().
Referenced by Find(), and WaveChannelView::Find().
|
static |
Definition at line 242 of file ChannelView.cpp.
References Find().
|
staticprivate |
!pGroup || iChannel < pGroup->NChannels()
Definition at line 99 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 223 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(), CommonTrackInfo::CloseTitleDrawFunction(), 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}::FindAdjustedChannelHeights(), anonymous_namespace{SpectralDataManager.cpp}::FindSpectralData(), SpectrumView::ForAll(), Get(), LabelTrackView::Get(), WaveChannelView::Get(), GetChannelGroupHeight(), TrackPanel::GetFocusedCell(), NoteTrackAffordanceControls::HitTest(), ProjectWindow::IsTrackMinimized(), WaveTrackMenuTable::OnMergeStereo(), SelectHandle::TimerHandler::OnTimer(), TrackPanel::OnTrackMenu(), anonymous_namespace{ChannelView.cpp}::TrackPositioner::OnUpdate(), SpectralDataManager::ProcessTracks(), TrackPanel::RefreshTrack(), ProjectWindow::SetChannelHeights(), ProjectWindow::SetMinimized(), 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 229 of file ChannelView.cpp.
References Get().
|
virtual |
Reimplemented in NoteTrackView, and WaveChannelView.
Definition at line 218 of file ChannelView.cpp.
|
static |
Definition at line 39 of file ChannelView.cpp.
References ChannelGroup::Channels(), Get(), and GetHeight().
Referenced by TrackSelectHandle::CalculateRearrangingThresholds(), ProjectWindow::GetTrackHeight(), and TrackPanel::RefreshTrack().
|
static |
Definition at line 47 of file ChannelView.cpp.
Referenced by GetCumulativeHeight(), GetTotalHeight(), and anonymous_namespace{ChannelView.cpp}::TrackPositioner::OnUpdate().
|
static |
Definition at line 55 of file ChannelView.cpp.
References ChannelGroup::Channels(), and GetCumulativeHeight().
|
inline |
GetHeight()
of all preceding tracks Definition at line 73 of file ChannelView.h.
|
inline |
See other comments for GetHeight
Definition at line 77 of file ChannelView.h.
Referenced by WriteXMLAttributes().
|
staticprivate |
iChannel < group.NChannels()
Definition at line 92 of file ChannelView.cpp.
References ChannelAttachments< Attachment >::Get(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and keyC.
Referenced by CopyTo(), and Get().
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 199 of file ChannelView.cpp.
References GetMinimized(), GetMinimizedHeight(), and mHeight.
Referenced by TrackPanelResizeHandle::Click(), GetChannelGroupHeight(), and WaveTrackMenuTable::OnMergeStereo().
|
inline |
Definition at line 69 of file ChannelView.h.
Referenced by WaveChannelView::BuildSubViews(), CommonTrackInfo::CloseTitleDrawFunction(), MinimizeButtonHandle::CommitChanges(), GetHeight(), ProjectWindow::IsTrackMinimized(), 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 165 of file ChannelView.cpp.
Referenced by anonymous_namespace{TrackPanel.cpp}::ChannelStack::Children().
|
static |
Definition at line 62 of file ChannelView.cpp.
References GetCumulativeHeight(), and TrackList::rbegin().
Referenced by ProjectWindow::GetTotalHeight().
std::shared_ptr< ChannelVRulerControls > ChannelView::GetVRulerControls | ( | ) |
Definition at line 180 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 189 of file ChannelView.cpp.
References GetVRulerControls().
|
overridevirtual |
Deserialize an attribute, returning true if recognized.
default recognizes no attributes, and returns false
Reimplemented from ChannelAttachment.
Definition at line 143 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 170 of file ChannelView.cpp.
Referenced by anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView(), and anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView().
|
privatedelete |
|
overridevirtual |
Object may be shared among tracks but hold a special back-pointer to one of them; reassign it.
iChannel | position of the attachment's channel in the group The default does nothing |
Reimplemented from ChannelAttachment.
Definition at line 31 of file ChannelView.cpp.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, mpVRulerControls, and CommonChannelCell::Reparent().
Referenced by LabelTrackView::Reparent(), and WaveChannelView::Reparent().
|
inline |
Set cached value dependent on position within the track list.
Definition at line 95 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 207 of file ChannelView.cpp.
References AdjustPositions(), and DoSetHeight().
Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Click(), HandleXMLAttribute(), ProjectWindow::SetChannelHeights(), and WaveTrackMenuTable::SplitStereo().
void ChannelView::SetMinimized | ( | bool | minimized | ) |
Definition at line 106 of file ChannelView.cpp.
References AdjustPositions(), and DoSetMinimized().
Referenced by MinimizeButtonHandle::CommitChanges(), ProjectAudioManager::DoRecord(), HandleXMLAttribute(), and ProjectWindow::SetMinimized().
|
overridevirtual |
Serialize persistent attributes.
default does nothing
Reimplemented from ChannelAttachment.
Definition at line 137 of file ChannelView.cpp.
References GetExpandedHeight(), GetMinimized(), anonymous_namespace{ChannelView.cpp}::HeightAttributeName(), anonymous_namespace{ChannelView.cpp}::MinimizedAttributeName(), and XMLWriter::WriteAttr().
|
private |
Definition at line 160 of file ChannelView.h.
Referenced by CopyTo(), DoSetHeight(), and GetHeight().
|
private |
Definition at line 158 of file ChannelView.h.
Referenced by CopyTo(), and DoSetMinimized().
|
protected |
Definition at line 144 of file ChannelView.h.
Referenced by GetVRulerControls(), and Reparent().
|
private |
Definition at line 159 of file ChannelView.h.
Referenced by DoSetY().
|
mutable |
Definition at line 129 of file ChannelView.h.
Referenced by CopyTo(), SpectrumVRulerControls::DoUpdateVRuler(), WaveformVRulerControls::DoUpdateVRuler(), TimeTrackVRulerControls::Draw(), NoteTrackVRulerControls::UpdateRuler(), TimeTrackVRulerControls::UpdateRuler(), and TrackPanel::UpdateVRulerSize().