mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
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.
This commit is contained in:
parent
22582c8f20
commit
bc440df955
2 changed files with 14 additions and 3 deletions
|
@ -54,6 +54,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool highlight;
|
bool highlight;
|
||||||
|
bool pan_style;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
char* _label;
|
char* _label;
|
||||||
|
|
||||||
|
@ -112,10 +113,19 @@ public:
|
||||||
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1 );
|
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1 );
|
||||||
cairo_stroke(cr);
|
cairo_stroke(cr);
|
||||||
|
|
||||||
float angle = 2.46 + ( 4.54 * value() );
|
if(!pan_style) {
|
||||||
cairo_set_line_width(cr, lineWidth);
|
float angle = 2.46 + ( 4.54 * value() );
|
||||||
cairo_arc(cr, x+w/2,y+h/2, radius, 2.46, angle );
|
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_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_set_source_rgba(cr, 1.0, 0.48, 0, 0.8);
|
||||||
cairo_stroke(cr);
|
cairo_stroke(cr);
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ GTrack::GTrack(int x, int y, int w, int h, const char* l ) :
|
||||||
volume.callback( gtrack_vol_cb, this );
|
volume.callback( gtrack_vol_cb, this );
|
||||||
panDial.callback( gtrack_pan_cb, this );
|
panDial.callback( gtrack_pan_cb, this );
|
||||||
panDial.value( 0.5f );
|
panDial.value( 0.5f );
|
||||||
|
panDial.pan_style = 1;
|
||||||
|
|
||||||
jackSendActivate.setColor( 1, 1, 0 );
|
jackSendActivate.setColor( 1, 1, 0 );
|
||||||
jackSendActivate.callback(gtrack_jacksendactivate_cb,this);
|
jackSendActivate.callback(gtrack_jacksendactivate_cb,this);
|
||||||
|
|
Loading…
Add table
Reference in a new issue