mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-06 01:21:38 -05:00
-Updated Avtk::RadialStatus, updated LooperClip logic to send 0 on stop
This commit is contained in:
parent
75b48edae2
commit
29c5d3b83a
3 changed files with 28 additions and 13 deletions
|
@ -41,6 +41,8 @@ class RadialStatus : public Fl_Slider
|
||||||
|
|
||||||
label = _label;
|
label = _label;
|
||||||
|
|
||||||
|
previousAngle = -1;
|
||||||
|
|
||||||
_r = 1.0;
|
_r = 1.0;
|
||||||
_g = 0.48;
|
_g = 0.48;
|
||||||
_b = 0.0;
|
_b = 0.0;
|
||||||
|
@ -53,11 +55,16 @@ class RadialStatus : public Fl_Slider
|
||||||
mouseOver = false;
|
mouseOver = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _recording;
|
||||||
|
void recording(bool r){_recording = r; redraw();}
|
||||||
|
|
||||||
bool mouseOver;
|
bool mouseOver;
|
||||||
bool highlight;
|
bool highlight;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
const char* label;
|
const char* label;
|
||||||
|
|
||||||
|
int previousAngle;
|
||||||
|
|
||||||
float _r, _g, _b; // foreground colour
|
float _r, _g, _b; // foreground colour
|
||||||
float _bgr, _bgg, _bgb; // background colour
|
float _bgr, _bgg, _bgb; // background colour
|
||||||
float _outr, _outg, _outb; // outline colour
|
float _outr, _outg, _outb; // outline colour
|
||||||
|
@ -78,7 +85,11 @@ class RadialStatus : public Fl_Slider
|
||||||
|
|
||||||
void draw()
|
void draw()
|
||||||
{
|
{
|
||||||
if (damage() & FL_DAMAGE_ALL)
|
// check that its a new "segment" to redraw
|
||||||
|
int newAngle = (value() * 16);
|
||||||
|
|
||||||
|
if (damage() & FL_DAMAGE_ALL &&
|
||||||
|
previousAngle != newAngle )
|
||||||
{
|
{
|
||||||
cairo_t *cr = Fl::cairo_cc();
|
cairo_t *cr = Fl::cairo_cc();
|
||||||
|
|
||||||
|
@ -87,7 +98,7 @@ class RadialStatus : public Fl_Slider
|
||||||
int xc = (w) / 2.f;
|
int xc = (w) / 2.f;
|
||||||
int yc = (h) / 2.f;
|
int yc = (h) / 2.f;
|
||||||
|
|
||||||
float angle = value();
|
float angle = newAngle / 16.f;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// draw background quadrants
|
// draw background quadrants
|
||||||
|
@ -99,18 +110,21 @@ class RadialStatus : public Fl_Slider
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( angle > 0.001 )
|
cairo_set_line_cap ( cr, CAIRO_LINE_CAP_ROUND );
|
||||||
{
|
//cairo_move_to( cr, x + xc, y + yc );
|
||||||
cairo_set_line_cap ( cr, CAIRO_LINE_CAP_ROUND );
|
cairo_arc( cr, x + xc, y + yc, xc - 10, -(3.1415/2), angle * 6.28 - (3.1415/2) );
|
||||||
//cairo_move_to( cr, x + xc, y + yc );
|
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.8 );
|
||||||
cairo_arc( cr, x + xc, y + yc, xc - 10, -(3.1415/2), angle * 6.28 - (3.1415/2) );
|
cairo_set_line_width(cr, 13.2);
|
||||||
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.8 );
|
cairo_stroke_preserve(cr);
|
||||||
cairo_set_line_width(cr, 13.2);
|
|
||||||
cairo_stroke_preserve(cr);
|
cairo_set_source_rgba (cr, 1.0, 0.48, 0.0, 1 );
|
||||||
|
cairo_set_line_width(cr, 8.2);
|
||||||
|
cairo_stroke(cr);
|
||||||
|
|
||||||
|
// recording?
|
||||||
|
if ( _recording )
|
||||||
|
{
|
||||||
|
|
||||||
cairo_set_source_rgba (cr, 1.0, 0.48, 0.0, 1 );
|
|
||||||
cairo_set_line_width(cr, 8.2);
|
|
||||||
cairo_stroke(cr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// inside circle
|
// inside circle
|
||||||
|
|
|
@ -149,6 +149,8 @@ void LooperClip::bar()
|
||||||
_recording = false;
|
_recording = false;
|
||||||
_queueStop = false;
|
_queueStop = false;
|
||||||
change = true;
|
change = true;
|
||||||
|
// set "progress" to zero, as we're stopped!
|
||||||
|
jack->getControllerUpdater()->setTrackSceneProgress(track, scene, 0 );
|
||||||
}
|
}
|
||||||
else if ( _queueRecord )
|
else if ( _queueRecord )
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,6 @@ void TrackOutput::process(unsigned int nframes, Buffers* buffers)
|
||||||
// call process() up the chain
|
// call process() up the chain
|
||||||
previousInChain->process( nframes, buffers );
|
previousInChain->process( nframes, buffers );
|
||||||
|
|
||||||
|
|
||||||
// run the meter
|
// run the meter
|
||||||
dbMeter.process( nframes, trackBuffer, trackBuffer );
|
dbMeter.process( nframes, trackBuffer, trackBuffer );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue