implement pan style dials in avtk dial, close #173

Pan style "center is no action" type dial graphic
added, and marking pan dials on each track as such.
main
Harry van Haaren 2017-04-09 14:23:46 +01:00
parent 22582c8f20
commit bc440df955
2 changed files with 14 additions and 3 deletions

View File

@ -54,6 +54,7 @@ public:
}
bool highlight;
bool pan_style;
int x, y, w, h;
char* _label;
@ -112,10 +113,19 @@ public:
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1 );
cairo_stroke(cr);
float angle = 2.46 + ( 4.54 * value() );
cairo_set_line_width(cr, lineWidth);
cairo_arc(cr, x+w/2,y+h/2, radius, 2.46, angle );
if(!pan_style) {
float angle = 2.46 + ( 4.54 * value() );
cairo_arc(cr, x+w/2,y+h/2, radius, 2.46, angle );
} else {
float angle = 2.46 + ( 4.54 * value() );
float mid = 2.46 + ( 4.54 * 0.5 );
if(angle >= mid)
cairo_arc(cr, x+w/2,y+h/2, radius, mid, angle);
else
cairo_arc_negative(cr, x+w/2,y+h/2, radius, mid, angle);
}
cairo_line_to(cr, x+w/2,y+h/2);
cairo_set_line_width(cr, lineWidth);
cairo_set_source_rgba(cr, 1.0, 0.48, 0, 0.8);
cairo_stroke(cr);

View File

@ -75,6 +75,7 @@ GTrack::GTrack(int x, int y, int w, int h, const char* l ) :
volume.callback( gtrack_vol_cb, this );
panDial.callback( gtrack_pan_cb, this );
panDial.value( 0.5f );
panDial.pan_style = 1;
jackSendActivate.setColor( 1, 1, 0 );
jackSendActivate.callback(gtrack_jacksendactivate_cb,this);