Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ChannelView Class Referenceabstract

#include <ChannelView.h>

Inheritance diagram for ChannelView:
[legend]
Collaboration diagram for ChannelView:
[legend]

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< ChannelVRulerControlsGetVRulerControls ()
 
std::shared_ptr< const ChannelVRulerControlsGetVRulerControls () const
 
virtual std::shared_ptr< CommonTrackCellGetAffordanceControls ()
 
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)
 
- Public Member Functions inherited from CommonTrackCell
 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< TrackDoFindTrack () 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< ChannelFindChannel ()
 May return null. More...
 
std::shared_ptr< const ChannelFindChannel () const
 May return null. More...
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
 
std::shared_ptr< TrackFindTrack ()
 
std::shared_ptr< const TrackFindTrack () const
 
virtual std::vector< MenuItemGetMenuItems (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
 
TrackPanelCelloperator= (const TrackPanelCell &)=delete
 
virtual ~TrackPanelCell ()=0
 
virtual HitTestPreview DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject)
 
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0
 
virtual unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject)
 
virtual std::shared_ptr< TrackPanelCellContextMenuDelegate ()
 
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 TrackAttachment
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...
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static ChannelViewGet (Channel &channel)
 
static const ChannelViewGet (const Channel &channel)
 
static ChannelViewFind (Channel *pChannel)
 
static const ChannelViewFind (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< ChannelVRulerControlsDoGetVRulerControls ()=0
 
- Protected Member Functions inherited from CommonTrackPanelCell
virtual std::shared_ptr< TrackDoFindTrack ()=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< ChannelVRulerControlsmpVRulerControls
 

Private Member Functions

 ChannelView (const ChannelView &)=delete
 
ChannelViewoperator= (const ChannelView &)=delete
 
void DoSetY (int y)
 
void DoSetHeight (int h)
 

Static Private Member Functions

static ChannelViewGetFromChannelGroup (ChannelGroup &group, size_t iChannel=0)
 
static const ChannelViewGetFromChannelGroup (const ChannelGroup &group, size_t iChannel=0)
 
static ChannelViewFindFromChannelGroup (ChannelGroup *pGroup, size_t iChannel=0)
 

Private Attributes

bool mMinimized { false }
 
int mY { 0 }
 
int mHeight { DefaultHeight }
 

Detailed Description

Definition at line 24 of file ChannelView.h.

Member Typedef Documentation

◆ Refinement

using ChannelView::Refinement = std::vector< std::pair<wxCoord, std::shared_ptr<ChannelView> > >

Definition at line 118 of file ChannelView.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned
Enumerator
DefaultHeight 

Definition at line 31 of file ChannelView.h.

31: unsigned { DefaultHeight = 150 };

Constructor & Destructor Documentation

◆ ChannelView() [1/2]

ChannelView::ChannelView ( const ChannelView )
privatedelete

◆ ChannelView() [2/2]

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.

22 : CommonTrackCell{ pTrack, iChannel }
23 , vrulerSize{ 36, 0 }
24{
26}
static Return Call(This &obj, Arguments ...arguments)
Invoke the method – but only after static initialization time.
std::pair< int, int > vrulerSize
Definition: ChannelView.h:128
void DoSetHeight(int h)

References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), and DoSetHeight().

Here is the call graph for this function:

◆ ~ChannelView()

ChannelView::~ChannelView ( )
pure virtual

Definition at line 28 of file ChannelView.cpp.

29{
30}

Member Function Documentation

◆ CopyTo()

void ChannelView::CopyTo ( Track track) const
overridevirtual

Copy state, for undo/redo purposes.

Reimplemented from TrackAttachment.

Definition at line 60 of file ChannelView.cpp.

61{
62 auto &other = GetFromChannelGroup(track);
63
64 other.mMinimized = mMinimized;
65 other.vrulerSize = vrulerSize;
66
67 // Let mY remain 0 -- TrackPositioner corrects it later
68 other.mY = 0;
69 other.mHeight = mHeight;
70}
bool mMinimized
Definition: ChannelView.h:162
static ChannelView & GetFromChannelGroup(ChannelGroup &group, size_t iChannel=0)
Definition: ChannelView.cpp:85

References GetFromChannelGroup(), mHeight, mMinimized, and vrulerSize.

Referenced by LabelTrackView::CopyTo(), and WaveChannelView::CopyTo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoGetVRulerControls()

virtual std::shared_ptr< ChannelVRulerControls > ChannelView::DoGetVRulerControls ( )
protectedpure virtual

Implemented in LabelTrackView, NoteTrackView, SpectrumView, WaveChannelView, WaveformView, and TimeTrackView.

Referenced by GetVRulerControls().

Here is the caller graph for this function:

◆ DoSetHeight()

void ChannelView::DoSetHeight ( int  h)
private

Definition at line 209 of file ChannelView.cpp.

210{
211 mHeight = h;
212}

References mHeight.

Referenced by ChannelView(), and SetExpandedHeight().

Here is the caller graph for this function:

◆ DoSetMinimized()

void ChannelView::DoSetMinimized ( bool  isMinimized)
virtual

Reimplemented in SpectrumView, WaveChannelView, and WaveformView.

Definition at line 171 of file ChannelView.cpp.

172{
173 mMinimized = isMinimized;
174}

References mMinimized.

Referenced by WaveChannelView::BuildSubViews(), SpectrumView::DoSetMinimized(), WaveChannelView::DoSetMinimized(), WaveformView::DoSetMinimized(), and SetMinimized().

Here is the caller graph for this function:

◆ DoSetY()

void ChannelView::DoSetY ( int  y)
private

Definition at line 190 of file ChannelView.cpp.

191{
192 mY = y;
193}

References mY.

◆ Find() [1/2]

ChannelView * ChannelView::Find ( Channel pChannel)
static
Precondition
!pChannel || dynamic_cast<Track*>(&pChannel->GetChannelGroup()) != nullptr

Definition at line 230 of file ChannelView.cpp.

231{
232 if (!pChannel)
233 return nullptr;
235 &pChannel->GetChannelGroup(), pChannel->GetChannelIndex());
236}
ChannelGroup & GetChannelGroup()
Channel object's lifetime is assumed to be nested in its Track's.
Definition: Channel.cpp:71
size_t GetChannelIndex() const
Definition: Channel.cpp:77
static ChannelView * FindFromChannelGroup(ChannelGroup *pGroup, size_t iChannel=0)
Definition: ChannelView.cpp:98

References FindFromChannelGroup(), Channel::GetChannelGroup(), and Channel::GetChannelIndex().

Referenced by Find(), and WaveChannelView::Find().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Find() [2/2]

const ChannelView * ChannelView::Find ( const Channel pChannel)
static

Definition at line 238 of file ChannelView.cpp.

239{
240 return Find(const_cast<Channel*>(pChannel));
241}
static ChannelView * Find(Channel *pChannel)

References Find().

Here is the call graph for this function:

◆ FindFromChannelGroup()

ChannelView * ChannelView::FindFromChannelGroup ( ChannelGroup pGroup,
size_t  iChannel = 0 
)
staticprivate
Precondition
!pGroup || iChannel < pGroup->NChannels()

Definition at line 98 of file ChannelView.cpp.

100{
102 keyC, static_cast<Track*>(pGroup), iChannel);
103}
static const AttachedTrackObjects::RegisteredFactory keyC
Definition: ChannelView.cpp:74
static Attachment * Find(const AttachedTrackObjects::RegisteredFactory &key, Track *pTrack, size_t iChannel)
Definition: Track.h:568
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122

References ChannelAttachments< Attachment >::Find(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and keyC.

Referenced by Find().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

ChannelView & ChannelView::Get ( Channel channel)
static
Precondition
dynamic_cast<Track*>(&channel.GetChannelGroup()) != nullptr

Definition at line 219 of file ChannelView.cpp.

220{
221 return GetFromChannelGroup(channel.GetChannelGroup(),
222 channel.GetChannelIndex());
223}

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [2/2]

const ChannelView & ChannelView::Get ( const Channel channel)
static

Precondition
dynamic_cast<Track*>(&channel.GetChannelGroup()) != nullptr

Definition at line 225 of file ChannelView.cpp.

226{
227 return Get(const_cast<Channel&>(channel));
228}
static ChannelView & Get(Channel &channel)

References Get().

Here is the call graph for this function:

◆ GetAffordanceControls()

std::shared_ptr< CommonTrackCell > ChannelView::GetAffordanceControls ( )
virtual

Reimplemented in NoteTrackView, and WaveChannelView.

Definition at line 214 of file ChannelView.cpp.

215{
216 return {};
217}

◆ GetChannelGroupHeight()

int ChannelView::GetChannelGroupHeight ( const Track pTrack)
static

Definition at line 32 of file ChannelView.cpp.

33{
34 const auto GetTrackHeight = [](const Track *pTrack) -> int {
35 return pTrack ? GetFromChannelGroup(*pTrack).GetHeight() : 0;
36 };
37 return pTrack ? TrackList::Channels(pTrack).sum(GetTrackHeight) : 0;
38}
int GetHeight() const
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1146

References TrackList::Channels(), GetFromChannelGroup(), and GetHeight().

Referenced by TrackSelectHandle::CalculateRearrangingThresholds(), ProjectWindow::GetTrackHeight(), and TrackPanel::RefreshTrack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCumulativeHeight() [1/2]

int ChannelView::GetCumulativeHeight ( const Channel pChannel)
static

Definition at line 40 of file ChannelView.cpp.

41{
42 if (!pChannel)
43 return 0;
44 auto &view = ChannelView::Get(*pChannel);
45 return view.GetCumulativeHeightBefore() + view.GetHeight();
46}

References Get().

Referenced by GetTotalHeight(), and anonymous_namespace{ChannelView.cpp}::TrackPositioner::OnUpdate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCumulativeHeight() [2/2]

int ChannelView::GetCumulativeHeight ( const Track pTrack)
static

Definition at line 48 of file ChannelView.cpp.

49{
50 if (!pTrack)
51 return 0;
52 return GetCumulativeHeight((*pTrack->Channels().rbegin()).get());
53}
IteratorRange< ChannelIterator< ChannelType > > Channels()
Get range of channels with mutative access.
Definition: Channel.h:408
static int GetCumulativeHeight(const Channel *pChannel)
Definition: ChannelView.cpp:40

◆ GetCumulativeHeightBefore()

int ChannelView::GetCumulativeHeightBefore ( ) const
inline
Returns
cached sum of GetHeight() of all preceding tracks

Definition at line 72 of file ChannelView.h.

72{ return mY; }

◆ GetExpandedHeight()

int ChannelView::GetExpandedHeight ( ) const
inline
Returns
height of the track when expanded

See other comments for GetHeight

Definition at line 76 of file ChannelView.h.

76{ return mHeight; }

Referenced by WriteXMLAttributes().

Here is the caller graph for this function:

◆ GetFromChannelGroup() [1/2]

ChannelView & ChannelView::GetFromChannelGroup ( ChannelGroup group,
size_t  iChannel = 0 
)
staticprivate
Precondition
iChannel < group.NChannels()

Definition at line 85 of file ChannelView.cpp.

87{
88 auto &track = static_cast<Track&>(group);
90}
static Attachment & Get(const AttachedTrackObjects::RegisteredFactory &key, Track &track, size_t iChannel)
Definition: Track.h:558

References ChannelAttachments< Attachment >::Get(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and keyC.

Referenced by CopyTo(), Get(), GetChannelGroupHeight(), and GetFromChannelGroup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFromChannelGroup() [2/2]

const ChannelView & ChannelView::GetFromChannelGroup ( const ChannelGroup group,
size_t  iChannel = 0 
)
staticprivate

Definition at line 92 of file ChannelView.cpp.

94{
95 return GetFromChannelGroup(const_cast<ChannelGroup &>(group), iChannel);
96}

References GetFromChannelGroup(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

Here is the call graph for this function:

◆ GetHeight()

int ChannelView::GetHeight ( ) const
Returns
height of the track as it now appears, expanded or collapsed

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.

196{
197 if ( GetMinimized() )
198 return GetMinimizedHeight();
199
200 return mHeight;
201}
virtual int GetMinimizedHeight() const =0
bool GetMinimized() const
Definition: ChannelView.h:68

References GetMinimized(), GetMinimizedHeight(), and mHeight.

Referenced by TrackPanelResizeHandle::Click(), anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), GetChannelGroupHeight(), and WaveTrackMenuTable::OnMergeStereo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMinimized()

bool ChannelView::GetMinimized ( ) const
inline

Definition at line 68 of file ChannelView.h.

68{ return mMinimized; }

Referenced by WaveChannelView::BuildSubViews(), MinimizeButtonHandle::CommitChanges(), GetHeight(), ProjectWindow::IsTrackMinimized(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), WaveTrackMenuTable::OnMergeStereo(), MinimizeButtonHandle::Tip(), and WriteXMLAttributes().

Here is the caller graph for this function:

◆ GetMinimizedHeight()

virtual int ChannelView::GetMinimizedHeight ( ) const
pure virtual
Returns
height of the track when collapsed

See other comments for GetHeight

Implemented in CommonChannelView.

Referenced by GetHeight().

Here is the caller graph for this function:

◆ GetSubViews()

auto ChannelView::GetSubViews ( const wxRect &  rect)
virtual

Reimplemented in WaveChannelView.

Definition at line 161 of file ChannelView.cpp.

162{
163 return { { rect.GetTop(), shared_from_this() } };
164}

Referenced by anonymous_namespace{TrackPanel.cpp}::ChannelStack::Children().

Here is the caller graph for this function:

◆ GetTotalHeight()

int ChannelView::GetTotalHeight ( const TrackList list)
static

Definition at line 55 of file ChannelView.cpp.

56{
57 return GetCumulativeHeight(*list.rbegin());
58}
reverse_iterator rbegin()
Definition: Track.h:1042

References GetCumulativeHeight(), and TrackList::rbegin().

Referenced by ProjectWindow::GetTotalHeight().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVRulerControls() [1/2]

std::shared_ptr< ChannelVRulerControls > ChannelView::GetVRulerControls ( )

Definition at line 176 of file ChannelView.cpp.

177{
178 if (!mpVRulerControls)
179 // create on demand
181 return mpVRulerControls;
182}
virtual std::shared_ptr< ChannelVRulerControls > DoGetVRulerControls()=0
std::shared_ptr< ChannelVRulerControls > mpVRulerControls
Definition: ChannelView.h:143

References DoGetVRulerControls(), and mpVRulerControls.

Referenced by ChannelVRulerControls::Get(), and GetVRulerControls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVRulerControls() [2/2]

std::shared_ptr< const ChannelVRulerControls > ChannelView::GetVRulerControls ( ) const

Definition at line 185 of file ChannelView.cpp.

186{
187 return const_cast<ChannelView*>(this)->GetVRulerControls();
188}
std::shared_ptr< ChannelVRulerControls > GetVRulerControls()

References GetVRulerControls().

Here is the call graph for this function:

◆ HandleXMLAttribute()

bool ChannelView::HandleXMLAttribute ( const std::string_view &  attr,
const XMLAttributeValueView valueView 
)
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.

142{
143 long nValue;
144
145 if (attr == HeightAttributeName(*this) && valueView.TryGet(nValue)) {
146 // Bug 2803: Extreme values for track height (caused by integer overflow)
147 // will stall Audacity as it tries to create an enormous vertical ruler.
148 // So clamp to reasonable values.
149 nValue = std::max( 40l, std::min( nValue, 1000l ));
150 SetExpandedHeight(nValue);
151 return true;
152 }
153 else if (attr == MinimizedAttributeName(*this) && valueView.TryGet(nValue)) {
154 SetMinimized(nValue != 0);
155 return true;
156 }
157 else
158 return false;
159}
int min(int a, int b)
void SetMinimized(bool minimized)
void SetExpandedHeight(int height)
bool TryGet(bool &value) const noexcept
Try to get a boolean value from the view.
std::string HeightAttributeName(const ChannelView &view)
std::string MinimizedAttributeName(const ChannelView &view)

References anonymous_namespace{ChannelView.cpp}::HeightAttributeName(), min(), anonymous_namespace{ChannelView.cpp}::MinimizedAttributeName(), SetExpandedHeight(), SetMinimized(), and XMLAttributeValueView::TryGet().

Here is the call graph for this function:

◆ IsSpectral()

bool ChannelView::IsSpectral ( ) const
virtual

Reimplemented in SpectrumView.

Definition at line 166 of file ChannelView.cpp.

167{
168 return false;
169}

Referenced by anonymous_namespace{BrushHandle.cpp}::isSpectralSelectionView(), and anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView().

Here is the caller graph for this function:

◆ operator=()

ChannelView & ChannelView::operator= ( const ChannelView )
privatedelete

◆ SetCumulativeHeightBefore()

void ChannelView::SetCumulativeHeightBefore ( int  y)
inline

Set cached value dependent on position within the track list.

Definition at line 94 of file ChannelView.h.

94{ DoSetY( y ); }
void DoSetY(int y)

◆ SetExpandedHeight()

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.

204{
205 DoSetHeight(h);
206 FindTrack()->AdjustPositions();
207}
std::shared_ptr< Track > FindTrack()

References DoSetHeight(), and CommonTrackPanelCell::FindTrack().

Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Click(), HandleXMLAttribute(), ProjectWindow::SetChannelHeights(), ScreenshotBigDialog::SizeTracks(), and WaveTrackMenuTable::SplitStereo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMinimized()

void ChannelView::SetMinimized ( bool  minimized)

Definition at line 105 of file ChannelView.cpp.

106{
107 // Do special changes appropriate to subclass
108 DoSetMinimized(isMinimized);
109
110 // Update positions and heights starting from the first track in the group
111 auto leader = *TrackList::Channels( FindTrack().get() ).begin();
112 if ( leader )
113 leader->AdjustPositions();
114}
virtual void DoSetMinimized(bool isMinimized)

References TrackList::Channels(), DoSetMinimized(), and CommonTrackPanelCell::FindTrack().

Referenced by MinimizeButtonHandle::CommitChanges(), ProjectAudioManager::DoRecord(), HandleXMLAttribute(), and ProjectWindow::SetMinimized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteXMLAttributes()

void ChannelView::WriteXMLAttributes ( XMLWriter ) const
overridevirtual

Serialize persistent attributes.

default does nothing

Reimplemented from TrackAttachment.

Definition at line 134 of file ChannelView.cpp.

135{
136 xmlFile.WriteAttr(HeightAttributeName(*this), GetExpandedHeight());
137 xmlFile.WriteAttr(MinimizedAttributeName(*this), GetMinimized());
138}
int GetExpandedHeight() const
Definition: ChannelView.h:76

References GetExpandedHeight(), GetMinimized(), anonymous_namespace{ChannelView.cpp}::HeightAttributeName(), anonymous_namespace{ChannelView.cpp}::MinimizedAttributeName(), and XMLWriter::WriteAttr().

Here is the call graph for this function:

Member Data Documentation

◆ mHeight

int ChannelView::mHeight { DefaultHeight }
private

Definition at line 164 of file ChannelView.h.

Referenced by CopyTo(), DoSetHeight(), and GetHeight().

◆ mMinimized

bool ChannelView::mMinimized { false }
private

Definition at line 162 of file ChannelView.h.

Referenced by CopyTo(), and DoSetMinimized().

◆ mpVRulerControls

std::shared_ptr<ChannelVRulerControls> ChannelView::mpVRulerControls
protected

Definition at line 143 of file ChannelView.h.

Referenced by GetVRulerControls().

◆ mY

int ChannelView::mY { 0 }
private

Definition at line 163 of file ChannelView.h.

Referenced by DoSetY().

◆ vrulerSize

std::pair<int, int> ChannelView::vrulerSize
mutable

The documentation for this class was generated from the following files: