Audacity  2.2.2
Enumerations | Functions | Variables
Meter.cpp File Reference
#include "../Audacity.h"
#include "Meter.h"
#include <algorithm>
#include <wx/app.h>
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/dcbuffer.h>
#include <wx/dcmemory.h>
#include <wx/image.h>
#include <wx/intl.h>
#include <wx/menu.h>
#include <wx/settings.h>
#include <wx/textdlg.h>
#include <wx/numdlg.h>
#include <wx/radiobut.h>
#include <wx/tooltip.h>
#include <math.h>
#include "../AudioIO.h"
#include "../AColor.h"
#include "../ImageManipulation.h"
#include "../prefs/GUISettings.h"
#include "../Project.h"
#include "../toolbars/MeterToolBar.h"
#include "../toolbars/ControlToolBar.h"
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "../Theme.h"
#include "../AllThemeResources.h"
#include "../Experimental.h"
#include "../widgets/valnum.h"
#include "../../images/SpeakerMenu.xpm"
#include "../../images/MicMenu.xpm"

Go to the source code of this file.

Enumerations

enum  { OnMeterUpdateID = 6000, OnMonitorID, OnPreferencesID }
 

Functions

 wxDEFINE_EVENT (EVT_METER_PREFERENCES_CHANGED, wxCommandEvent)
 
static float floatMax (float a, float b)
 
static int intmax (int a, int b)
 
static float ClipZeroToOne (float z)
 
static float ToDB (float v, float range)
 

Variables

static const long MIN_REFRESH_RATE = 1
 
static const long MAX_REFRESH_RATE = 100
 
static const int gap = 2
 
static const wxChar * PrefStyles []
 

Enumeration Type Documentation

anonymous enum
Enumerator
OnMeterUpdateID 
OnMonitorID 
OnPreferencesID 

Definition at line 188 of file Meter.cpp.

188  {
189  OnMeterUpdateID = 6000,
190  OnMonitorID,
192 };

Function Documentation

static float ClipZeroToOne ( float  z)
static

Definition at line 866 of file Meter.cpp.

Referenced by ToDB().

867 {
868  if (z > 1.0)
869  return 1.0;
870  else if (z < 0.0)
871  return 0.0;
872  else
873  return z;
874 }
static float floatMax ( float  a,
float  b 
)
static

Definition at line 849 of file Meter.cpp.

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

850 {
851  return a>b? a: b;
852 }
static int intmax ( int  a,
int  b 
)
static

Definition at line 861 of file Meter.cpp.

Referenced by MeterPanel::HandleLayout().

862 {
863  return a>b? a: b;
864 }
static float ToDB ( float  v,
float  range 
)
static

Definition at line 876 of file Meter.cpp.

References ClipZeroToOne(), and LINEAR_TO_DB.

Referenced by MeterPanel::OnMeterUpdate().

877 {
878  double db;
879  if (v > 0)
880  db = LINEAR_TO_DB(fabs(v));
881  else
882  db = -999;
883  return ClipZeroToOne((db + range) / range);
884 }
static float ClipZeroToOne(float z)
Definition: Meter.cpp:866
#define LINEAR_TO_DB(x)
Definition: Audacity.h:217
wxDEFINE_EVENT ( EVT_METER_PREFERENCES_CHANGED  ,
wxCommandEvent   
)

Variable Documentation

const int gap = 2
static
const long MAX_REFRESH_RATE = 100
static

Definition at line 77 of file Meter.cpp.

Referenced by MeterPanel::OnPreferences(), and MeterPanel::UpdatePrefs().

const long MIN_REFRESH_RATE = 1
static

Definition at line 76 of file Meter.cpp.

Referenced by MeterPanel::OnPreferences(), and MeterPanel::UpdatePrefs().

const wxChar* PrefStyles[]
static
Initial value:
=
{
wxT("AutomaticStereo"),
wxT("HorizontalStereo"),
wxT("VerticalStereo")
}

Definition at line 181 of file Meter.cpp.