EQ changed gain faders to use dB

This commit is contained in:
Dave French
2014-12-31 00:14:44 +00:00
parent 22a603c9fd
commit f67eaaced7
3 changed files with 11 additions and 4 deletions

View File

@@ -32,8 +32,8 @@
EqControls::EqControls( EqEffect *effect ) :
EffectControls( effect ),
m_effect( effect ),
m_inGainModel( 1.0, 0.0, 2.0, 0.001, this, tr( "Input gain") ),
m_outGainModel( 1.0, 0.0, 2.0, 0.001, this, tr( "Output gain" ) ),
m_inGainModel( 0.0, -60.0, 6.0, 0.01, this, tr( "Input gain") ),
m_outGainModel( -.0, -60.0, 6.0, 0.1, this, tr( "Output gain" ) ),
m_lowShelfGainModel( 0.0 , -40, 40, 0.001, this, tr( "Low shelf gain" ) ),
m_para1GainModel( 0.0 , -40, 40, 0.001, this, tr( "Peak 1 gain" ) ),
m_para2GainModel( 0.0 , -40, 40, 0.001, this, tr( "Peak 2 gain" ) ),
@@ -95,6 +95,8 @@ EqControls::EqControls( EqEffect *effect ) :
m_inProgress = false;
m_analyseIn = true;
m_analyseOut = true;
m_inGainModel.setScaleLogarithmic( true );
}

View File

@@ -70,10 +70,15 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
m_inGainFader = new EqFader( &controls->m_inGainModel, tr( "In Gain" ), this, &controls->m_inPeakL, &controls->m_inPeakR);
m_inGainFader->move( 10, 5 );
m_inGainFader->setDisplayConversion( false );
m_inGainFader->setHintText( tr( "Gain" ), "dBv");
m_outGainFader = new EqFader( &controls->m_outGainModel, tr( "Out Gain" ), this, &controls->m_outPeakL, &controls->m_outPeakR );
m_outGainFader->move( 315, 5 );
m_outGainFader->setDisplayConversion( false );
m_outGainFader->setHintText( tr( "Gain" ), "dBv");
//gain faders
int fo = (cw * 0.5) - (m_outGainFader->width() * 0.5 );

View File

@@ -78,7 +78,7 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames)
{
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}
const float outGain = m_eqControls.m_outGainModel.value();
const float outGain = dbvToAmp( m_eqControls.m_outGainModel.value() );
const int sampleRate = Engine::mixer()->processingSampleRate();
sampleFrame m_inPeak = { 0, 0 };
@@ -90,7 +90,7 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames)
{
m_eqControls.m_inFftBands.clear();
}
gain(buf , frames, m_eqControls.m_inGainModel.value(), &m_inPeak );
gain(buf , frames, dbvToAmp( m_eqControls.m_inGainModel.value() ), &m_inPeak );
m_eqControls.m_inPeakL = m_eqControls.m_inPeakL < m_inPeak[0] ? m_inPeak[0] : m_eqControls.m_inPeakL;
m_eqControls.m_inPeakR = m_eqControls.m_inPeakR < m_inPeak[1] ? m_inPeak[1] : m_eqControls.m_inPeakR;