summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-11-16 18:42:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-11-16 18:42:48 +0000
commit2bf3ed423f7aecdaabf5fbb078d9e2f20d26880c (patch)
tree722c7b81b46f966c6cba9caacc12bbf21663ca7f /gtk2_ardour/editor_canvas.cc
parent7bbf76132164d3bd293c3bfdf2038dd47f1cc63b (diff)
track naming patch from brian; slightly modified F11-bug workaround from brian; undo/redo items in edit menu now show operation to be undone/redone; canvas allocations now handled by an idle handler; region views respond to changes in fade/in/out curves ; undo/redo possible for some fade in/out operations; automation tracks extend to max_frames
git-svn-id: svn://localhost/ardour2/trunk@1134 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc41
1 files changed, 29 insertions, 12 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 6f57a51010..8f6203c40d 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -275,9 +275,32 @@ Editor::initialize_canvas ()
void
Editor::track_canvas_allocate (Gtk::Allocation alloc)
{
+ canvas_allocation = alloc;
- canvas_width = alloc.get_width();
- canvas_height = alloc.get_height();
+ if (!initial_ruler_update_required) {
+ if (!canvas_idle_queued) {
+ /* call this first so that we do stuff before any pending redraw */
+ Glib::signal_idle().connect (mem_fun (*this, &Editor::track_canvas_idle), false);
+ canvas_idle_queued = true;
+ }
+ return;
+ }
+
+ initial_ruler_update_required = false;
+
+ track_canvas_idle ();
+}
+
+bool
+Editor::track_canvas_idle ()
+{
+
+ if (canvas_idle_queued) {
+ canvas_idle_queued = false;
+ }
+
+ canvas_width = canvas_allocation.get_width();
+ canvas_height = canvas_allocation.get_height();
zoom_range_clock.set ((nframes_t) floor ((canvas_width * frames_per_unit)));
edit_cursor->set_position (edit_cursor->current_frame);
@@ -319,18 +342,12 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
transport_punchout_line->property_y2() = canvas_height;
}
- if (is_visible() && initial_ruler_update_required) {
- /*
- this is really dumb, but signal_size_allocate() gets emitted intermittently
- depending on whether the canvas contents are visible or not.
- we only want to do this once
- */
- update_fixed_rulers();
- tempo_map_changed (Change (0));
- initial_ruler_update_required = false;
- }
+ update_fixed_rulers();
+ tempo_map_changed (Change (0));
Resized (); /* EMIT_SIGNAL */
+
+ return false;
}
void