Use ampToDbfs instead of 20*log10 x.
The function's there (in lmms_math.h) for a reason :)
This commit is contained in:
committed by
Colin Wallace
parent
b706ee208d
commit
bf1b61023c
@@ -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
|
||||
{
|
||||
|
||||
@@ -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" ).
|
||||
|
||||
Reference in New Issue
Block a user