Audacity  2.3.1
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, 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 88 of file FreqWindow.h.

Constructor & Destructor Documentation

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

Definition at line 1145 of file FreqWindow.cpp.

References mRange.

1146 : wxStatusBar(parent, winid, wxST_SIZEGRIP)
1147 {
1148  mRange = 0;
1149 }
int mRange
Definition: FreqWindow.h:99

Member Function Documentation

void FreqGauge::Reset ( )

Definition at line 1188 of file FreqWindow.cpp.

References mRange.

Referenced by SpectrumAnalyst::Calculate().

1189 {
1190  mRange = 0;
1191  Refresh(true);
1192 }
int mRange
Definition: FreqWindow.h:99
void FreqGauge::SetRange ( int  range,
int  bar = 12,
int  gap = 3 
)

Definition at line 1151 of file FreqWindow.cpp.

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

Referenced by SpectrumAnalyst::Calculate().

1152 {
1153  mRange = range;
1154  mBar = bar;
1155  mGap = gap;
1156 
1157  GetFieldRect(0, mRect);
1158  mRect.Inflate(-1);
1159 
1160  mInterval = mRange / (mRect.width / (mBar + mGap));
1161  mRect.width = mBar;
1162  mMargin = mRect.x;
1163  mLast = -1;
1164 
1165  Update();
1166 }
int mRange
Definition: FreqWindow.h:99
int mMargin
Definition: FreqWindow.h:105
int mInterval
Definition: FreqWindow.h:102
wxRect mRect
Definition: FreqWindow.h:98
static const int gap
Definition: Meter.cpp:176
void FreqGauge::SetValue ( int  value)

Definition at line 1168 of file FreqWindow.cpp.

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

Referenced by SpectrumAnalyst::Calculate().

1169 {
1170  mCur = value / mInterval;
1171 
1172  if (mCur != mLast)
1173  {
1174  wxClientDC dc(this);
1175  dc.SetPen(*wxTRANSPARENT_PEN);
1176  dc.SetBrush(wxColour(100, 100, 220));
1177 
1178  while (mLast < mCur)
1179  {
1180  mLast++;
1181  mRect.x = mMargin + mLast * (mBar + mGap);
1182  dc.DrawRectangle(mRect);
1183  }
1184  Update();
1185  }
1186 }
int mMargin
Definition: FreqWindow.h:105
int mInterval
Definition: FreqWindow.h:102
wxRect mRect
Definition: FreqWindow.h:98

Member Data Documentation

int FreqGauge::mBar
private

Definition at line 103 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mCur
private

Definition at line 100 of file FreqWindow.h.

Referenced by SetValue().

int FreqGauge::mGap
private

Definition at line 104 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mInterval
private

Definition at line 102 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mLast
private

Definition at line 101 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mMargin
private

Definition at line 105 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().

int FreqGauge::mRange
private

Definition at line 99 of file FreqWindow.h.

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

wxRect FreqGauge::mRect
private

Definition at line 98 of file FreqWindow.h.

Referenced by SetRange(), and SetValue().


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