#endif
AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc)
: ControlList(id, desc)
+ , _before (0)
{
_state = Off;
_style = Absolute;
AutomationList::AutomationList (const Evoral::Parameter& id)
: ControlList(id, ARDOUR::ParameterDescriptor(id))
+ , _before (0)
{
_state = Off;
_style = Absolute;
AutomationList::AutomationList (const AutomationList& other)
: StatefulDestructible()
, ControlList(other)
+ , _before (0)
{
_style = other._style;
_state = other._state;
AutomationList::AutomationList (const AutomationList& other, double start, double end)
: ControlList(other, start, end)
+ , _before (0)
{
_style = other._style;
_state = other._state;
*/
AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id)
: ControlList(id, ARDOUR::ParameterDescriptor(id))
+ , _before (0)
{
g_atomic_int_set (&_touching, 0);
_state = Off;
{
if (s != _state) {
_state = s;
+ if (s == Write && _desc.toggled) {
+ _before = &get_state ();
+ }
automation_state_changed (s); /* EMIT SIGNAL */
}
}
}
}
+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);
+ /* automation control has deleted this or it is now owned by the session undo stack */
+ _before = 0;
+}
+
void
AutomationList::start_touch (double when)
{
if (_state == Touch) {
if (mark) {
-
+
/* XXX need to mark the last added point with the
- * current time
+ * current time
*/
}
}
}
+/* _before may be owned by the undo stack,
+ * so we have to be careful about doing this.
+*/
+void
+AutomationList::clear_history ()
+{
+ delete _before;
+ _before = 0;
+}
+
void
AutomationList::thaw ()
{
boost::shared_ptr<AutomationList> (new AutomationList (*this->_current.get()))
);
}
-
+