From d53e5adb627291b1012de5ec8340a4e98b8d1300 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 22 Apr 2010 16:28:44 +0000 Subject: [PATCH] finally change the misnamed ::reposition_for_rt_add(); never save automation_state=Write in a session file; drop from Write to Touch at transport stop; other related minor cleanup git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/2.0-ongoing@6966 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/automation_event.h | 8 ++------ libs/ardour/automation_event.cc | 26 ++++++++++++++++++-------- libs/ardour/insert.cc | 2 +- libs/ardour/io.cc | 2 +- libs/ardour/panner.cc | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h index 0005c8de0..fc998e5cb 100644 --- a/libs/ardour/ardour/automation_event.h +++ b/libs/ardour/ardour/automation_event.h @@ -96,12 +96,12 @@ class AutomationList : public PBD::StatefulDestructible bool extend_to (double); void slide (iterator before, double distance); - void reposition_for_rt_add (double when); + void write_pass_finished (double when); void rt_add (double when, double value); void add (double when, double value); /* this should be private but old-school automation loading needs it in IO/Redirect */ void fast_simple_add (double when, double value); - void merge_nascent (); + void merge_nascent (double when); void reset_range (double start, double end); void erase_range (double start, double end); @@ -226,10 +226,6 @@ class AutomationList : public PBD::StatefulDestructible double max_yval; double default_value; bool sort_pending; - ControlEvent _touch_saved_point; - - iterator rt_insertion_point; - double rt_pos; void maybe_signal_changed (); void mark_dirty (); diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc index 1aa2f9c7e..19c8ff584 100644 --- a/libs/ardour/automation_event.cc +++ b/libs/ardour/automation_event.cc @@ -54,7 +54,6 @@ static void dumpit (const AutomationList& al, string prefix = "") #endif AutomationList::AutomationList (double defval) - : _touch_saved_point (-1.0, -1.0) { _frozen = 0; changed_when_thawed = false; @@ -75,7 +74,6 @@ AutomationList::AutomationList (double defval) } AutomationList::AutomationList (const AutomationList& other) - : _touch_saved_point (-1.0, -1.0) { _frozen = 0; changed_when_thawed = false; @@ -104,7 +102,6 @@ AutomationList::AutomationList (const AutomationList& other) } AutomationList::AutomationList (const AutomationList& other, double start, double end) - : _touch_saved_point (-1.0, -1.0) { _frozen = 0; changed_when_thawed = false; @@ -138,7 +135,6 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl } AutomationList::AutomationList (const XMLNode& node) - : _touch_saved_point (-1.0, -1.0) { _frozen = 0; changed_when_thawed = false; @@ -299,9 +295,16 @@ void AutomationList::_x_scale (double factor) } void -AutomationList::reposition_for_rt_add (double when) +AutomationList::write_pass_finished (double when) { - merge_nascent (); + merge_nascent (when); + + /* do not remain in Write mode after stopping - drop into Touch + */ + + if (_state == Auto_Write) { + set_automation_state (Auto_Touch); + } } void @@ -325,7 +328,7 @@ AutomationList::rt_add (double when, double value) } void -AutomationList::merge_nascent () +AutomationList::merge_nascent (double when) { { Glib::Mutex::Lock lm (lock); @@ -1290,7 +1293,14 @@ AutomationList::state (bool full) root->add_property ("max_xval", buf); if (full) { - root->add_property ("state", auto_state_to_string (_state)); + /* never serialize state with Write enabled - too dangerous + for the user's data + */ + if (_state != Auto_Write) { + root->add_property ("state", auto_state_to_string (_state)); + } else { + root->add_property ("state", auto_state_to_string (Auto_Off)); + } } else { /* never save anything but Off for automation state to a template */ root->add_property ("state", auto_state_to_string (Auto_Off)); diff --git a/libs/ardour/insert.cc b/libs/ardour/insert.cc index 1dd6cff83..24b877321 100644 --- a/libs/ardour/insert.cc +++ b/libs/ardour/insert.cc @@ -360,7 +360,7 @@ PluginInsert::transport_stopped (nframes_t now) AutomationList* alist = *li; if (alist) { - alist->reposition_for_rt_add (now); + alist->write_pass_finished (now); if (alist->automation_state() == Auto_Touch || alist->automation_state() == Auto_Play) { _plugins[0]->set_parameter (n, alist->eval (now)); } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 35d0df9e9..430ae46ab 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -2724,7 +2724,7 @@ IO::automation_snapshot (nframes_t now, bool force) void IO::transport_stopped (nframes_t frame) { - _gain_automation_curve.reposition_for_rt_add (frame); + _gain_automation_curve.write_pass_finished (frame); if (_gain_automation_curve.automation_state() == Auto_Touch || _gain_automation_curve.automation_state() == Auto_Play) { diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 511a4778d..4e4759c6e 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -210,7 +210,7 @@ BaseStereoPanner::transport_stopped (nframes_t frame) set_position (_automation.eval (frame)); } - _automation.reposition_for_rt_add (frame); + _automation.write_pass_finished (frame); } void -- 2.11.4.GIT