diff --git a/mixer/src/DPM.C b/mixer/src/DPM.C index 3d7d0a9..92a694d 100644 --- a/mixer/src/DPM.C +++ b/mixer/src/DPM.C @@ -131,6 +131,8 @@ DPM::draw ( void ) int v = pos( value() ); int pv = pos( peak() ); + int clipv = pos( 0 ); + int bh = h() / _segments; int bw = w() / _segments; @@ -172,11 +174,15 @@ DPM::draw ( void ) for ( int p = lo; p <= hi; p++ ) { - Fl_Color c = DPM::div_color( p ); + Fl_Color c; if ( p > v && p != pv ) c = dim_div_color( p ); - + else if ( p != clipv ) + c = div_color( p ); + else + c = fl_color_average( FL_YELLOW, div_color( p ), 0.40 ); + if ( ! active ) c = fl_inactive( c ); diff --git a/mixer/src/Meter_Module.C b/mixer/src/Meter_Module.C index 717415c..bb37c3e 100644 --- a/mixer/src/Meter_Module.C +++ b/mixer/src/Meter_Module.C @@ -192,11 +192,7 @@ get_peak_sample ( const sample_t* buf, nframes_t nframes ) for ( int j = nframes; j--; ++f ) { - float s = *f; - - /* rectify */ - if ( s < 0.0f ) - s = 0 - s; + const float s = fabs( *f ); if ( s > p ) p = s; @@ -212,7 +208,8 @@ Meter_Module::process ( nframes_t nframes ) { if ( audio_input[i].connected() ) { - float dB = 20 * log10( get_peak_sample( (float*)audio_input[i].buffer(), nframes ) / 2.0f ); +// float dB = 20 * log10( get_peak_sample( (float*)audio_input[i].buffer(), nframes ) / 2.0f ); + float dB = 20 * log10( get_peak_sample( (float*)audio_input[i].buffer(), nframes ) ); ((float*)control_output[0].buffer())[i] = dB; control_value[i] = dB;