summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-23 22:23:39 +0000
committerDavid Robillard <d@drobilla.net>2008-09-23 22:23:39 +0000
commit95d82d7a16b241632bd3d35a5c11c27e7e257984 (patch)
tree4b248d519f369d73817ed6a1470ece4cbbfd6ce3 /gtk2_ardour/editor_tempodisplay.cc
parent81c571f2f01e7d5ab86220c1334403daeffff165 (diff)
An actual tempo line cache (not quite perfect when scrolling left, but miles ahead of the previous one didn't really help at all).
Tempo line updating done immediately/directly rather than in an idle handler. Looking for feedback how this works for other people, performance wise... Feel-wise, the obvious lag between scrolling and tempo lines being drawn is now gone. git-svn-id: svn://localhost/ardour2/branches/3.0@3799 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc24
1 files changed, 5 insertions, 19 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 0ddbce2e97..cd07581c24 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -102,12 +102,13 @@ Editor::tempo_map_changed (Change ignored)
ENSURE_GUI_THREAD(bind (mem_fun (*this, &Editor::tempo_map_changed), ignored));
+ if (tempo_lines)
+ tempo_lines->tempo_map_changed();
+
compute_current_bbt_points(leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit));
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
update_tempo_based_rulers ();
- if (tempo_map_change_idle_handler_id < 0) {
- tempo_map_change_idle_handler_id = Glib::signal_idle().connect (mem_fun (*this, &Editor::redraw_measures));
- }
+ redraw_measures ();
}
void
@@ -119,20 +120,7 @@ Editor::redisplay_tempo (bool immediate_redraw)
compute_current_bbt_points (leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit)); // redraw rulers and measures
- if (immediate_redraw) {
-
- hide_measures ();
-
- if (current_bbt_points) {
- draw_measures ();
- }
-
- } else if (tempo_map_change_idle_handler_id < 0) {
-
- tempo_map_change_idle_handler_id = Glib::signal_idle().connect (mem_fun (*this, &Editor::redraw_measures));
-
- }
-
+ redraw_measures();
update_tempo_based_rulers ();
}
@@ -182,9 +170,7 @@ Editor::hide_measures ()
bool
Editor::redraw_measures ()
{
- hide_measures ();
draw_measures ();
- tempo_map_change_idle_handler_id = -1;
return false;
}