dBV is actually mislabeled dBFS (#3095)
* Relabel "dBV" to "dBFS" in function names and GUI * Write a ConfigManager upgrade for older versions
This commit is contained in:
committed by
Tres Finocchiaro
parent
3d43937bf3
commit
c9618961d6
@@ -252,6 +252,7 @@ private:
|
||||
~ConfigManager();
|
||||
|
||||
void upgrade_1_1_90();
|
||||
void upgrade_1_1_91();
|
||||
void upgrade();
|
||||
|
||||
QString m_lmmsRcFile;
|
||||
|
||||
@@ -98,7 +98,7 @@ private slots:
|
||||
|
||||
void toggleToolTips( bool _enabled );
|
||||
void toggleWarnAfterSetup( bool _enabled );
|
||||
void toggleDisplaydBV( bool _enabled );
|
||||
void toggleDisplaydBFS( bool _enabled );
|
||||
void toggleMMPZ( bool _enabled );
|
||||
void toggleDisableBackup( bool _enabled );
|
||||
void toggleOpenLastProject( bool _enabled );
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
|
||||
bool m_toolTips;
|
||||
bool m_warnAfterSetup;
|
||||
bool m_displaydBV;
|
||||
bool m_displaydBFS;
|
||||
bool m_MMPZ;
|
||||
bool m_disableBackup;
|
||||
bool m_openLastProject;
|
||||
|
||||
@@ -243,10 +243,10 @@ static inline float linearToLogScale( float min, float max, float value )
|
||||
|
||||
|
||||
|
||||
//! @brief Converts linear amplitude (0-1.0) to dBV scale. Handles zeroes as -inf.
|
||||
//! @param amp Linear amplitude, where 1.0 = 0dBV.
|
||||
//! @return Amplitude in dBV. -inf for 0 amplitude.
|
||||
static inline float safeAmpToDbv( float amp )
|
||||
//! @brief Converts linear amplitude (0-1.0) to dBFS scale. Handles zeroes as -inf.
|
||||
//! @param amp Linear amplitude, where 1.0 = 0dBFS.
|
||||
//! @return Amplitude in dBFS. -inf for 0 amplitude.
|
||||
static inline float safeAmpToDbfs( float amp )
|
||||
{
|
||||
return amp == 0.0f
|
||||
? -INFINITY
|
||||
@@ -254,32 +254,32 @@ static inline float safeAmpToDbv( float amp )
|
||||
}
|
||||
|
||||
|
||||
//! @brief Converts dBV-scale to linear amplitude with 0dBV = 1.0. Handles infinity as zero.
|
||||
//! @param dbv The dBV value to convert: all infinites are treated as -inf and result in 0
|
||||
//! @brief Converts dBFS-scale to linear amplitude with 0dBFS = 1.0. Handles infinity as zero.
|
||||
//! @param dbfs The dBFS value to convert: all infinites are treated as -inf and result in 0
|
||||
//! @return Linear amplitude
|
||||
static inline float safeDbvToAmp( float dbv )
|
||||
static inline float safeDbfsToAmp( float dbfs )
|
||||
{
|
||||
return isinff( dbv )
|
||||
return isinff( dbfs )
|
||||
? 0.0f
|
||||
: exp10f( dbv * 0.05f );
|
||||
: exp10f( dbfs * 0.05f );
|
||||
}
|
||||
|
||||
|
||||
//! @brief Converts linear amplitude (>0-1.0) to dBV scale.
|
||||
//! @param amp Linear amplitude, where 1.0 = 0dBV. ** Must be larger than zero! **
|
||||
//! @return Amplitude in dBV.
|
||||
static inline float ampToDbv( float amp )
|
||||
//! @brief Converts linear amplitude (>0-1.0) to dBFS scale.
|
||||
//! @param amp Linear amplitude, where 1.0 = 0dBFS. ** Must be larger than zero! **
|
||||
//! @return Amplitude in dBFS.
|
||||
static inline float ampToDbfs( float amp )
|
||||
{
|
||||
return log10f( amp ) * 20.0f;
|
||||
}
|
||||
|
||||
|
||||
//! @brief Converts dBV-scale to linear amplitude with 0dBV = 1.0
|
||||
//! @param dbv The dBV value to convert. ** Must be a real number - not inf/nan! **
|
||||
//! @brief Converts dBFS-scale to linear amplitude with 0dBFS = 1.0
|
||||
//! @param dbfs The dBFS value to convert. ** Must be a real number - not inf/nan! **
|
||||
//! @return Linear amplitude
|
||||
static inline float dbvToAmp( float dbv )
|
||||
static inline float dbfsToAmp( float dbfs )
|
||||
{
|
||||
return exp10f( dbv * 0.05f );
|
||||
return exp10f( dbfs * 0.05f );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user