Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
WaveColorAttachment Struct Referencefinal

#include <WaveformAppearance.h>

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

Public Member Functions

 WaveColorAttachment ()
 
 ~WaveColorAttachment () override
 
std::unique_ptr< WaveClipListenerClone () const override
 
void MarkChanged () noexcept override
 
void Invalidate () override
 
void WriteXMLAttributes (XMLWriter &writer) const override
 
bool HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) override
 
int GetColorIndex () const
 
void SetColorIndex (int colorIndex)
 
- Public Member Functions inherited from WaveClipListener
virtual ~WaveClipListener ()=0
 
virtual void MarkChanged () noexcept=0
 
virtual void Invalidate ()=0
 
virtual void WriteXMLAttributes (XMLWriter &writer) const
 
virtual bool HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView)
 
virtual void MakeStereo (WaveClipListener &&other, bool aligned)
 
virtual void SwapChannels ()
 Default implementation does nothing. More...
 
virtual void Erase (size_t index)
 

Static Public Member Functions

static WaveColorAttachmentGet (WaveClip &clip)
 
static const WaveColorAttachmentGet (const WaveClip &clip)
 
static WaveColorAttachmentGet (WaveChannelInterval &clip)
 
static const WaveColorAttachmentGet (const WaveChannelInterval &clip)
 

Private Attributes

int mColorIndex {}
 

Detailed Description

Definition at line 48 of file WaveformAppearance.h.

Constructor & Destructor Documentation

◆ WaveColorAttachment()

WaveColorAttachment::WaveColorAttachment ( )
explicit

Definition at line 113 of file WaveformAppearance.cpp.

114{
115}

◆ ~WaveColorAttachment()

WaveColorAttachment::~WaveColorAttachment ( )
override

Definition at line 117 of file WaveformAppearance.cpp.

118{
119}

Member Function Documentation

◆ Clone()

std::unique_ptr< WaveClipListener > WaveColorAttachment::Clone ( ) const
override

Definition at line 121 of file WaveformAppearance.cpp.

122{
123 auto result = std::make_unique<WaveColorAttachment>(*this);
124 return result;
125}

◆ Get() [1/4]

const WaveColorAttachment & WaveColorAttachment::Get ( const WaveChannelInterval clip)
static

Definition at line 147 of file WaveformAppearance.cpp.

148{
149 return Get(clip.GetClip());
150}
WaveClip & GetClip()
Definition: WaveClip.h:96
static WaveColorAttachment & Get(WaveClip &clip)

References Get(), and WaveClipChannel::GetClip().

Here is the call graph for this function:

◆ Get() [2/4]

const WaveColorAttachment & WaveColorAttachment::Get ( const WaveClip clip)
static

Definition at line 136 of file WaveformAppearance.cpp.

137{
138 return const_cast<WaveClip&>(clip)
139 .Attachments::Get<WaveColorAttachment>(keyWCA);
140}
static WaveClip::Attachments::RegisteredFactory keyWCA
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:238

References keyWCA.

◆ Get() [3/4]

WaveColorAttachment & WaveColorAttachment::Get ( WaveChannelInterval clip)
static

Definition at line 142 of file WaveformAppearance.cpp.

143{
144 return Get(clip.GetClip());
145}

References Get(), and WaveClipChannel::GetClip().

Here is the call graph for this function:

◆ Get() [4/4]

WaveColorAttachment & WaveColorAttachment::Get ( WaveClip clip)
static

Definition at line 131 of file WaveformAppearance.cpp.

132{
133 return clip.Attachments::Get<WaveColorAttachment>(keyWCA);
134}

References keyWCA.

Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), Get(), and WaveformAppearance::SetColorIndex().

Here is the caller graph for this function:

◆ GetColorIndex()

int WaveColorAttachment::GetColorIndex ( ) const
inline

Definition at line 70 of file WaveformAppearance.h.

70{ return mColorIndex; }

References mColorIndex.

Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform().

Here is the caller graph for this function:

◆ HandleXMLAttribute()

bool WaveColorAttachment::HandleXMLAttribute ( const std::string_view &  attr,
const XMLAttributeValueView valueView 
)
overridevirtual

Reimplemented from WaveClipListener.

Definition at line 161 of file WaveformAppearance.cpp.

163{
164 long longValue;
165 if (attr == ColorIndex_attr) {
166 if (!valueView.TryGet(longValue))
167 return false;
168 SetColorIndex(longValue);
169 return true;
170 }
171 return false;
172}
static constexpr auto ColorIndex_attr
bool TryGet(bool &value) const noexcept
Try to get a boolean value from the view.
void SetColorIndex(int colorIndex)

References ColorIndex_attr, SetColorIndex(), and XMLAttributeValueView::TryGet().

Here is the call graph for this function:

◆ Invalidate()

void WaveColorAttachment::Invalidate ( )
overridevirtual

Implements WaveClipListener.

Definition at line 154 of file WaveformAppearance.cpp.

154{}

◆ MarkChanged()

void WaveColorAttachment::MarkChanged ( )
overridevirtualnoexcept

Implements WaveClipListener.

Definition at line 152 of file WaveformAppearance.cpp.

152{}

◆ SetColorIndex()

void WaveColorAttachment::SetColorIndex ( int  colorIndex)
inline

Definition at line 71 of file WaveformAppearance.h.

71{ mColorIndex = colorIndex; }

References mColorIndex.

Referenced by HandleXMLAttribute(), and WaveformAppearance::SetColorIndex().

Here is the caller graph for this function:

◆ WriteXMLAttributes()

void WaveColorAttachment::WriteXMLAttributes ( XMLWriter writer) const
overridevirtual

Reimplemented from WaveClipListener.

Definition at line 156 of file WaveformAppearance.cpp.

157{
159}
void WriteAttr(const wxString &name, const Identifier &value)
Definition: XMLWriter.h:36

References ColorIndex_attr, mColorIndex, and XMLWriter::WriteAttr().

Here is the call graph for this function:

Member Data Documentation

◆ mColorIndex

int WaveColorAttachment::mColorIndex {}
private

Definition at line 74 of file WaveformAppearance.h.

Referenced by GetColorIndex(), SetColorIndex(), and WriteXMLAttributes().


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