Audacity  3.0.3
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 1216 of file NoiseReduction.cpp.

Member Typedef Documentation

◆ MemberPointer

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

Definition at line 1217 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

Definition at line 1270 of file NoiseReduction.cpp.

1272  : field(f), valueMin(vMin), valueMax(vMax), sliderMax(sMax), format(fmt), formatAsInt(fAsInt)
1273  , textBoxCaption(caption), sliderName(name)
1274  {
1275  }

Member Function Documentation

◆ CreateControls()

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

Definition at line 1241 of file NoiseReduction.cpp.

1242  {
1243  wxTextCtrl *const text = S.Id(id + 1)
1244  .Validator<FloatingPointValidator<double>>(
1245  formatAsInt ? 0 : 2,
1246  nullptr,
1247  NumValidatorStyle::DEFAULT,
1249  )
1250  .AddTextBox(textBoxCaption, wxT(""), 0);
1251 
1252  wxSlider *const slider =
1253  S.Id(id)
1254  .Name( sliderName )
1255  .Style(wxSL_HORIZONTAL)
1256  .MinSize( { 150, -1 } )
1257  .AddSlider( {}, 0, sliderMax);
1258  }

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

1227  {
1228  return TrapLong(
1229  0.5 + sliderMax * (value - valueMin) / (valueMax - valueMin),
1230  0, sliderMax);
1231  }

References TrapLong().

Here is the call graph for this function:

◆ Text()

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

Definition at line 1233 of file NoiseReduction.cpp.

1234  {
1235  if (formatAsInt)
1236  return wxString::Format(format, (int)(value));
1237  else
1238  return wxString::Format(format, value);
1239  }

References format.

◆ Value()

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

Definition at line 1219 of file NoiseReduction.cpp.

1220  {
1221  return
1222  valueMin +
1223  (double(sliderSetting) / sliderMax) * (valueMax - valueMin);
1224  }

Member Data Documentation

◆ field

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

Definition at line 1260 of file NoiseReduction.cpp.

◆ format

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

Definition at line 1265 of file NoiseReduction.cpp.

◆ formatAsInt

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

Definition at line 1266 of file NoiseReduction.cpp.

◆ sliderMax

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

Definition at line 1263 of file NoiseReduction.cpp.

◆ sliderName

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

Definition at line 1268 of file NoiseReduction.cpp.

◆ textBoxCaption

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

Definition at line 1267 of file NoiseReduction.cpp.

◆ valueMax

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

Definition at line 1262 of file NoiseReduction.cpp.

◆ valueMin

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

Definition at line 1261 of file NoiseReduction.cpp.


The documentation for this struct was generated from the following file:
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::format
const wxChar * format
Definition: NoiseReduction.cpp:1265
S
#define S(N)
Definition: ToChars.cpp:64
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::formatAsInt
bool formatAsInt
Definition: NoiseReduction.cpp:1266
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::valueMin
double valueMin
Definition: NoiseReduction.cpp:1261
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::sliderMax
long sliderMax
Definition: NoiseReduction.cpp:1263
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::valueMax
double valueMax
Definition: NoiseReduction.cpp:1262
name
const TranslatableString name
Definition: Distortion.cpp:98
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::sliderName
const TranslatableString sliderName
Definition: NoiseReduction.cpp:1268
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::textBoxCaption
const TranslatableString textBoxCaption
Definition: NoiseReduction.cpp:1267
TrapLong
long TrapLong(long x, long min, long max)
Definition: Effect.h:543
anonymous_namespace{NoiseReduction.cpp}::ControlInfo::field
MemberPointer field
Definition: NoiseReduction.cpp:1260