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

#include <FreqWindow.h>

Inheritance diagram for FreqGauge:

Public Member Functions

 FreqGauge (wxWindow *parent)
 
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 86 of file FreqWindow.h.

Constructor & Destructor Documentation

FreqGauge::FreqGauge ( wxWindow *  parent)

Definition at line 1140 of file FreqWindow.cpp.

References mRange.

1141 : wxStatusBar(parent, wxID_ANY, wxST_SIZEGRIP)
1142 {
1143  mRange = 0;
1144 }
int mRange
Definition: FreqWindow.h:97

Member Function Documentation

void FreqGauge::Reset ( )

Definition at line 1183 of file FreqWindow.cpp.

References mRange.

Referenced by SpectrumAnalyst::Calculate().

1184 {
1185  mRange = 0;
1186  Refresh(true);
1187 }
int mRange
Definition: FreqWindow.h:97
void FreqGauge::SetRange ( int  range,
int  bar = 12,
int  gap = 3 
)

Definition at line 1146 of file FreqWindow.cpp.

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

Referenced by SpectrumAnalyst::Calculate().

1147 {
1148  mRange = range;
1149  mBar = bar;
1150  mGap = gap;
1151 
1152  GetFieldRect(0, mRect);
1153  mRect.Inflate(-1);
1154 
1155  mInterval = mRange / (mRect.width / (mBar + mGap));
1156  mRect.width = mBar;
1157  mMargin = mRect.x;
1158  mLast = -1;
1159 
1160  Update();
1161 }
int mRange
Definition: FreqWindow.h:97
int mMargin
Definition: FreqWindow.h:103
int mInterval
Definition: FreqWindow.h:100
wxRect mRect
Definition: FreqWindow.h:96
static const int gap
Definition: Meter.cpp:176
int mLast
Definition: FreqWindow.h:99
void FreqGauge::SetValue ( int  value)

Definition at line 1163 of file FreqWindow.cpp.

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

Referenced by SpectrumAnalyst::Calculate().

1164 {
1165  mCur = value / mInterval;
1166 
1167  if (mCur != mLast)
1168  {
1169  wxClientDC dc(this);
1170  dc.SetPen(*wxTRANSPARENT_PEN);
1171  dc.SetBrush(wxColour(100, 100, 220));
1172 
1173  while (mLast < mCur)
1174  {
1175  mLast++;
1176  mRect.x = mMargin + mLast * (mBar + mGap);
1177  dc.DrawRectangle(mRect);
1178  }
1179  Update();
1180  }
1181 }
int mMargin
Definition: FreqWindow.h:103
int mInterval
Definition: FreqWindow.h:100
wxRect mRect
Definition: FreqWindow.h:96
int mCur
Definition: FreqWindow.h:98
int mLast
Definition: FreqWindow.h:99

Member Data Documentation

int FreqGauge::mBar
private

Definition at line 101 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mCur
private

Definition at line 98 of file FreqWindow.h.

Referenced by SetValue().

int FreqGauge::mGap
private

Definition at line 102 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mInterval
private

Definition at line 100 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mLast
private

Definition at line 99 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mMargin
private

Definition at line 103 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mRange
private

Definition at line 97 of file FreqWindow.h.

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

wxRect FreqGauge::mRect
private

Definition at line 96 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().


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