Audacity  3.0.3
Classes | Enumerations | Functions | Variables
anonymous_namespace{NoiseReduction.cpp} Namespace Reference

Classes

struct  ControlInfo
 
struct  DiscriminationMethodInfo
 
struct  PrefsTableEntry
 
struct  WindowTypesInfo
 

Enumerations

enum  DiscriminationMethod : size_t {
  DM_MEDIAN, DM_SECOND_GREATEST, DM_OLD_METHOD, DM_N_METHODS,
  DM_DEFAULT_METHOD = DM_SECOND_GREATEST
}
 
enum  WindowTypes : unsigned {
  WT_RECTANGULAR_HANN = 0, WT_HANN_RECTANGULAR, WT_HANN_HANN, WT_BLACKMAN_HANN,
  WT_HAMMING_RECTANGULAR, WT_HAMMING_HANN, WT_N_WINDOW_TYPES, WT_DEFAULT_WINDOW_TYPES = WT_HANN_HANN
}
 
enum  { DEFAULT_WINDOW_SIZE_CHOICE = 8, DEFAULT_STEPS_PER_WINDOW_CHOICE = 1 }
 
enum  NoiseReductionChoice { NRC_REDUCE_NOISE, NRC_ISOLATE_NOISE, NRC_LEAVE_RESIDUE }
 

Functions

template<typename StructureType , typename FieldType >
void readPrefs (StructureType *structure, const wxString &prefix, const PrefsTableEntry< StructureType, FieldType > *fields, size_t numFields)
 
template<typename StructureType , typename FieldType >
void writePrefs (const StructureType *structure, const wxString &prefix, const PrefsTableEntry< StructureType, FieldType > *fields, size_t numFields)
 
const ControlInfocontrolInfo ()
 

Variables

const struct anonymous_namespace{NoiseReduction.cpp}::DiscriminationMethodInfo discriminationMethodInfo [DM_N_METHODS]
 
const float minSignalTime = 0.05f
 
const struct anonymous_namespace{NoiseReduction.cpp}::WindowTypesInfo windowTypesInfo [WT_N_WINDOW_TYPES]
 
BuiltinEffectsModule::Registration< EffectNoiseReductionreg
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_WINDOW_SIZE_CHOICE 
DEFAULT_STEPS_PER_WINDOW_CHOICE 

Definition at line 152 of file NoiseReduction.cpp.

152  {
153  DEFAULT_WINDOW_SIZE_CHOICE = 8, // corresponds to 2048
154  DEFAULT_STEPS_PER_WINDOW_CHOICE = 1 // corresponds to 4, minimum for WT_HANN_HANN
155 };

◆ DiscriminationMethod

enum anonymous_namespace{NoiseReduction.cpp}::DiscriminationMethod : size_t
Enumerator
DM_MEDIAN 
DM_SECOND_GREATEST 
DM_OLD_METHOD 
DM_N_METHODS 
DM_DEFAULT_METHOD 

Definition at line 96 of file NoiseReduction.cpp.

96  : size_t {
97  DM_MEDIAN,
100 
101  DM_N_METHODS,
103 };

◆ NoiseReductionChoice

enum anonymous_namespace{NoiseReduction.cpp}::NoiseReductionChoice
Enumerator
NRC_REDUCE_NOISE 
NRC_ISOLATE_NOISE 
NRC_LEAVE_RESIDUE 

Definition at line 157 of file NoiseReduction.cpp.

157  {
161 };

◆ WindowTypes

enum anonymous_namespace{NoiseReduction.cpp}::WindowTypes : unsigned
Enumerator
WT_RECTANGULAR_HANN 
WT_HANN_RECTANGULAR 
WT_HANN_HANN 
WT_BLACKMAN_HANN 
WT_HAMMING_RECTANGULAR 
WT_HAMMING_HANN 
WT_N_WINDOW_TYPES 
WT_DEFAULT_WINDOW_TYPES 

Definition at line 118 of file NoiseReduction.cpp.

118  : unsigned {
119  WT_RECTANGULAR_HANN = 0, // 2.0.6 behavior, requires 1/2 step
120  WT_HANN_RECTANGULAR, // requires 1/2 step
121  WT_HANN_HANN, // requires 1/4 step
122  WT_BLACKMAN_HANN, // requires 1/4 step
123  WT_HAMMING_RECTANGULAR, // requires 1/2 step
124  WT_HAMMING_HANN, // requires 1/4 step
125  // WT_HAMMING_INV_HAMMING, // requires 1/2 step
126 
129 };

Function Documentation

◆ controlInfo()

const ControlInfo* anonymous_namespace{NoiseReduction.cpp}::controlInfo ( )

Definition at line 1270 of file NoiseReduction.cpp.

1270  {
1271  static const ControlInfo table[] = {
1273  0.0, 48.0, 48, wxT("%d"), true,
1274  XXO("&Noise reduction (dB):"), XO("Noise reduction")),
1276  0.0, 24.0, 48, wxT("%.2f"), false,
1277  XXO("&Sensitivity:"), XO("Sensitivity")),
1278 #ifdef ATTACK_AND_RELEASE
1280  0, 1.0, 100, wxT("%.2f"), false,
1281  XXO("Attac&k time (secs):"), XO("Attack time")),
1283  0, 1.0, 100, wxT("%.2f"), false,
1284  XXO("R&elease time (secs):"), XO("Release time")),
1285 #endif
1287  0, 12, 12, wxT("%d"), true,
1288  XXO("&Frequency smoothing (bands):"), XO("Frequency smoothing")),
1289 
1290 #ifdef ADVANCED_SETTINGS
1292  -20.0, 20.0, 4000, wxT("%.2f"), false,
1293  XXO("Sensiti&vity (dB):"), XO("Old Sensitivity")),
1294  // add here
1295 #endif
1296  };
1297 
1298 return table;
1299 }

References EffectNoiseReduction::Settings::mAttackTime, EffectNoiseReduction::Settings::mFreqSmoothingBands, EffectNoiseReduction::Settings::mNewSensitivity, EffectNoiseReduction::Settings::mNoiseGain, EffectNoiseReduction::Settings::mOldSensitivity, EffectNoiseReduction::Settings::mReleaseTime, XO, and XXO.

Referenced by EffectNoiseReduction::Dialog::OnSlider(), EffectNoiseReduction::Dialog::OnText(), EffectNoiseReduction::Dialog::PopulateOrExchange(), and EffectNoiseReduction::Dialog::TransferDataToWindow().

Here is the caller graph for this function:

◆ readPrefs()

template<typename StructureType , typename FieldType >
void anonymous_namespace{NoiseReduction.cpp}::readPrefs ( StructureType *  structure,
const wxString &  prefix,
const PrefsTableEntry< StructureType, FieldType > *  fields,
size_t  numFields 
)

Definition at line 492 of file NoiseReduction.cpp.

495  {
496  for (size_t ii = 0; ii < numFields; ++ii) {
497  const PrefsTableEntry<StructureType, FieldType> &entry = fields[ii];
498  gPrefs->Read(prefix + entry.name, &(structure->*(entry.field)),
499  entry.defaultValue);
500  }
501  }

References entry, and gPrefs.

Referenced by EffectNoiseReduction::Settings::PrefsIO().

Here is the caller graph for this function:

◆ writePrefs()

template<typename StructureType , typename FieldType >
void anonymous_namespace{NoiseReduction.cpp}::writePrefs ( const StructureType *  structure,
const wxString &  prefix,
const PrefsTableEntry< StructureType, FieldType > *  fields,
size_t  numFields 
)

Definition at line 504 of file NoiseReduction.cpp.

507  {
508  for (size_t ii = 0; ii < numFields; ++ii) {
509  const PrefsTableEntry<StructureType, FieldType> &entry = fields[ii];
510  gPrefs->Write(prefix + entry.name, structure->*(entry.field));
511  }
512  }

References entry, and gPrefs.

Referenced by EffectNoiseReduction::Settings::PrefsIO().

Here is the caller graph for this function:

Variable Documentation

◆ discriminationMethodInfo

const struct anonymous_namespace{NoiseReduction.cpp}::DiscriminationMethodInfo anonymous_namespace{NoiseReduction.cpp}::discriminationMethodInfo[DM_N_METHODS]
Initial value:
= {
{ XO("Median") },
{ XO("Second greatest") },
{ XO("Old") },
}

Referenced by EffectNoiseReduction::Dialog::PopulateOrExchange().

◆ minSignalTime

const float anonymous_namespace{NoiseReduction.cpp}::minSignalTime = 0.05f

Definition at line 116 of file NoiseReduction.cpp.

◆ reg

BuiltinEffectsModule::Registration< EffectNoiseReduction > anonymous_namespace{NoiseReduction.cpp}::reg

Definition at line 408 of file NoiseReduction.cpp.

◆ windowTypesInfo

const struct anonymous_namespace{NoiseReduction.cpp}::WindowTypesInfo anonymous_namespace{NoiseReduction.cpp}::windowTypesInfo[WT_N_WINDOW_TYPES]
Initial value:
= {
{ Verbatim("none, Hann (2.0.6 behavior)"), 2 },
{ Verbatim("Hann, none"), 2 },
{ Verbatim("Hann, Hann (default)"), 4 },
{ Verbatim("Blackman, Hann"), 4 },
{ Verbatim("Hamming, none"), 2 },
{ Verbatim("Hamming, Hann"), 4 },
}

Referenced by EffectNoiseReduction::Dialog::PopulateOrExchange(), and EffectNoiseReduction::Settings::Validate().

anonymous_namespace{NoiseReduction.cpp}::NRC_REDUCE_NOISE
@ NRC_REDUCE_NOISE
Definition: NoiseReduction.cpp:158
anonymous_namespace{NoiseReduction.cpp}::NRC_LEAVE_RESIDUE
@ NRC_LEAVE_RESIDUE
Definition: NoiseReduction.cpp:160
anonymous_namespace{NoiseReduction.cpp}::WT_HAMMING_HANN
@ WT_HAMMING_HANN
Definition: NoiseReduction.cpp:124
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
entry
static ProjectFileIORegistry::WriterEntry entry
Definition: ProjectSettings.cpp:197
XO
#define XO(s)
Definition: Internat.h:31
anonymous_namespace{NoiseReduction.cpp}::DEFAULT_STEPS_PER_WINDOW_CHOICE
@ DEFAULT_STEPS_PER_WINDOW_CHOICE
Definition: NoiseReduction.cpp:154
anonymous_namespace{NoiseReduction.cpp}::DM_OLD_METHOD
@ DM_OLD_METHOD
Definition: NoiseReduction.cpp:99
EffectNoiseReduction::Settings::mAttackTime
double mAttackTime
Definition: NoiseReduction.cpp:230
EffectNoiseReduction::Settings::mReleaseTime
double mReleaseTime
Definition: NoiseReduction.cpp:231
XXO
#define XXO(s)
Definition: Internat.h:44
anonymous_namespace{NoiseReduction.cpp}::WT_N_WINDOW_TYPES
@ WT_N_WINDOW_TYPES
Definition: NoiseReduction.cpp:127
EffectNoiseReduction::Settings::mOldSensitivity
double mOldSensitivity
Definition: NoiseReduction.cpp:234
anonymous_namespace{NoiseReduction.cpp}::DM_SECOND_GREATEST
@ DM_SECOND_GREATEST
Definition: NoiseReduction.cpp:98
anonymous_namespace{NoiseReduction.cpp}::NRC_ISOLATE_NOISE
@ NRC_ISOLATE_NOISE
Definition: NoiseReduction.cpp:159
anonymous_namespace{NoiseReduction.cpp}::DM_N_METHODS
@ DM_N_METHODS
Definition: NoiseReduction.cpp:101
anonymous_namespace{NoiseReduction.cpp}::DM_DEFAULT_METHOD
@ DM_DEFAULT_METHOD
Definition: NoiseReduction.cpp:102
anonymous_namespace{NoiseReduction.cpp}::WT_HAMMING_RECTANGULAR
@ WT_HAMMING_RECTANGULAR
Definition: NoiseReduction.cpp:123
anonymous_namespace{NoiseReduction.cpp}::WT_DEFAULT_WINDOW_TYPES
@ WT_DEFAULT_WINDOW_TYPES
Definition: NoiseReduction.cpp:128
EffectNoiseReduction::Settings::mNoiseGain
double mNoiseGain
Definition: NoiseReduction.cpp:229
anonymous_namespace{NoiseReduction.cpp}::WT_RECTANGULAR_HANN
@ WT_RECTANGULAR_HANN
Definition: NoiseReduction.cpp:119
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
anonymous_namespace{NoiseReduction.cpp}::DM_MEDIAN
@ DM_MEDIAN
Definition: NoiseReduction.cpp:97
anonymous_namespace{NoiseReduction.cpp}::WT_HANN_HANN
@ WT_HANN_HANN
Definition: NoiseReduction.cpp:121
EffectNoiseReduction::Settings::mNewSensitivity
double mNewSensitivity
Definition: NoiseReduction.cpp:227
EffectNoiseReduction::Settings::mFreqSmoothingBands
double mFreqSmoothingBands
Definition: NoiseReduction.cpp:228
anonymous_namespace{NoiseReduction.cpp}::WT_HANN_RECTANGULAR
@ WT_HANN_RECTANGULAR
Definition: NoiseReduction.cpp:120
anonymous_namespace{NoiseReduction.cpp}::WT_BLACKMAN_HANN
@ WT_BLACKMAN_HANN
Definition: NoiseReduction.cpp:122
anonymous_namespace{NoiseReduction.cpp}::DEFAULT_WINDOW_SIZE_CHOICE
@ DEFAULT_WINDOW_SIZE_CHOICE
Definition: NoiseReduction.cpp:153