Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
FreqGauge Class Referencefinal

#include <FreqGauge.h>

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

Public Member Functions

 FreqGauge (wxWindow *parent, wxWindowID winid)
 
void SetRange (int range, int bar=12, int gap=3)
 
void SetValue (int value)
 
void Reset ()
 

Private Attributes

wxRect mRect
 
int mRange
 
int mCur
 
int mLast
 
int mInterval
 
int mBar
 
int mGap
 
int mMargin
 

Detailed Description

Definition at line 16 of file FreqGauge.h.

Constructor & Destructor Documentation

◆ FreqGauge()

FreqGauge::FreqGauge ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 21 of file FreqGauge.cpp.

22: wxStatusBar(parent, winid, wxST_SIZEGRIP)
23{
24 mRange = 0;
25}
int mRange
Definition: FreqGauge.h:27

References mRange.

Member Function Documentation

◆ Reset()

void FreqGauge::Reset ( )

Definition at line 64 of file FreqGauge.cpp.

65{
66 mRange = 0;
67 Refresh(true);
68}

References mRange.

Referenced by FrequencyPlotDialog::Recalc().

Here is the caller graph for this function:

◆ SetRange()

void FreqGauge::SetRange ( int  range,
int  bar = 12,
int  gap = 3 
)

Definition at line 27 of file FreqGauge.cpp.

28{
29 mRange = range;
30 mBar = bar;
31 mGap = gap;
32
33 GetFieldRect(0, mRect);
34 mRect.Inflate(-1);
35
36 mInterval = mRange / (mRect.width / (mBar + mGap));
37 mRect.width = mBar;
38 mMargin = mRect.x;
39 mLast = -1;
40
41 Update();
42}
static const int gap
Definition: MeterPanel.cpp:194
int mInterval
Definition: FreqGauge.h:30
int mGap
Definition: FreqGauge.h:32
int mBar
Definition: FreqGauge.h:31
int mLast
Definition: FreqGauge.h:29
int mMargin
Definition: FreqGauge.h:33
wxRect mRect
Definition: FreqGauge.h:26

References gap, mBar, mGap, mInterval, mLast, mMargin, mRange, and mRect.

Referenced by FrequencyPlotDialog::Recalc().

Here is the caller graph for this function:

◆ SetValue()

void FreqGauge::SetValue ( int  value)

Definition at line 44 of file FreqGauge.cpp.

45{
46 mCur = value / mInterval;
47
48 if (mCur != mLast)
49 {
50 wxClientDC dc(this);
51 dc.SetPen(*wxTRANSPARENT_PEN);
52 dc.SetBrush(wxColour(100, 100, 220));
53
54 while (mLast < mCur)
55 {
56 mLast++;
57 mRect.x = mMargin + mLast * (mBar + mGap);
58 dc.DrawRectangle(mRect);
59 }
60 Update();
61 }
62}
int mCur
Definition: FreqGauge.h:28

References mBar, mCur, mGap, mInterval, mLast, mMargin, and mRect.

Referenced by FrequencyPlotDialog::Recalc().

Here is the caller graph for this function:

Member Data Documentation

◆ mBar

int FreqGauge::mBar
private

Definition at line 31 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().

◆ mCur

int FreqGauge::mCur
private

Definition at line 28 of file FreqGauge.h.

Referenced by SetValue().

◆ mGap

int FreqGauge::mGap
private

Definition at line 32 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().

◆ mInterval

int FreqGauge::mInterval
private

Definition at line 30 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().

◆ mLast

int FreqGauge::mLast
private

Definition at line 29 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().

◆ mMargin

int FreqGauge::mMargin
private

Definition at line 33 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().

◆ mRange

int FreqGauge::mRange
private

Definition at line 27 of file FreqGauge.h.

Referenced by FreqGauge(), Reset(), and SetRange().

◆ mRect

wxRect FreqGauge::mRect
private

Definition at line 26 of file FreqGauge.h.

Referenced by SetRange(), and SetValue().


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