summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_report.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-12 23:01:10 +0100
committerRobin Gareus <robin@gareus.org>2016-02-12 23:01:10 +0100
commit07cdae3318395b78ebcc9980aed745448a692467 (patch)
treeb12aa91127a7afa7651dffe914df51c0b15e9640 /gtk2_ardour/export_report.h
parentd308fceb21ceeda602f97adfb5bb44aa3da21290 (diff)
Partial exposure of export-audition playhead
Diffstat (limited to 'gtk2_ardour/export_report.h')
-rw-r--r--gtk2_ardour/export_report.h23
1 files changed, 20 insertions, 3 deletions
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<Cairo::ImageSurface> _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