diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-13 21:05:45 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-13 21:05:45 +0000 |
commit | 0532e2063b73ec32d4dd108b58e90a0f20ae91b3 (patch) | |
tree | f9728e4b57f260fd5d468a9c3dd2b2dd2d97e7d7 /gtk2_ardour/automation_line.cc | |
parent | b04cd7d7045dd40a1e3ae819ad3a2f9bb08a01f1 (diff) |
dramatic overhaul of automation. too long to explain here. this work is not finished - write/touch passes do not correctly overwrite existing data because the semantics of ControlList::insert_iterator need clarification. more to follow
git-svn-id: svn://localhost/ardour2/branches/3.0@13038 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 4a21e7905a..6586aed966 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -28,6 +28,8 @@ #include "ardour/automation_list.h" #include "ardour/dB.h" +#include "ardour/debug.h" + #include "evoral/Curve.hpp" #include "simplerect.h" @@ -79,6 +81,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv _visible = Line; update_pending = false; + have_timeout = false; _uses_gain_mapping = false; no_draw = false; _is_boolean = false; @@ -124,15 +127,6 @@ AutomationLine::event_handler (GdkEvent* event) } void -AutomationLine::queue_reset () -{ - if (!update_pending) { - update_pending = true; - Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&AutomationLine::reset, this)); - } -} - -void AutomationLine::show () { if (_visible & Line) { @@ -829,7 +823,12 @@ void AutomationLine::set_colors () void AutomationLine::list_changed () { - queue_reset (); + DEBUG_TRACE (DEBUG::Automation, string_compose ("\tline changed, existing update pending? %1\n", update_pending)); + + if (!update_pending) { + update_pending = true; + Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&AutomationLine::queue_reset, this)); + } } void @@ -936,7 +935,9 @@ AutomationLine::reset_callback (const Evoral::ControlList& events) void AutomationLine::reset () { + DEBUG_TRACE (DEBUG::Automation, "\t\tLINE RESET\n"); update_pending = false; + have_timeout = false; if (no_draw) { return; @@ -946,6 +947,27 @@ AutomationLine::reset () } void +AutomationLine::queue_reset () +{ + /* this must be called from the GUI thread + */ + + if (trackview.editor().session()->transport_rolling() && alist->automation_write()) { + /* automation write pass ... defer to a timeout */ + /* redraw in 1/4 second */ + if (!have_timeout) { + DEBUG_TRACE (DEBUG::Automation, "\tqueue timeout\n"); + Glib::signal_timeout().connect (sigc::bind_return (sigc::mem_fun (*this, &AutomationLine::reset), false), 250); + have_timeout = true; + } else { + DEBUG_TRACE (DEBUG::Automation, "\ttimeout already queued, change ignored\n"); + } + } else { + reset (); + } +} + +void AutomationLine::clear () { /* parent must create and commit command */ |