Browse Source

Mixer: Try harder to avoid drawing meters more than necessary.

tags/non-daw-v1.1.0
Jonathan Moore Liles 13 years ago
parent
commit
5fbdd940be
3 changed files with 21 additions and 5 deletions
  1. +17
    -1
      mixer/src/DPM.H
  2. +2
    -2
      mixer/src/Meter.H
  3. +2
    -2
      mixer/src/Mixer.C

+ 17
- 1
mixer/src/DPM.H View File

@@ -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; }



+ 2
- 2
mixer/src/Meter.H View File

@@ -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(); }


+ 2
- 2
mixer/src/Mixer.C View File

@@ -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" );


Loading…
Cancel
Save