Audacity 3.2.0
Public Types | Public Member Functions | Public Attributes | List of all members
anonymous_namespace{NoiseReduction.cpp}::ControlInfo Struct Reference
Collaboration diagram for anonymous_namespace{NoiseReduction.cpp}::ControlInfo:
[legend]

Public Types

typedef doubleEffectNoiseReduction::Settings::* MemberPointer
 

Public Member Functions

double Value (long sliderSetting) const
 
long SliderSetting (double value) const
 
wxString Text (double value) const
 
void CreateControls (int id, ShuttleGui &S) const
 
 ControlInfo (MemberPointer f, double vMin, double vMax, long sMax, const wxChar *fmt, bool fAsInt, const TranslatableString &caption, const TranslatableString &name)
 

Public Attributes

MemberPointer field
 
double valueMin
 
double valueMax
 
long sliderMax
 
const wxChar * format
 
bool formatAsInt
 
const TranslatableString textBoxCaption
 
const TranslatableString sliderName
 

Detailed Description

Definition at line 1266 of file NoiseReduction.cpp.

Member Typedef Documentation

◆ MemberPointer

typedef doubleEffectNoiseReduction::Settings::* anonymous_namespace{NoiseReduction.cpp}::ControlInfo::MemberPointer

Definition at line 1267 of file NoiseReduction.cpp.

Constructor & Destructor Documentation

◆ ControlInfo()

anonymous_namespace{NoiseReduction.cpp}::ControlInfo::ControlInfo ( MemberPointer  f,
double  vMin,
double  vMax,
long  sMax,
const wxChar *  fmt,
bool  fAsInt,
const TranslatableString caption,
const TranslatableString name 
)
inline

Member Function Documentation

◆ CreateControls()

void anonymous_namespace{NoiseReduction.cpp}::ControlInfo::CreateControls ( int  id,
ShuttleGui S 
) const
inline

Definition at line 1291 of file NoiseReduction.cpp.

1292 {
1293 wxTextCtrl *const text = S.Id(id + 1)
1294 .Validator<FloatingPointValidator<double>>(
1295 formatAsInt ? 0 : 2,
1296 nullptr,
1297 NumValidatorStyle::DEFAULT,
1299 )
1300 .AddTextBox(textBoxCaption, wxT(""), 0);
1301
1302 wxSlider *const slider =
1303 S.Id(id)
1304 .Name( sliderName )
1305 .Style(wxSL_HORIZONTAL)
1306 .MinSize( { 150, -1 } )
1307 .AddSlider( {}, 0, sliderMax);
1308 }
wxT("CloseDown"))
#define S(N)
Definition: ToChars.cpp:64

References S, and wxT().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SliderSetting()

long anonymous_namespace{NoiseReduction.cpp}::ControlInfo::SliderSetting ( double  value) const
inline

Definition at line 1276 of file NoiseReduction.cpp.

1277 {
1278 return std::clamp<long>(
1279 0.5 + sliderMax * (value - valueMin) / (valueMax - valueMin),
1280 0, sliderMax);
1281 }

◆ Text()

wxString anonymous_namespace{NoiseReduction.cpp}::ControlInfo::Text ( double  value) const
inline

Definition at line 1283 of file NoiseReduction.cpp.

1284 {
1285 if (formatAsInt)
1286 return wxString::Format(format, (int)(value));
1287 else
1288 return wxString::Format(format, value);
1289 }

References anonymous_namespace{ExportPCM.cpp}::format.

◆ Value()

double anonymous_namespace{NoiseReduction.cpp}::ControlInfo::Value ( long  sliderSetting) const
inline

Definition at line 1269 of file NoiseReduction.cpp.

1270 {
1271 return
1272 valueMin +
1273 (double(sliderSetting) / sliderMax) * (valueMax - valueMin);
1274 }

Member Data Documentation

◆ field

MemberPointer anonymous_namespace{NoiseReduction.cpp}::ControlInfo::field

Definition at line 1310 of file NoiseReduction.cpp.

◆ format

const wxChar* anonymous_namespace{NoiseReduction.cpp}::ControlInfo::format

Definition at line 1315 of file NoiseReduction.cpp.

◆ formatAsInt

bool anonymous_namespace{NoiseReduction.cpp}::ControlInfo::formatAsInt

Definition at line 1316 of file NoiseReduction.cpp.

◆ sliderMax

long anonymous_namespace{NoiseReduction.cpp}::ControlInfo::sliderMax

Definition at line 1313 of file NoiseReduction.cpp.

◆ sliderName

const TranslatableString anonymous_namespace{NoiseReduction.cpp}::ControlInfo::sliderName

Definition at line 1318 of file NoiseReduction.cpp.

◆ textBoxCaption

const TranslatableString anonymous_namespace{NoiseReduction.cpp}::ControlInfo::textBoxCaption

Definition at line 1317 of file NoiseReduction.cpp.

◆ valueMax

double anonymous_namespace{NoiseReduction.cpp}::ControlInfo::valueMax

Definition at line 1312 of file NoiseReduction.cpp.

◆ valueMin

double anonymous_namespace{NoiseReduction.cpp}::ControlInfo::valueMin

Definition at line 1311 of file NoiseReduction.cpp.


The documentation for this struct was generated from the following file: