Browse Source

Mixer: Limit rate of DSP meter updates.

tags/non-daw-v1.2.0
Jonathan Moore Liles 11 years ago
parent
commit
1cb9f68cf1
2 changed files with 23 additions and 1 deletions
  1. +21
    -1
      mixer/src/Mixer_Strip.C
  2. +2
    -0
      mixer/src/Mixer_Strip.H

+ 21
- 1
mixer/src/Mixer_Strip.C 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 );



+ 2
- 0
mixer/src/Mixer_Strip.H 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 */


Loading…
Cancel
Save