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:
Umcaruje
2016-11-07 04:44:18 +01:00
committed by Tres Finocchiaro
parent 3d43937bf3
commit c9618961d6
23 changed files with 93 additions and 86 deletions

View File

@@ -136,6 +136,16 @@ void ConfigManager::upgrade_1_1_90()
}
}
void ConfigManager::upgrade_1_1_91()
{
// rename displaydbv to displaydbfs
if ( !value( "app", "displaydbv" ).isNull() ) {
setValue( "app", "displaydbfs", value( "app", "displaydbv" ) );
deleteValue( "app", "displaydbv" );
}
}
void ConfigManager::upgrade()
{
@@ -152,6 +162,11 @@ void ConfigManager::upgrade()
upgrade_1_1_90();
}
if ( createdWith.setCompareType(ProjectVersion::Build) < "1.1.91" )
{
upgrade_1_1_91();
}
// Don't use old themes as they break the UI (i.e. 0.4 != 1.0, etc)
if ( createdWith.setCompareType(ProjectVersion::Minor) != LMMS_VERSION )
{
@@ -546,5 +561,3 @@ void ConfigManager::saveConfigFile()
outfile.write( xml.toUtf8() );
outfile.close();
}

View File

@@ -282,9 +282,8 @@ FxMixerView::FxChannelView::FxChannelView(QWidget * _parent, FxMixerView * _mv,
m_fader = new Fader( &fxChannel->m_volumeModel,
tr( "FX Fader %1" ).arg( channelIndex ), m_fxLine );
m_fader->setLevelsDisplayedInDBFS();
// TODO dbvToAmp is really dBFSToAmp. Rename in later commit.
m_fader->setMinPeak(dbvToAmp(-42));
m_fader->setMaxPeak(dbvToAmp(9));
m_fader->setMinPeak(dbfsToAmp(-42));
m_fader->setMaxPeak(dbfsToAmp(9));
m_fader->move( 16-m_fader->width()/2,
m_fxLine->height()-

View File

@@ -1200,10 +1200,10 @@ void MainWindow::updateViewMenu()
// that is safe to change on the fly. There is probably some
// more elegant way to do this.
QAction *qa;
qa = new QAction(tr( "Volume as dBV" ), this);
qa->setData("displaydbv");
qa = new QAction(tr( "Volume as dBFS" ), this);
qa->setData("displaydbfs");
qa->setCheckable( true );
qa->setChecked( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() );
qa->setChecked( ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() );
m_viewMenu->addAction(qa);
// Maybe this is impossible?
@@ -1244,9 +1244,9 @@ void MainWindow::updateConfig( QAction * _who )
QString tag = _who->data().toString();
bool checked = _who->isChecked();
if( tag == "displaydbv" )
if( tag == "displaydbfs" )
{
ConfigManager::inst()->setValue( "app", "displaydbv",
ConfigManager::inst()->setValue( "app", "displaydbfs",
QString::number(checked) );
}
else if ( tag == "tooltips" )

View File

@@ -98,8 +98,8 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
"disabled" ).toInt() ),
m_warnAfterSetup( !ConfigManager::inst()->value( "app",
"nomsgaftersetup" ).toInt() ),
m_displaydBV( ConfigManager::inst()->value( "app",
"displaydbv" ).toInt() ),
m_displaydBFS( ConfigManager::inst()->value( "app",
"displaydbfs" ).toInt() ),
m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ),
m_disableBackup( !ConfigManager::inst()->value( "app",
"disablebackup" ).toInt() ),
@@ -236,13 +236,13 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
this, SLOT( toggleWarnAfterSetup( bool ) ) );
LedCheckBox * dbv = new LedCheckBox( tr( "Display volume as dBV " ),
LedCheckBox * dbfs = new LedCheckBox( tr( "Display volume as dBFS " ),
misc_tw );
labelNumber++;
dbv->move( XDelta, YDelta*labelNumber );
dbv->setChecked( m_displaydBV );
connect( dbv, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisplaydBV( bool ) ) );
dbfs->move( XDelta, YDelta*labelNumber );
dbfs->setChecked( m_displaydBFS );
connect( dbfs, SIGNAL( toggled( bool ) ),
this, SLOT( toggleDisplaydBFS( bool ) ) );
LedCheckBox * mmpz = new LedCheckBox(
@@ -999,8 +999,8 @@ void SetupDialog::accept()
QString::number( !m_toolTips ) );
ConfigManager::inst()->setValue( "app", "nomsgaftersetup",
QString::number( !m_warnAfterSetup ) );
ConfigManager::inst()->setValue( "app", "displaydbv",
QString::number( m_displaydBV ) );
ConfigManager::inst()->setValue( "app", "displaydbfs",
QString::number( m_displaydBFS ) );
ConfigManager::inst()->setValue( "app", "nommpz",
QString::number( !m_MMPZ ) );
ConfigManager::inst()->setValue( "app", "disablebackup",
@@ -1147,9 +1147,9 @@ void SetupDialog::toggleWarnAfterSetup( bool _enabled )
void SetupDialog::toggleDisplaydBV( bool _enabled )
void SetupDialog::toggleDisplaydBFS( bool _enabled )
{
m_displaydBV = _enabled;
m_displaydBFS = _enabled;
}

View File

@@ -477,7 +477,7 @@ void PianoRoll::showTextFloat(const QString &text, const QPoint &pos, int timeou
void PianoRoll::showVolTextFloat(volume_t vol, const QPoint &pos, int timeout)
{
//! \todo display velocity for MIDI-based instruments
// possibly dBV values too? not sure if it makes sense for note volumes...
// possibly dBFS values too? not sure if it makes sense for note volumes...
showTextFloat( tr("Velocity: %1%").arg( vol ), pos, timeout );
}

View File

@@ -321,9 +321,9 @@ void Fader::setPeak_R( float fPeak )
// update tooltip showing value and adjust position while changing fader value
void Fader::updateTextFloat()
{
if( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() && m_displayConversion )
if( ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() && m_displayConversion )
{
s_textFloat->setText( QString("Volume: %1 dBV").
s_textFloat->setText( QString("Volume: %1 dBFS").
arg( 20.0 * log10( model()->value() ), 3, 'f', 2 ) );
}
else
@@ -369,8 +369,8 @@ void Fader::paintDBFSLevels(QPaintEvent * ev, QPainter & painter)
int width = m_back->width() / 2;
int center = m_back->width() - width;
float const maxDB(ampToDbv(m_fMaxPeak));
float const minDB(ampToDbv(m_fMinPeak));
float const maxDB(ampToDbfs(m_fMaxPeak));
float const minDB(ampToDbfs(m_fMinPeak));
// We will need to divide by the span between min and max several times. It's more
// efficient to calculate the reciprocal once and then to multiply.
@@ -378,12 +378,12 @@ void Fader::paintDBFSLevels(QPaintEvent * ev, QPainter & painter)
// Draw left levels
float const leftSpan = ampToDbv(m_fPeakValue_L) - minDB;
float const leftSpan = ampToDbfs(m_fPeakValue_L) - minDB;
int peak_L = height * leftSpan * fullSpanReciprocal;
QRect drawRectL( 0, height - peak_L, width, peak_L ); // Source and target are identical
painter.drawPixmap( drawRectL, *m_leds, drawRectL );
float const persistentLeftPeakDBFS = ampToDbv(m_persistentPeak_L);
float const persistentLeftPeakDBFS = ampToDbfs(m_persistentPeak_L);
int persistentPeak_L = height * (1 - (persistentLeftPeakDBFS - minDB) * fullSpanReciprocal);
// the LED's have a 4px padding and we don't want the peaks
// to draw on the fader background
@@ -400,12 +400,12 @@ void Fader::paintDBFSLevels(QPaintEvent * ev, QPainter & painter)
// Draw right levels
float const rightSpan = ampToDbv(m_fPeakValue_R) - minDB;
float const rightSpan = ampToDbfs(m_fPeakValue_R) - minDB;
int peak_R = height * rightSpan * fullSpanReciprocal;
QRect const drawRectR( center, height - peak_R, width, peak_R ); // Source and target are identical
painter.drawPixmap( drawRectR, *m_leds, drawRectR );
float const persistentRightPeakDBFS = ampToDbv(m_persistentPeak_R);
float const persistentRightPeakDBFS = ampToDbfs(m_persistentPeak_R);
int persistentPeak_R = height * (1 - (persistentRightPeakDBFS - minDB) * fullSpanReciprocal);
// the LED's have a 4px padding and we don't want the peaks
// to draw on the fader background

View File

@@ -770,12 +770,12 @@ void Knob::enterValue()
bool ok;
float new_val;
if( isVolumeKnob() &&
ConfigManager::inst()->value( "app", "displaydbv" ).toInt() )
ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() )
{
new_val = QInputDialog::getDouble(
this, windowTitle(),
tr( "Please enter a new value between "
"-96.0 dBV and 6.0 dBV:" ),
"-96.0 dBFS and 6.0 dBFS:" ),
20.0 * log10( model()->value() / 100.0 ),
-96.0, 6.0, 4, &ok );
if( new_val <= -96.0 )
@@ -784,7 +784,7 @@ void Knob::enterValue()
}
else
{
new_val = dbvToAmp( new_val ) * 100.0;
new_val = dbfsToAmp( new_val ) * 100.0;
}
}
else
@@ -825,9 +825,9 @@ void Knob::friendlyUpdate()
QString Knob::displayValue() const
{
if( isVolumeKnob() &&
ConfigManager::inst()->value( "app", "displaydbv" ).toInt() )
ConfigManager::inst()->value( "app", "displaydbfs" ).toInt() )
{
return m_description.trimmed() + QString( " %1 dBV" ).
return m_description.trimmed() + QString( " %1 dBFS" ).
arg( 20.0 * log10( model()->value() / volumeRatio() ),
3, 'f', 2 );
}
@@ -858,9 +858,3 @@ void Knob::displayHelp()
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
whatsThis() );
}