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 864 of file Meter.cpp.

Referenced by ToDB().

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

Definition at line 847 of file Meter.cpp.

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

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

Definition at line 859 of file Meter.cpp.

Referenced by MeterPanel::HandleLayout().

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

Definition at line 874 of file Meter.cpp.

References ClipZeroToOne(), and LINEAR_TO_DB.

Referenced by MeterPanel::OnMeterUpdate().

875 {
876  double db;
877  if (v > 0)
878  db = LINEAR_TO_DB(fabs(v));
879  else
880  db = -999;
881  return ClipZeroToOne((db + range) / range);
882 }
static float ClipZeroToOne(float z)
Definition: Meter.cpp:864
#define LINEAR_TO_DB(x)
Definition: Audacity.h:210
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.