Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
MeterUpdateMsg Class Reference

Message used to update the MeterPanel. More...

#include <MeterPanel.h>

Public Member Functions

 MeterUpdateMsg ()
 
 ~MeterUpdateMsg ()
 
wxString toString ()
 Print out all the values in the meter update message. More...
 
wxString toStringIfClipped ()
 Only print meter updates if clipping may be happening. More...
 

Public Attributes

int numFrames
 
float peak [kMaxMeterBars]
 
float rms [kMaxMeterBars]
 
bool clipping [kMaxMeterBars]
 
int headPeakCount [kMaxMeterBars]
 
int tailPeakCount [kMaxMeterBars]
 

Detailed Description

Message used to update the MeterPanel.

Definition at line 54 of file MeterPanel.h.

Constructor & Destructor Documentation

◆ MeterUpdateMsg()

MeterUpdateMsg::MeterUpdateMsg ( )
inline

Definition at line 65 of file MeterPanel.h.

65{ }

◆ ~MeterUpdateMsg()

MeterUpdateMsg::~MeterUpdateMsg ( )
inline

Definition at line 66 of file MeterPanel.h.

66{ }

Member Function Documentation

◆ toString()

wxString MeterUpdateMsg::toString ( )

Print out all the values in the meter update message.

Definition at line 159 of file MeterPanel.cpp.

160{
161wxString output; // somewhere to build up a string in
162output = wxString::Format(wxT("Meter update msg: %i channels, %i samples\n"), \
164for (int i = 0; i<kMaxMeterBars; i++)
165 { // for each channel of the meters
166 output += wxString::Format(wxT("%f peak, %f rms "), peak[i], rms[i]);
167 if (clipping[i])
168 output += wxString::Format(wxT("clipped "));
169 else
170 output += wxString::Format(wxT("no clip "));
171 output += wxString::Format(wxT("%i head, %i tail\n"), headPeakCount[i], tailPeakCount[i]);
172 }
173return output;
174}
wxT("CloseDown"))
const int kMaxMeterBars
Definition: MeterPanel.h:37
bool clipping[kMaxMeterBars]
Definition: MeterPanel.h:60
float peak[kMaxMeterBars]
Definition: MeterPanel.h:58
int tailPeakCount[kMaxMeterBars]
Definition: MeterPanel.h:62
int headPeakCount[kMaxMeterBars]
Definition: MeterPanel.h:61
float rms[kMaxMeterBars]
Definition: MeterPanel.h:59

References clipping, headPeakCount, kMaxMeterBars, numFrames, peak, rms, tailPeakCount, and wxT().

Referenced by toStringIfClipped().

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

◆ toStringIfClipped()

wxString MeterUpdateMsg::toStringIfClipped ( )

Only print meter updates if clipping may be happening.

Definition at line 176 of file MeterPanel.cpp.

177{
178 for (int i = 0; i<kMaxMeterBars; i++)
179 {
180 if (clipping[i] || (headPeakCount[i] > 0) || (tailPeakCount[i] > 0))
181 return toString();
182 }
183 return wxT("");
184}
wxString toString()
Print out all the values in the meter update message.
Definition: MeterPanel.cpp:159

References clipping, headPeakCount, kMaxMeterBars, tailPeakCount, toString(), and wxT().

Here is the call graph for this function:

Member Data Documentation

◆ clipping

bool MeterUpdateMsg::clipping[kMaxMeterBars]

◆ headPeakCount

int MeterUpdateMsg::headPeakCount[kMaxMeterBars]

◆ numFrames

int MeterUpdateMsg::numFrames

Definition at line 57 of file MeterPanel.h.

Referenced by MeterPanel::OnMeterUpdate(), toString(), and MeterPanel::UpdateDisplay().

◆ peak

float MeterUpdateMsg::peak[kMaxMeterBars]

Definition at line 58 of file MeterPanel.h.

Referenced by MeterPanel::OnMeterUpdate(), toString(), and MeterPanel::UpdateDisplay().

◆ rms

float MeterUpdateMsg::rms[kMaxMeterBars]

Definition at line 59 of file MeterPanel.h.

Referenced by MeterPanel::OnMeterUpdate(), toString(), and MeterPanel::UpdateDisplay().

◆ tailPeakCount

int MeterUpdateMsg::tailPeakCount[kMaxMeterBars]

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