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

Message used to update the MeterPanel. More...

#include <Meter.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 57 of file Meter.h.

Constructor & Destructor Documentation

MeterUpdateMsg::MeterUpdateMsg ( )
inline

Definition at line 68 of file Meter.h.

68 { }
MeterUpdateMsg::~MeterUpdateMsg ( )
inline

Definition at line 69 of file Meter.h.

69 { }

Member Function Documentation

wxString MeterUpdateMsg::toString ( )

Print out all the values in the meter update message.

Definition at line 81 of file Meter.cpp.

References clipping, headPeakCount, kMaxMeterBars, numFrames, peak, rms, and tailPeakCount.

Referenced by toStringIfClipped().

82 {
83 wxString output; // somewhere to build up a string in
84 output = wxString::Format(wxT("Meter update msg: %i channels, %i samples\n"), \
86 for (int i = 0; i<kMaxMeterBars; i++)
87  { // for each channel of the meters
88  output += wxString::Format(wxT("%f peak, %f rms "), peak[i], rms[i]);
89  if (clipping[i])
90  output += wxString::Format(wxT("clipped "));
91  else
92  output += wxString::Format(wxT("no clip "));
93  output += wxString::Format(wxT("%i head, %i tail\n"), headPeakCount[i], tailPeakCount[i]);
94  }
95 return output;
96 }
float rms[kMaxMeterBars]
Definition: Meter.h:62
int tailPeakCount[kMaxMeterBars]
Definition: Meter.h:65
bool clipping[kMaxMeterBars]
Definition: Meter.h:63
float peak[kMaxMeterBars]
Definition: Meter.h:61
const int kMaxMeterBars
Definition: Meter.h:40
int numFrames
Definition: Meter.h:60
int headPeakCount[kMaxMeterBars]
Definition: Meter.h:64
wxString MeterUpdateMsg::toStringIfClipped ( )

Only print meter updates if clipping may be happening.

Definition at line 98 of file Meter.cpp.

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

99 {
100  for (int i = 0; i<kMaxMeterBars; i++)
101  {
102  if (clipping[i] || (headPeakCount[i] > 0) || (tailPeakCount[i] > 0))
103  return toString();
104  }
105  return wxT("");
106 }
int tailPeakCount[kMaxMeterBars]
Definition: Meter.h:65
bool clipping[kMaxMeterBars]
Definition: Meter.h:63
const int kMaxMeterBars
Definition: Meter.h:40
wxString toString()
Print out all the values in the meter update message.
Definition: Meter.cpp:81
int headPeakCount[kMaxMeterBars]
Definition: Meter.h:64

Member Data Documentation

bool MeterUpdateMsg::clipping[kMaxMeterBars]
int MeterUpdateMsg::headPeakCount[kMaxMeterBars]
int MeterUpdateMsg::numFrames

Definition at line 60 of file Meter.h.

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

float MeterUpdateMsg::peak[kMaxMeterBars]

Definition at line 61 of file Meter.h.

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

float MeterUpdateMsg::rms[kMaxMeterBars]

Definition at line 62 of file Meter.h.

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

int MeterUpdateMsg::tailPeakCount[kMaxMeterBars]

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