summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-04-22 16:28:44 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-04-22 16:28:44 +0000
commit55b1a3d1edcdbaecf5a6ff97e4b0fb6617eab630 (patch)
tree72305a7ee41f6966bffda00f7b2ac52e3ec5bda9
parent2df90582860824831a9fc79e69c0750f2c84a5b2 (diff)
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: svn://localhost/ardour2/branches/2.0-ongoing@6966 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/ardour/automation_event.h8
-rw-r--r--libs/ardour/automation_event.cc26
-rw-r--r--libs/ardour/insert.cc2
-rw-r--r--libs/ardour/io.cc2
-rw-r--r--libs/ardour/panner.cc2
5 files changed, 23 insertions, 17 deletions
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h
index 0005c8de00..fc998e5cb2 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 1aa2f9c7e6..19c8ff584e 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 1dd6cff83d..24b877321d 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 35d0df9e9f..430ae46abb 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 511a4778d5..4e4759c6ef 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