36 #ifndef DSPFILTERS_PARAMS_H
37 #define DSPFILTERS_PARAMS_H
87 for (
int i = 0; i < maxParameters; ++i)
91 double& operator[] (
int index)
96 const double& operator[] (
int index)
const
101 double value[maxParameters];
111 typedef double (
ParamInfo::*toControlValue_t) (double)
const;
112 typedef double (
ParamInfo::*toNativeValue_t) (double)
const;
113 typedef std::string (
ParamInfo::*toString_t) (double)
const;
118 ParamInfo (ParamID
id,
123 double defaultNativeValue,
124 toControlValue_t toControlValue_proc,
125 toNativeValue_t toNativeValue_proc,
126 toString_t toString_proc)
128 , m_szLabel (szLabel)
132 , m_defaultNativeValue (defaultNativeValue)
133 , m_toControlValue (toControlValue_proc)
134 , m_toNativeValue (toNativeValue_proc)
135 , m_toString (toString_proc)
140 ParamID getId ()
const
146 const char* getLabel ()
const
152 const char* getName ()
const
157 double getDefaultValue ()
const
159 return m_defaultNativeValue;
165 double toControlValue (
double nativeValue)
const
167 return (this->*m_toControlValue) (nativeValue);
174 double toNativeValue (
double controlValue)
const
176 return (this->*m_toNativeValue) (controlValue);
179 std::string toString (
double nativeValue)
const
181 return (this->*m_toString) (nativeValue);
184 double clamp (
double nativeValue)
const;
191 double Int_toControlValue (
double nativeValue)
const;
192 double Int_toNativeValue (
double controlValue)
const;
194 double Real_toControlValue (
double nativeValue)
const;
195 double Real_toNativeValue (
double controlValue)
const;
197 double Log_toControlValue (
double nativeValue)
const;
198 double Log_toNativeValue (
double controlValue)
const;
200 double Pow2_toControlValue (
double nativeValue)
const;
201 double Pow2_toNativeValue (
double controlValue)
const;
203 std::string Int_toString (
double nativeValue)
const;
204 std::string Hz_toString (
double nativeValue)
const;
205 std::string Real_toString (
double nativeValue)
const;
206 std::string Db_toString (
double nativeValue)
const;
212 static ParamInfo defaultSampleRateParam ();
213 static ParamInfo defaultCutoffFrequencyParam ();
214 static ParamInfo defaultCenterFrequencyParam ();
215 static ParamInfo defaultQParam ();
216 static ParamInfo defaultBandwidthParam ();
217 static ParamInfo defaultBandwidthHzParam ();
218 static ParamInfo defaultGainParam ();
219 static ParamInfo defaultSlopeParam ();
220 static ParamInfo defaultRippleDbParam ();
221 static ParamInfo defaultStopDbParam ();
222 static ParamInfo defaultRolloffParam ();
223 static ParamInfo defaultPoleRhoParam ();
224 static ParamInfo defaultPoleThetaParam ();
225 static ParamInfo defaultZeroRhoParam ();
226 static ParamInfo defaultZeroThetaParam ();
227 static ParamInfo defaultPoleRealParam ();
228 static ParamInfo defaultZeroRealParam ();
232 const char* m_szLabel;
233 const char* m_szName;
236 double m_defaultNativeValue;
237 toControlValue_t m_toControlValue;
238 toNativeValue_t m_toNativeValue;
239 toString_t m_toString;