Audacity  3.0.3
Classes | Macros | Functions
Effect.h File Reference
#include <functional>
#include <set>
#include <wx/defs.h>
#include "audacity/ConfigInterface.h"
#include "audacity/EffectInterface.h"
#include "../SelectedRegion.h"
#include "../Track.h"
#include "../widgets/wxPanelWrapper.h"
Include dependency graph for Effect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Effect
 Base class for many of the effects in Audacity. More...
 
class  Effect::AddedAnalysisTrack
 
class  Effect::ModifiedAnalysisTrack
 

Macros

#define BUILTIN_EFFECT_PREFIX   wxT("Built-in Effect: ")
 
#define NYQUISTEFFECTS_FAMILY   ( EffectFamilySymbol{ XO("Nyquist") } )
 
#define NYQUIST_PROMPT_ID   wxT("Nyquist Prompt")
 
#define NYQUIST_WORKER_ID   wxT("Nyquist Worker")
 
#define ID_EFFECT_PREVIEW   ePreviewID
 
#define Param(name, type, key, def, min, max, scale)
 
#define PBasic(name, type, key, def)
 
#define PRange(name, type, key, def, min, max)
 
#define PScale(name, type, key, def, min, max, scale)
 
#define ReadParam(type, name)
 
#define ReadBasic(type, name)
 
#define ReadAndVerifyEnum(name, list, listSize)
 
#define ReadAndVerifyEnumWithObsoletes(name, list, listSize, obsoleteList, nObsolete)
 
#define ReadAndVerifyInt(name)   ReadParam(int, name)
 
#define ReadAndVerifyDouble(name)   ReadParam(double, name)
 
#define ReadAndVerifyFloat(name)   ReadParam(float, name)
 
#define ReadAndVerifyBool(name)   ReadBasic(bool, name)
 
#define ReadAndVerifyString(name)   ReadBasic(wxString, name)
 

Functions

float TrapFloat (float x, float min, float max)
 
double TrapDouble (double x, double min, double max)
 
long TrapLong (long x, long min, long max)
 

Macro Definition Documentation

◆ BUILTIN_EFFECT_PREFIX

#define BUILTIN_EFFECT_PREFIX   wxT("Built-in Effect: ")

Definition at line 41 of file Effect.h.

◆ ID_EFFECT_PREVIEW

#define ID_EFFECT_PREVIEW   ePreviewID

Definition at line 548 of file Effect.h.

◆ NYQUIST_PROMPT_ID

#define NYQUIST_PROMPT_ID   wxT("Nyquist Prompt")

Definition at line 60 of file Effect.h.

◆ NYQUIST_WORKER_ID

#define NYQUIST_WORKER_ID   wxT("Nyquist Worker")

Definition at line 61 of file Effect.h.

◆ NYQUISTEFFECTS_FAMILY

#define NYQUISTEFFECTS_FAMILY   ( EffectFamilySymbol{ XO("Nyquist") } )

Definition at line 58 of file Effect.h.

◆ Param

#define Param (   name,
  type,
  key,
  def,
  min,
  max,
  scale 
)
Value:
static const wxChar * KEY_ ## name = (key); \
static const type DEF_ ## name = (def); \
static const type MIN_ ## name = (min); \
static const type MAX_ ## name = (max); \
static const type SCL_ ## name = (scale);

Definition at line 587 of file Effect.h.

◆ PBasic

#define PBasic (   name,
  type,
  key,
  def 
)
Value:
static const wxChar * KEY_ ## name = (key); \
static const type DEF_ ## name = (def);

Definition at line 594 of file Effect.h.

◆ PRange

#define PRange (   name,
  type,
  key,
  def,
  min,
  max 
)
Value:
PBasic(name, type, key, def); \
static const type MIN_ ## name = (min); \
static const type MAX_ ## name = (max);

Definition at line 598 of file Effect.h.

◆ PScale

#define PScale (   name,
  type,
  key,
  def,
  min,
  max,
  scale 
)
Value:
PRange(name, type, key, def, min, max); \
static const type SCL_ ## name = (scale);

Definition at line 603 of file Effect.h.

◆ ReadAndVerifyBool

#define ReadAndVerifyBool (   name)    ReadBasic(bool, name)

Definition at line 634 of file Effect.h.

◆ ReadAndVerifyDouble

#define ReadAndVerifyDouble (   name)    ReadParam(double, name)

Definition at line 632 of file Effect.h.

◆ ReadAndVerifyEnum

#define ReadAndVerifyEnum (   name,
  list,
  listSize 
)
Value:
int name; \
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, list, listSize)) \
return false;

Definition at line 620 of file Effect.h.

◆ ReadAndVerifyEnumWithObsoletes

#define ReadAndVerifyEnumWithObsoletes (   name,
  list,
  listSize,
  obsoleteList,
  nObsolete 
)
Value:
int name; \
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, \
list, listSize, obsoleteList, nObsolete)) \
return false;

Definition at line 625 of file Effect.h.

◆ ReadAndVerifyFloat

#define ReadAndVerifyFloat (   name)    ReadParam(float, name)

Definition at line 633 of file Effect.h.

◆ ReadAndVerifyInt

#define ReadAndVerifyInt (   name)    ReadParam(int, name)

Definition at line 631 of file Effect.h.

◆ ReadAndVerifyString

#define ReadAndVerifyString (   name)    ReadBasic(wxString, name)

Definition at line 635 of file Effect.h.

◆ ReadBasic

#define ReadBasic (   type,
  name 
)
Value:
type name; \
wxUnusedVar(MIN_ ##name); \
wxUnusedVar(MAX_ ##name); \
wxUnusedVar(SCL_ ##name); \
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name)) \
return false;

Definition at line 612 of file Effect.h.

◆ ReadParam

#define ReadParam (   type,
  name 
)
Value:
type name = DEF_ ## name; \
if (!parms.ReadAndVerify(KEY_ ## name, &name, DEF_ ## name, MIN_ ## name, MAX_ ## name)) \
return false;

Definition at line 607 of file Effect.h.

Function Documentation

◆ TrapDouble()

double TrapDouble ( double  x,
double  min,
double  max 
)
inline

Definition at line 563 of file Effect.h.

564 {
565  if (x <= min)
566  return min;
567 
568  if (x >= max)
569  return max;
570 
571  return x;
572 }

References min().

Referenced by EffectAmplify::OnAmpSlider(), EffectAmplify::OnAmpText(), EffectAutoDuckPanel::OnMotion(), EffectAmplify::OnPeakText(), EffectLoudness::Process(), EffectNormalize::Process(), EffectToneGen::SetAutomationParameters(), EffectAmplify::TransferDataFromWindow(), EffectAmplify::TransferDataToWindow(), and EffectChangeSpeed::Update_TimeCtrl_ToLength().

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

◆ TrapFloat()

float TrapFloat ( float  x,
float  min,
float  max 
)
inline

Definition at line 552 of file Effect.h.

553 {
554  if (x <= min)
555  return min;
556 
557  if (x >= max)
558  return max;
559 
560  return x;
561 }

References min().

Here is the call graph for this function:

◆ TrapLong()

long TrapLong ( long  x,
long  min,
long  max 
)
inline

Definition at line 574 of file Effect.h.

575 {
576  if (x <= min)
577  return min;
578 
579  if (x >= max)
580  return max;
581 
582  return x;
583 }

References min().

Referenced by NoiseRemovalDialog::OnFreqText(), NoiseRemovalDialog::OnGainText(), NoiseRemovalDialog::OnSensitivityText(), NoiseRemovalDialog::OnTimeText(), anonymous_namespace{NoiseReduction.cpp}::ControlInfo::SliderSetting(), and NoiseRemovalDialog::TransferDataToWindow().

Here is the call graph for this function:
Here is the caller graph for this function:
PBasic
#define PBasic(name, type, key, def)
Definition: Effect.h:594
PRange
#define PRange(name, type, key, def, min, max)
Definition: Effect.h:598
name
const TranslatableString name
Definition: Distortion.cpp:98
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:196