summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-07-13 21:05:45 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-07-13 21:05:45 +0000
commit0532e2063b73ec32d4dd108b58e90a0f20ae91b3 (patch)
treef9728e4b57f260fd5d468a9c3dd2b2dd2d97e7d7 /gtk2_ardour
parentb04cd7d7045dd40a1e3ae819ad3a2f9bb08a01f1 (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')
-rw-r--r--gtk2_ardour/ardour_ui.cc2
-rw-r--r--gtk2_ardour/ardour_ui_dialogs.cc3
-rw-r--r--gtk2_ardour/automation_line.cc42
-rw-r--r--gtk2_ardour/automation_line.h13
-rw-r--r--gtk2_ardour/automation_time_axis.cc5
5 files changed, 49 insertions, 16 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index c5d2bf5c11..9c637761b0 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -62,6 +62,7 @@
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
#include "ardour/audiofilesource.h"
+#include "ardour/automation_watch.h"
#include "ardour/diskstream.h"
#include "ardour/filename_extensions.h"
#include "ardour/port.h"
@@ -878,6 +879,7 @@ ARDOUR_UI::ask_about_saving_session (const vector<string>& actions)
return -1;
}
+
gint
ARDOUR_UI::every_second ()
{
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc
index 7fc50df673..0116f4e842 100644
--- a/gtk2_ardour/ardour_ui_dialogs.cc
+++ b/gtk2_ardour/ardour_ui_dialogs.cc
@@ -25,6 +25,7 @@
#include "ardour/session.h"
#include "ardour/audioengine.h"
+#include "ardour/automation_watch.h"
#include "actions.h"
#include "add_route_dialog.h"
@@ -77,6 +78,8 @@ ARDOUR_UI::set_session (Session *s)
}
}
+ AutomationWatch::instance().set_session (s);
+
if (location_ui->get()) {
location_ui->get()->set_session(s);
}
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 */
diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h
index 6be7ccd6b8..73734bcd40 100644
--- a/gtk2_ardour/automation_line.h
+++ b/gtk2_ardour/automation_line.h
@@ -166,12 +166,13 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible
bool _our_time_converter;
VisibleAspects _visible;
-
- bool _uses_gain_mapping : 1;
- bool terminal_points_can_slide : 1;
- bool update_pending : 1;
- bool no_draw : 1;
- bool _is_boolean : 1;
+
+ bool _uses_gain_mapping;
+ bool terminal_points_can_slide;
+ bool update_pending;
+ bool have_timeout;
+ bool no_draw;
+ bool _is_boolean;
/** true if we did a push at any point during the current drag */
bool did_push;
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 7c9f38aa0f..da6b66994c 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -621,6 +621,11 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, framepos_t pos, float t
AutomationSelection::iterator p;
boost::shared_ptr<AutomationList> alist(line.the_list());
+ if (_session->transport_rolling() && alist->automation_write()) {
+ /* do not paste if this control is in write mode and we're rolling */
+ return false;
+ }
+
for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth) {}
if (p == selection.lines.end()) {