Mixer: Limit rate of DSP meter updates.

This commit is contained in:
Jonathan Moore Liles 2013-08-14 17:11:35 -07:00
parent 19487a72e4
commit 1cb9f68cf1
2 changed files with 23 additions and 1 deletions

View File

@ -464,7 +464,25 @@ Mixer_Strip::update ( void )
_chain->update();
}
if ( group() )
dsp_load_progress->value( group()->dsp_load() );
{
if ( ( _dsp_load_index++ % 10 ) == 0 )
{
float l = group()->dsp_load();
dsp_load_progress->value( l );
{
char pat[20];
snprintf( pat, sizeof(pat), "%.1f%%", l * 100.0f );
dsp_load_progress->copy_tooltip( pat );
}
if ( l <= 0.15f )
dsp_load_progress->color2( fl_rgb_color( 127,127,127 ) );
else
dsp_load_progress->color2( FL_RED );
}
}
}
void
@ -476,6 +494,8 @@ Mixer_Strip::init ( )
_chain = 0;
_group = 0;
_dsp_load_index = 0;
box( FL_FLAT_BOX );
labeltype( FL_NO_LABEL );

View File

@ -85,6 +85,8 @@ public:
private:
unsigned int _dsp_load_index;
/* used to defer setting the mode of the gain controller until the
chain has been added and the controller connected to a default
module */