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

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

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

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

Function Documentation

◆ controlInfo()

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

Definition at line 1274 of file NoiseReduction.cpp.

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

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

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

Here is the call graph for this function:
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 495 of file NoiseReduction.cpp.

498 {
499 for (size_t ii = 0; ii < numFields; ++ii) {
501 gPrefs->Read(prefix + entry.name, &(structure->*(entry.field)),
502 entry.defaultValue);
503 }
504 }
FileConfig * gPrefs
Definition: Prefs.cpp:70
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 507 of file NoiseReduction.cpp.

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

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

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

◆ 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 },
}
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().