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

#include <WaveformScale.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 22 of file WaveformScale.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 31 of file WaveformScale.cpp.

32{
33 return std::make_unique<WaveformScale>(*this);
34}

◆ Get() [1/2]

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

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

Definition at line 24 of file WaveformScale.cpp.

25{
26 return Get(channel.GetTrack());
27}
WaveTrack & GetTrack()
Definition: WaveTrack.h:841
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 18 of file WaveformScale.cpp.

19{
20 auto &mutTrack = const_cast<WaveTrack&>(track);
21 return mutTrack.Attachments::Get<WaveformScale>(key2);
22}
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 39 of file WaveformScale.h.

40 { 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 48 of file WaveformScale.h.

48{ return mLastdBRange; }

◆ GetLastScaleType()

float WaveformScale::GetLastScaleType ( ) const
inline

Definition at line 45 of file WaveformScale.h.

45{ return mLastScaleType; }

◆ SetDisplayBounds()

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

Definition at line 42 of file WaveformScale.h.

43 { mDisplayMin = min; mDisplayMax = max; }

References min().

Here is the call graph for this function:

◆ SetLastDBRange()

void WaveformScale::SetLastDBRange ( int  range)
inline

Definition at line 49 of file WaveformScale.h.

49{ 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 46 of file WaveformScale.h.

46{ 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 36 of file WaveformScale.cpp.

37{
38 return rect.GetTop() +
39 (int)((mDisplayMax / (mDisplayMax - mDisplayMin)) * rect.height);
40}

References mDisplayMax, and mDisplayMin.

Member Data Documentation

◆ mDisplayMax

float WaveformScale::mDisplayMax = 1.0f
private

Definition at line 52 of file WaveformScale.h.

Referenced by ZeroLevelYCoordinate().

◆ mDisplayMin

float WaveformScale::mDisplayMin = -1.0f
private

Definition at line 52 of file WaveformScale.h.

Referenced by ZeroLevelYCoordinate().

◆ mLastdBRange

int WaveformScale::mLastdBRange = -1
private

Definition at line 54 of file WaveformScale.h.

◆ mLastScaleType

int WaveformScale::mLastScaleType = -1
private

Definition at line 53 of file WaveformScale.h.


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