Skip to content

Commit

Permalink
Update UI 60 times per second (#4570)
Browse files Browse the repository at this point in the history
* Update UI 60 times per second

* Adjust falloff values
  • Loading branch information
karmux authored and PhysSong committed Sep 17, 2018
1 parent 153f15f commit dd7b086
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions plugins/Eq/EqFader.h
Expand Up @@ -80,15 +80,15 @@ private slots:
{
const float opl = getPeak_L();
const float opr = getPeak_R();
const float fall_off = 1.2;
const float fallOff = 1.07;
if( *m_lPeak > opl )
{
setPeak_L( *m_lPeak );
*m_lPeak = 0;
}
else
{
setPeak_L( opl/fall_off );
setPeak_L( opl/fallOff );
}

if( *m_rPeak > opr )
Expand All @@ -98,7 +98,7 @@ private slots:
}
else
{
setPeak_R( opr/fall_off );
setPeak_R( opr/fallOff );
}
update();
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/Eq/EqSpectrumView.cpp
Expand Up @@ -224,7 +224,7 @@ void EqSpectrumView::paintEvent(QPaintEvent *event)
float peak;
m_path.moveTo( 0, height() );
m_peakSum = 0;
float fallOff = 1.2;
const float fallOff = 1.07;
for( int x = 0; x < MAX_BANDS; ++x, ++bands )
{
peak = ( fh * 2.0 / 3.0 * ( 20 * ( log10( *bands / energy ) ) - LOWER_Y ) / ( - LOWER_Y ) );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/FxMixerView.cpp
Expand Up @@ -579,15 +579,15 @@ void FxMixerView::updateFaders()
{
const float opl = m_fxChannelViews[i]->m_fader->getPeak_L();
const float opr = m_fxChannelViews[i]->m_fader->getPeak_R();
const float fall_off = 1.2;
const float fallOff = 1.07;
if( m->effectChannel(i)->m_peakLeft > opl )
{
m_fxChannelViews[i]->m_fader->setPeak_L( m->effectChannel(i)->m_peakLeft );
m->effectChannel(i)->m_peakLeft = 0;
}
else
{
m_fxChannelViews[i]->m_fader->setPeak_L( opl/fall_off );
m_fxChannelViews[i]->m_fader->setPeak_L( opl/fallOff );
}

if( m->effectChannel(i)->m_peakRight > opr )
Expand All @@ -597,7 +597,7 @@ void FxMixerView::updateFaders()
}
else
{
m_fxChannelViews[i]->m_fader->setPeak_R( opr/fall_off );
m_fxChannelViews[i]->m_fader->setPeak_R( opr/fallOff );
}
}
}
2 changes: 1 addition & 1 deletion src/gui/MainWindow.cpp
Expand Up @@ -209,7 +209,7 @@ MainWindow::MainWindow() :
vbox->addWidget( w );
setCentralWidget( main_widget );

m_updateTimer.start( 1000 / 20, this ); // 20 fps
m_updateTimer.start( 1000 / 60, this ); // 60 fps

if( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() )
{
Expand Down

0 comments on commit dd7b086

Please sign in to comment.