summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_list.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-09-27 00:57:52 +1000
committernick_m <mainsbridge@gmail.com>2015-10-20 00:53:28 +1100
commit9c102fa8d20b932f9a9879298764c0351a0e5acc (patch)
treeed9bbf05a2b6771d1dbe9e86b5e586f24c2debc1 /libs/ardour/automation_list.cc
parent877b258c74aa6e2fa737ca9112900dca8bce6628 (diff)
Make automation record undo per pass rather than per touch.
Diffstat (limited to 'libs/ardour/automation_list.cc')
-rw-r--r--libs/ardour/automation_list.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 91609f6acb..afff85c1f8 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -50,6 +50,7 @@ static void dumpit (const AutomationList& al, string prefix = "")
#endif
AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc)
: ControlList(id, desc)
+ , _before (0)
{
_state = Off;
_style = Absolute;
@@ -63,6 +64,7 @@ AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::Param
AutomationList::AutomationList (const Evoral::Parameter& id)
: ControlList(id, ARDOUR::ParameterDescriptor(id))
+ , _before (0)
{
_state = Off;
_style = Absolute;
@@ -77,6 +79,7 @@ AutomationList::AutomationList (const Evoral::Parameter& id)
AutomationList::AutomationList (const AutomationList& other)
: StatefulDestructible()
, ControlList(other)
+ , _before (0)
{
_style = other._style;
_state = other._state;
@@ -90,6 +93,7 @@ AutomationList::AutomationList (const AutomationList& other)
AutomationList::AutomationList (const AutomationList& other, double start, double end)
: ControlList(other, start, end)
+ , _before (0)
{
_style = other._style;
_state = other._state;
@@ -106,6 +110,7 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl
*/
AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id)
: ControlList(id, ARDOUR::ParameterDescriptor(id))
+ , _before (0)
{
g_atomic_int_set (&_touching, 0);
_state = Off;
@@ -186,6 +191,9 @@ AutomationList::set_automation_state (AutoState s)
{
if (s != _state) {
_state = s;
+ if (s == Write) {
+ _before = &get_state ();
+ }
automation_state_changed (s); /* EMIT SIGNAL */
}
}
@@ -200,6 +208,22 @@ AutomationList::set_automation_style (AutoStyle s)
}
void
+AutomationList::start_write_pass (double when)
+{
+ if (in_new_write_pass ()) {
+ _before = &get_state ();
+ }
+ ControlList::start_write_pass (when);
+}
+
+void
+AutomationList::write_pass_finished (double when, double thinning_factor)
+{
+ ControlList::write_pass_finished (when, thinning_factor);
+ _before = 0;
+}
+
+void
AutomationList::start_touch (double when)
{
if (_state == Touch) {