diff options
| author | Comment <tim@gray.(none)> | 2013-08-21 09:54:10 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-08-21 09:54:10 +0100 |
| commit | c53cf523b108845d074ea68d7fac592ec85e5a60 (patch) | |
| tree | f896b228c9b82e348a744e38fccbef0f8bd03e3d /rotord/src | |
| parent | 88a96ed5ba26296f9a9a19951ad453ebd0b1196e (diff) | |
working audio viz
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/nodes_drawing.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rotord/src/nodes_drawing.h b/rotord/src/nodes_drawing.h index 375ab03..ad5bc8c 100644 --- a/rotord/src/nodes_drawing.h +++ b/rotord/src/nodes_drawing.h @@ -166,11 +166,12 @@ namespace Rotor { if (attributes["mode"]->value=="fill"||attributes["mode"]->value=="both") { cairo_set_source_rgb(cr, fill.Rfloat(),fill.Gfloat(),fill.Bfloat()); cairo_save(cr); //not really even necessary? - cairo_translate(cr, 0, frame.h/2); + cairo_translate(cr, 0, 0); + //cairo_line_to(cr, 0, frame.h/2); for (int i=0;i<frame.w;i++){ cairo_line_to(cr,i,(((int16_t)frame.audio->samples[i*frame.audio->channels])*frame.h)>>16); } - cairo_line_to(cr, frame.w, frame.h/2); + cairo_line_to(cr, frame.w, 0); cairo_close_path(cr); cairo_restore (cr); //not really even necessary? cairo_fill(cr); @@ -178,10 +179,11 @@ namespace Rotor { if (attributes["mode"]->value=="line"||attributes["mode"]->value=="both") { cairo_set_source_rgb(cr, stroke.Rfloat(),stroke.Gfloat(),stroke.Bfloat()); cairo_save(cr); //not really even necessary? - cairo_translate(cr, 0, frame.h/2); + cairo_translate(cr, 0, 0); for (int i=0;i<frame.w;i++){ cairo_line_to(cr,i,(((int16_t)frame.audio->samples[i*frame.audio->channels])*frame.h)>>16); } + cairo_line_to(cr, frame.w, 0); cairo_restore (cr); //not really even necessary? cairo_stroke(cr); } |
