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

Member Typedef Documentation

◆ MemberPointer

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

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

243 {
244 wxTextCtrl *const text = S.Id(id + 1)
245 .Validator<FloatingPointValidator<double>>(
246 formatAsInt ? 0 : 2,
247 nullptr,
248 NumValidatorStyle::DEFAULT,
250 )
251 .AddTextBox(textBoxCaption, wxT(""), 0);
252
253 wxSlider *const slider =
254 S.Id(id)
255 .Name( sliderName )
256 .Style(wxSL_HORIZONTAL)
257 .MinSize( { 150, -1 } )
258 .AddSlider( {}, 0, sliderMax);
259 }
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 227 of file NoiseReduction.cpp.

228 {
229 return std::clamp<long>(
230 0.5 + sliderMax * (value - valueMin) / (valueMax - valueMin),
231 0, sliderMax);
232 }

◆ Text()

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

Definition at line 234 of file NoiseReduction.cpp.

235 {
236 if (formatAsInt)
237 return wxString::Format(format, (int)(value));
238 else
239 return wxString::Format(format, value);
240 }

References anonymous_namespace{ExportPCM.cpp}::format.

◆ Value()

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

Definition at line 220 of file NoiseReduction.cpp.

221 {
222 return
223 valueMin +
224 (double(sliderSetting) / sliderMax) * (valueMax - valueMin);
225 }

Member Data Documentation

◆ field

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

Definition at line 261 of file NoiseReduction.cpp.

◆ format

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

Definition at line 266 of file NoiseReduction.cpp.

◆ formatAsInt

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

Definition at line 267 of file NoiseReduction.cpp.

◆ sliderMax

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

Definition at line 264 of file NoiseReduction.cpp.

◆ sliderName

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

Definition at line 269 of file NoiseReduction.cpp.

◆ textBoxCaption

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

Definition at line 268 of file NoiseReduction.cpp.

◆ valueMax

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

Definition at line 263 of file NoiseReduction.cpp.

◆ valueMin

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

Definition at line 262 of file NoiseReduction.cpp.


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