Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
NumberScale::Iterator Class Reference

#include <NumberScale.h>

Public Member Functions

 Iterator (NumberScaleType type, float step, float value)
 
float operator* () const
 
Iteratoroperator++ ()
 

Private Attributes

const NumberScaleType mType
 
const float mStep
 
float mValue
 

Detailed Description

Definition at line 178 of file NumberScale.h.

Constructor & Destructor Documentation

◆ Iterator()

NumberScale::Iterator::Iterator ( NumberScaleType  type,
float  step,
float  value 
)
inline

Definition at line 181 of file NumberScale.h.

182 : mType(type), mStep(step), mValue(value)
183 {
184 }
const NumberScaleType mType
Definition: NumberScale.h:227

Member Function Documentation

◆ operator*()

float NumberScale::Iterator::operator* ( ) const
inline

Definition at line 186 of file NumberScale.h.

187 {
188 switch (mType) {
189 default:
190 wxASSERT(false);
191 case nstLinear:
192 case nstNone:
193 case nstLogarithmic:
194 return mValue;
195 case nstMel:
196 return melToHz(mValue);
197 case nstBark:
198 return barkToHz(mValue);
199 case nstErb:
200 return erbToHz(mValue);
201 case nstPeriod:
202 return periodToHz(mValue);
203 }
204 }
@ nstMel
Definition: NumberScale.h:21
@ nstNone
Definition: NumberScale.h:27
@ nstErb
Definition: NumberScale.h:23
@ nstPeriod
Definition: NumberScale.h:24
@ nstLinear
Definition: NumberScale.h:19
@ nstLogarithmic
Definition: NumberScale.h:20
@ nstBark
Definition: NumberScale.h:22
static float erbToHz(float erb)
Definition: NumberScale.h:139
static float periodToHz(float u)
Definition: NumberScale.h:149
static float barkToHz(float z1)
Definition: NumberScale.h:125
static float melToHz(float mel)
Definition: NumberScale.h:108

References NumberScale::barkToHz(), NumberScale::erbToHz(), NumberScale::melToHz(), mType, mValue, nstBark, nstErb, nstLinear, nstLogarithmic, nstMel, nstNone, nstPeriod, and NumberScale::periodToHz().

Here is the call graph for this function:

◆ operator++()

Iterator & NumberScale::Iterator::operator++ ( )
inline

Definition at line 206 of file NumberScale.h.

207 {
208 switch (mType) {
209 case nstLinear:
210 case nstNone:
211 case nstMel:
212 case nstBark:
213 case nstErb:
214 case nstPeriod:
215 mValue += mStep;
216 break;
217 case nstLogarithmic:
218 mValue *= mStep;
219 break;
220 default:
221 wxASSERT(false);
222 }
223 return *this;
224 }

References mStep, mType, mValue, nstBark, nstErb, nstLinear, nstLogarithmic, nstMel, nstNone, and nstPeriod.

Member Data Documentation

◆ mStep

const float NumberScale::Iterator::mStep
private

Definition at line 228 of file NumberScale.h.

Referenced by operator++().

◆ mType

const NumberScaleType NumberScale::Iterator::mType
private

Definition at line 227 of file NumberScale.h.

Referenced by operator*(), and operator++().

◆ mValue

float NumberScale::Iterator::mValue
private

Definition at line 229 of file NumberScale.h.

Referenced by operator*(), and operator++().


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