From: Robin Gareus Date: Fri, 12 Feb 2016 22:01:10 +0000 (+0100) Subject: Partial exposure of export-audition playhead X-Git-Tag: 4.7~62 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=07cdae3318395b78ebcc9980aed745448a692467;p=ardour.git Partial exposure of export-audition playhead --- diff --git a/gtk2_ardour/export_report.h b/gtk2_ardour/export_report.h index 06c6076dff..ba83343eda 100644 --- a/gtk2_ardour/export_report.h +++ b/gtk2_ardour/export_report.h @@ -63,10 +63,16 @@ public: } void set_playhead (float pos) { - // TODO re-expose minimal area only, old playhead pos, new playead pos - if (_playhead == pos) { return; } + if (rint (_playhead * _aw) == rint (pos * _aw)) { + return; + } + if (_playhead == -1 || pos == -1) { + set_dirty (); + } else { + invalidate (_playhead); + invalidate (pos); + } _playhead = pos; - set_dirty (); } void set_audition_axis (float x0, float w) { @@ -78,6 +84,17 @@ private: Cairo::RefPtr _surface; float _playhead; float _x0, _aw; + + void invalidate (float pos) { + if (pos < 0 || pos > 1) { return; } + const float x = pos * _aw; + cairo_rectangle_t r; + r.y = 0; + r.x = _x0 + x - 1; + r.width = 3; + r.height = _surface->get_height(); + set_dirty (&r); + } }; class ExportReport : public ArdourDialog