Use ampToDbfs instead of 20*log10 x.

The function's there (in lmms_math.h) for a reason :)
This commit is contained in:
Colin Wallace
2018-03-13 22:00:58 -07:00
committed by Colin Wallace
parent b706ee208d
commit bf1b61023c
2 changed files with 3 additions and 3 deletions

View File

@@ -339,7 +339,7 @@ void Fader::updateTextFloat()
if( ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() && m_displayConversion )
{
s_textFloat->setText( QString("Volume: %1 dBFS").
arg( 20.0 * log10( model()->value() ), 3, 'f', 2 ) );
arg( ampToDbfs( model()->value() ), 3, 'f', 2 ) );
}
else
{

View File

@@ -774,7 +774,7 @@ void Knob::enterValue()
this, tr( "Set value" ),
tr( "Please enter a new value between "
"-96.0 dBFS and 6.0 dBFS:" ),
20.0 * log10( model()->getRoundedValue() / 100.0 ),
ampToDbfs( model()->getRoundedValue() / 100.0 ),
-96.0, 6.0, model()->getDigitCount(), &ok );
if( new_val <= -96.0 )
{
@@ -826,7 +826,7 @@ QString Knob::displayValue() const
ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() )
{
return m_description.trimmed() + QString( " %1 dBFS" ).
arg( 20.0 * log10( model()->getRoundedValue() / volumeRatio() ),
arg( ampToDbfs( model()->getRoundedValue() / volumeRatio() ),
3, 'f', 2 );
}
return m_description.trimmed() + QString( " %1" ).