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

Member Typedef Documentation

◆ MemberPointer

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

Definition at line 1211 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 1235 of file NoiseReduction.cpp.

1236 {
1237 wxTextCtrl *const text = S.Id(id + 1)
1238 .Validator<FloatingPointValidator<double>>(
1239 formatAsInt ? 0 : 2,
1240 nullptr,
1241 NumValidatorStyle::DEFAULT,
1243 )
1244 .AddTextBox(textBoxCaption, wxT(""), 0);
1245
1246 wxSlider *const slider =
1247 S.Id(id)
1248 .Name( sliderName )
1249 .Style(wxSL_HORIZONTAL)
1250 .MinSize( { 150, -1 } )
1251 .AddSlider( {}, 0, sliderMax);
1252 }
#define S(N)
Definition: ToChars.cpp:64

References S.

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

Here is the caller graph for this function:

◆ SliderSetting()

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

Definition at line 1220 of file NoiseReduction.cpp.

1221 {
1222 return std::clamp<long>(
1223 0.5 + sliderMax * (value - valueMin) / (valueMax - valueMin),
1224 0, sliderMax);
1225 }

◆ Text()

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

Definition at line 1227 of file NoiseReduction.cpp.

1228 {
1229 if (formatAsInt)
1230 return wxString::Format(format, (int)(value));
1231 else
1232 return wxString::Format(format, value);
1233 }

References format.

◆ Value()

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

Definition at line 1213 of file NoiseReduction.cpp.

1214 {
1215 return
1216 valueMin +
1217 (double(sliderSetting) / sliderMax) * (valueMax - valueMin);
1218 }

Member Data Documentation

◆ field

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

Definition at line 1254 of file NoiseReduction.cpp.

◆ format

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

Definition at line 1259 of file NoiseReduction.cpp.

◆ formatAsInt

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

Definition at line 1260 of file NoiseReduction.cpp.

◆ sliderMax

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

Definition at line 1257 of file NoiseReduction.cpp.

◆ sliderName

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

Definition at line 1262 of file NoiseReduction.cpp.

◆ textBoxCaption

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

Definition at line 1261 of file NoiseReduction.cpp.

◆ valueMax

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

Definition at line 1256 of file NoiseReduction.cpp.

◆ valueMin

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

Definition at line 1255 of file NoiseReduction.cpp.


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