diff --git a/mixer/src/DPM.H b/mixer/src/DPM.H index 70d9e63..c061140 100644 --- a/mixer/src/DPM.H +++ b/mixer/src/DPM.H @@ -31,6 +31,8 @@ class DPM : public Meter int _pixels_per_segment; int _last_drawn_hi_segment; + float _value; + int pos ( float v ) { return deflection( v ) * _segments; @@ -63,7 +65,21 @@ public: DPM ( int X, int Y, int W, int H, const char *L = 0 ); -// void value ( float v ) { if ( pos( v ) != pos( value() ) ) redraw(); Meter::value( v ) } + void value ( float v ) + { + if ( _value != v ) + { + if ( pos( v ) != pos( _value ) ) + Meter::value( v ); + } + + _value = v; + } + + float value ( void ) const + { + return _value; + } void pixels_per_segment ( int v ) { _pixels_per_segment = v; } diff --git a/mixer/src/Meter.H b/mixer/src/Meter.H index 93f3723..c94ca34 100644 --- a/mixer/src/Meter.H +++ b/mixer/src/Meter.H @@ -81,7 +81,7 @@ public: virtual ~Meter ( ) { } - void value ( float v ) + virtual void value ( float v ) { damage( FL_DAMAGE_USER1 ); @@ -91,7 +91,7 @@ public: _peak = _value; } - float value ( void ) const { return _value; } + virtual float value ( void ) const { return _value; } float peak ( void ) const { return _peak; } void reset ( void ) { _peak = -80.0f; redraw(); } diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index 4a3252d..4ffe2f5 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -371,9 +371,9 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) : o->add( "_&Options/&Display/&Colors/&Light", 0, 0, 0, FL_MENU_RADIO ); o->add( "_&Options/&Display/&Colors/&Gray", 0, 0, 0, FL_MENU_RADIO ); o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO ); - o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE ); + o->add( "_&Options/&Display/&Knobs/&Arc", 0, 0, 0, FL_MENU_RADIO ); o->add( "_&Options/&Display/&Knobs/&Burnished", 0, 0, 0, FL_MENU_RADIO ); - o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO ); + o->add( "_&Options/&Display/&Knobs/&Plastic", 0, 0, 0, FL_MENU_RADIO | FL_MENU_VALUE ); o->add( "_&Options/&Display/&Colors/&System", 0, 0, 0, FL_MENU_RADIO ); o->add( "&Help/&Manual" ); o->add( "&Help/&About" );