Audacity  3.0.3
Classes | Namespaces | Macros | Enumerations | Functions | Variables
TruncSilence.cpp File Reference
#include "TruncSilence.h"
#include "LoadEffects.h"
#include <algorithm>
#include <list>
#include <limits>
#include <math.h>
#include <wx/checkbox.h>
#include <wx/choice.h>
#include <wx/valgen.h>
#include "Prefs.h"
#include "Project.h"
#include "../ProjectSettings.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../WaveTrack.h"
#include "../widgets/valnum.h"
#include "../widgets/AudacityMessageBox.h"
Include dependency graph for TruncSilence.cpp:

Go to the source code of this file.

Classes

class  Enums
 Enums is a helper class for Shuttle. It defines enumerations which are used in effects dialogs, in the effects themselves and in preferences. More...
 
class  RegionList
 

Namespaces

 anonymous_namespace{TruncSilence.cpp}
 

Macros

#define DefaultAndLimits(name, def, min, max)
 

Enumerations

enum  kActions { kTruncate, kCompress, nActions }
 

Functions

static double enumToDB (int val)
 
 Param (DbIndex, int, wxT("Db"), 0, 0, Enums::NumDbChoices - 1, 1)
 
 Param (Threshold, double, wxT("Threshold"), -20.0, -80.0, -20.0, 1)
 
 Param (ActIndex, int, wxT("Action"), kTruncate, 0, nActions - 1, 1)
 
 Param (Minimum, double, wxT("Minimum"), 0.5, 0.001, 10000.0, 1)
 
 Param (Truncate, double, wxT("Truncate"), 0.5, 0.0, 10000.0, 1)
 
 Param (Compress, double, wxT("Compress"), 50.0, 0.0, 99.9, 1)
 
 Param (Independent, bool, wxT("Independent"), false, false, true, 1)
 

Variables

static const EnumValueSymbol kActionStrings [nActions]
 
static CommandParameters::ObsoleteMap kObsoleteActions []
 
static const size_t nObsoleteActions = WXSIZEOF( kObsoleteActions )
 
static const size_t DEF_BlendFrameCount = 100
 
static const double DEF_MinTruncMs = 0.001
 
const double detectFrac = 0.4
 
BuiltinEffectsModule::Registration< EffectTruncSilenceanonymous_namespace{TruncSilence.cpp}::reg
 

Macro Definition Documentation

◆ DefaultAndLimits

#define DefaultAndLimits (   name,
  def,
  min,
  max 
)
Value:
static const double DEF_ ## name = (def); \
static const double MIN_ ## name = (min); \
static const double MAX_ ## name = (max);

Definition at line 95 of file TruncSilence.cpp.

Enumeration Type Documentation

◆ kActions

enum kActions
Enumerator
kTruncate 
kCompress 
nActions 

Definition at line 73 of file TruncSilence.cpp.

74 {
75  kTruncate,
76  kCompress,
77  nActions
78 };

Function Documentation

◆ enumToDB()

static double enumToDB ( int  val)
inlinestatic

Definition at line 66 of file TruncSilence.cpp.

66 { return -( 5.0 * val + 20.0 ); }

Referenced by EffectTruncSilence::SetAutomationParameters(), and EffectTruncSilence::Startup().

Here is the caller graph for this function:

◆ Param() [1/7]

Param ( ActIndex  ,
int  ,
wxT("Action")  ,
kTruncate  ,
,
nActions 1,
 
)

◆ Param() [2/7]

Param ( Compress  ,
double  ,
wxT("Compress")  ,
50.  0,
0.  0,
99.  9,
 
)

◆ Param() [3/7]

Param ( DbIndex  ,
int  ,
wxT("Db")  ,
,
,
Enums::NumDbChoices 1,
 
)

◆ Param() [4/7]

Param ( Independent  ,
bool  ,
wxT("Independent")  ,
false  ,
false  ,
true  ,
 
)

◆ Param() [5/7]

Param ( Minimum  ,
double  ,
wxT("Minimum")  ,
0.  5,
0.  001,
10000.  0,
 
)

◆ Param() [6/7]

Param ( Threshold  ,
double  ,
wxT("Threshold")  ,
-20.  0,
-80.  0,
-20.  0,
 
)

◆ Param() [7/7]

Param ( Truncate  ,
double  ,
wxT("Truncate")  ,
0.  5,
0.  0,
10000.  0,
 
)

Variable Documentation

◆ DEF_BlendFrameCount

const size_t DEF_BlendFrameCount = 100
static

Definition at line 114 of file TruncSilence.cpp.

Referenced by EffectTruncSilence::EffectTruncSilence().

◆ DEF_MinTruncMs

const double DEF_MinTruncMs = 0.001
static

◆ detectFrac

const double detectFrac = 0.4

Definition at line 121 of file TruncSilence.cpp.

Referenced by EffectTruncSilence::Analyze(), and EffectTruncSilence::DoRemoval().

◆ kActionStrings

const EnumValueSymbol kActionStrings[nActions]
static
Initial value:
=
{
{ XO("Truncate Detected Silence") },
{ XO("Compress Excess Silence") }
}

Definition at line 80 of file TruncSilence.cpp.

Referenced by EffectTruncSilence::DefineParams(), EffectTruncSilence::GetAutomationParameters(), EffectTruncSilence::PopulateOrExchange(), and EffectTruncSilence::SetAutomationParameters().

◆ kObsoleteActions

CommandParameters::ObsoleteMap kObsoleteActions[]
static
Initial value:
= {
{ wxT("0"), 0 },
{ wxT("1"), 1 },
}

Definition at line 86 of file TruncSilence.cpp.

Referenced by EffectTruncSilence::SetAutomationParameters().

◆ nObsoleteActions

const size_t nObsoleteActions = WXSIZEOF( kObsoleteActions )
static

Definition at line 92 of file TruncSilence.cpp.

Referenced by EffectTruncSilence::SetAutomationParameters().

kTruncate
@ kTruncate
Definition: TruncSilence.cpp:75
XO
#define XO(s)
Definition: Internat.h:31
kCompress
@ kCompress
Definition: TruncSilence.cpp:76
name
const TranslatableString name
Definition: Distortion.cpp:98
nActions
@ nActions
Definition: TruncSilence.cpp:77
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106