Audacity 3.2.0
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

◆ 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.

◆ 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 1272 of file NoiseReduction.cpp.

1272 {
1273 static const ControlInfo table[] = {
1275 0.0, 48.0, 48, wxT("%d"), true,
1276 XXO("&Noise reduction (dB):"), XO("Noise reduction")),
1278 0.0, 24.0, 48, wxT("%.2f"), false,
1279 XXO("&Sensitivity:"), XO("Sensitivity")),
1280#ifdef ATTACK_AND_RELEASE
1282 0, 1.0, 100, wxT("%.2f"), false,
1283 XXO("Attac&k time (secs):"), XO("Attack time")),
1285 0, 1.0, 100, wxT("%.2f"), false,
1286 XXO("R&elease time (secs):"), XO("Release time")),
1287#endif
1289 0, 12, 12, wxT("%d"), true,
1290 XXO("&Frequency smoothing (bands):"), XO("Frequency smoothing")),
1291
1292#ifdef ADVANCED_SETTINGS
1294 -20.0, 20.0, 4000, wxT("%.2f"), false,
1295 XXO("Sensiti&vity (dB):"), XO("Old Sensitivity")),
1296 // add here
1297#endif
1298 };
1299
1300return table;
1301}
#define XXO(s)
Definition: Internat.h:44
#define XO(s)
Definition: Internat.h:31

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 494 of file NoiseReduction.cpp.

497 {
498 for (size_t ii = 0; ii < numFields; ++ii) {
500 gPrefs->Read(prefix + entry.name, &(structure->*(entry.field)),
501 entry.defaultValue);
502 }
503 }
FileConfig * gPrefs
Definition: Prefs.cpp:71
static ProjectFileIORegistry::AttributeWriterEntry entry

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 506 of file NoiseReduction.cpp.

509 {
510 for (size_t ii = 0; ii < numFields; ++ii) {
512 gPrefs->Write(prefix + entry.name, structure->*(entry.field));
513 }
514 }

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.

Referenced by EffectNoiseReduction::Worker::Worker().

◆ reg

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

Definition at line 409 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 },
}
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.

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