Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
WaveformScale Class Reference

#include <WaveformSettings.h>

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

Public Member Functions

 ~WaveformScale () override
 
PointerType Clone () const override
 
int ZeroLevelYCoordinate (wxRect rect) const
 
void GetDisplayBounds (float &min, float &max) const
 
void SetDisplayBounds (float min, float max)
 
float GetLastScaleType () const
 
void SetLastScaleType (int type)
 
int GetLastDBRange () const
 
void SetLastDBRange (int range)
 
- Public Member Functions inherited from ClientData::Cloneable< Covariant, Owner >
 Cloneable ()=default
 
 Cloneable (const Cloneable &)=default
 
Cloneableoperator= (const Cloneable &)=default
 
virtual ~Cloneable ()=default
 
virtual PointerType Clone () const =0
 

Static Public Member Functions

static WaveformScaleGet (const WaveTrack &track)
 Mutative access to attachment even if the track argument is const. More...
 
static WaveformScaleGet (const WaveChannel &channel)
 Mutative access to attachment even if the track argument is const. More...
 

Private Attributes

float mDisplayMin = -1.0f
 
float mDisplayMax = 1.0f
 
int mLastScaleType = -1
 
int mLastdBRange = -1
 

Additional Inherited Members

- Public Types inherited from ClientData::Cloneable< Covariant, Owner >
using Base = std::conditional_t< std::is_void_v< Covariant >, Cloneable, Covariant >
 
using PointerType = Owner< Base >
 

Detailed Description

Definition at line 98 of file WaveformSettings.h.

Constructor & Destructor Documentation

◆ ~WaveformScale()

WaveformScale::~WaveformScale ( )
overridedefault

Member Function Documentation

◆ Clone()

auto WaveformScale::Clone ( ) const
overridevirtual

Implements ClientData::Cloneable< Covariant, Owner >.

Definition at line 219 of file WaveformSettings.cpp.

220{
221 return std::make_unique<WaveformScale>(*this);
222}

◆ Get() [1/2]

WaveformScale & WaveformScale::Get ( const WaveChannel channel)
static

Mutative access to attachment even if the track argument is const.

Definition at line 212 of file WaveformSettings.cpp.

213{
214 return Get(channel.GetTrack());
215}
WaveTrack & GetTrack()
Definition: WaveTrack.h:840
static WaveformScale & Get(const WaveTrack &track)
Mutative access to attachment even if the track argument is const.

References Get(), and WaveChannel::GetTrack().

Here is the call graph for this function:

◆ Get() [2/2]

WaveformScale & WaveformScale::Get ( const WaveTrack track)
static

Mutative access to attachment even if the track argument is const.

Definition at line 206 of file WaveformSettings.cpp.

207{
208 auto &mutTrack = const_cast<WaveTrack&>(track);
209 return mutTrack.Attachments::Get<WaveformScale>(key2);
210}
static const ChannelGroup::Attachments::RegisteredFactory key2
A Track that contains audio waveform data.
Definition: WaveTrack.h:203

References key2.

Referenced by SetTrackVisualsCommand::ApplyInner(), EnvelopeHandle::Click(), WaveformVRulerControls::DoHandleWheelRotation(), WaveformView::DoSetMinimized(), WaveformVRulerControls::DoUpdateVRuler(), WaveformVZoomHandle::DoZoom(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), SampleHandle::FindSampleEditingLevel(), Get(), SampleHandle::HitTest(), GetInfoCommand::SendTracks(), and EnvelopeHandle::WaveChannelHitTest().

Here is the caller graph for this function:

◆ GetDisplayBounds()

void WaveformScale::GetDisplayBounds ( float &  min,
float &  max 
) const
inline

Definition at line 115 of file WaveformSettings.h.

116 { min = mDisplayMin; max = mDisplayMax; }
int min(int a, int b)

References min().

Referenced by GetInfoCommand::SendTracks().

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

◆ GetLastDBRange()

int WaveformScale::GetLastDBRange ( ) const
inline

Definition at line 124 of file WaveformSettings.h.

124{ return mLastdBRange; }

◆ GetLastScaleType()

float WaveformScale::GetLastScaleType ( ) const
inline

Definition at line 121 of file WaveformSettings.h.

121{ return mLastScaleType; }

◆ SetDisplayBounds()

void WaveformScale::SetDisplayBounds ( float  min,
float  max 
)
inline

Definition at line 118 of file WaveformSettings.h.

119 { mDisplayMin = min; mDisplayMax = max; }

References min().

Here is the call graph for this function:

◆ SetLastDBRange()

void WaveformScale::SetLastDBRange ( int  range)
inline

Definition at line 125 of file WaveformSettings.h.

125{ mLastdBRange = range; }

Referenced by anonymous_namespace{WaveformVRulerControls.cpp}::SetLastdBRange().

Here is the caller graph for this function:

◆ SetLastScaleType()

void WaveformScale::SetLastScaleType ( int  type)
inline

Definition at line 122 of file WaveformSettings.h.

122{ mLastScaleType = type; }

Referenced by anonymous_namespace{WaveformVRulerControls.cpp}::SetLastScaleType().

Here is the caller graph for this function:

◆ ZeroLevelYCoordinate()

int WaveformScale::ZeroLevelYCoordinate ( wxRect  rect) const

Definition at line 224 of file WaveformSettings.cpp.

225{
226 return rect.GetTop() +
227 (int)((mDisplayMax / (mDisplayMax - mDisplayMin)) * rect.height);
228}

References mDisplayMax, and mDisplayMin.

Member Data Documentation

◆ mDisplayMax

float WaveformScale::mDisplayMax = 1.0f
private

Definition at line 128 of file WaveformSettings.h.

Referenced by ZeroLevelYCoordinate().

◆ mDisplayMin

float WaveformScale::mDisplayMin = -1.0f
private

Definition at line 128 of file WaveformSettings.h.

Referenced by ZeroLevelYCoordinate().

◆ mLastdBRange

int WaveformScale::mLastdBRange = -1
private

Definition at line 130 of file WaveformSettings.h.

◆ mLastScaleType

int WaveformScale::mLastScaleType = -1
private

Definition at line 129 of file WaveformSettings.h.


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