Audacity 3.2.0
Functions
anonymous_namespace{ExportMP3.cpp} Namespace Reference

Functions

int ValidateValue (int nValues, int value, int defaultValue)
 
int ValidateValue (const std::vector< int > &values, int value, int defaultValue)
 
int ValidateIndex (const std::vector< int > &values, int value, int defaultIndex)
 

Function Documentation

◆ ValidateIndex()

int anonymous_namespace{ExportMP3.cpp}::ValidateIndex ( const std::vector< int > &  values,
int  value,
int  defaultIndex 
)

Definition at line 458 of file ExportMP3.cpp.

459{
460 auto start = values.begin(), finish = values.end(),
461 iter = std::find( start, finish, value );
462 return ( iter != finish ) ? static_cast<int>( iter - start ) : defaultIndex;
463}
const wxChar * values

References values.

◆ ValidateValue() [1/2]

int anonymous_namespace{ExportMP3.cpp}::ValidateValue ( const std::vector< int > &  values,
int  value,
int  defaultValue 
)

Definition at line 451 of file ExportMP3.cpp.

452{
453 auto start = values.begin(), finish = values.end(),
454 iter = std::find( start, finish, value );
455 return ( iter != finish ) ? value : defaultValue;
456}

References values.

◆ ValidateValue() [2/2]

int anonymous_namespace{ExportMP3.cpp}::ValidateValue ( int  nValues,
int  value,
int  defaultValue 
)

Definition at line 446 of file ExportMP3.cpp.

447{
448 return (value >= 0 && value < nValues) ? value : defaultValue;
449}