Audacity  3.0.3
Classes | Macros | Functions
Effect.h File Reference
#include <functional>
#include <set>
#include <wx/defs.h>
#include "ConfigInterface.h"
#include "EffectInterface.h"
#include "PluginInterface.h"
#include "SampleCount.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_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 43 of file Effect.h.

◆ ID_EFFECT_PREVIEW

#define ID_EFFECT_PREVIEW   ePreviewID

Definition at line 549 of file Effect.h.

◆ NYQUIST_WORKER_ID

#define NYQUIST_WORKER_ID   wxT("Nyquist Worker")

Definition at line 62 of file Effect.h.

◆ NYQUISTEFFECTS_FAMILY

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

Definition at line 60 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 588 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 595 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 599 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 604 of file Effect.h.

◆ ReadAndVerifyBool

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

Definition at line 635 of file Effect.h.

◆ ReadAndVerifyDouble

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

Definition at line 633 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 621 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 626 of file Effect.h.

◆ ReadAndVerifyFloat

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

Definition at line 634 of file Effect.h.

◆ ReadAndVerifyInt

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

Definition at line 632 of file Effect.h.

◆ ReadAndVerifyString

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

Definition at line 636 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 613 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 608 of file Effect.h.

Function Documentation

◆ TrapDouble()

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

Definition at line 564 of file Effect.h.

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

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 553 of file Effect.h.

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

References min().

Here is the call graph for this function:

◆ TrapLong()

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

Definition at line 575 of file Effect.h.

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

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:595
PRange
#define PRange(name, type, key, def, min, max)
Definition: Effect.h:599
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:201