- also allow saved automation list state to be touch or off if
actually in write mode.
}
if (as == Write) {
+ /* get state for undo */
+ _before = &alist ()->get_state ();
AutomationWatch::instance().add_automation_watch (shared_from_this());
} else if (as == Touch) {
if (!touching()) {
if (!touching()) {
- if (alist()->automation_state() == Write) {
- _before = &alist ()->get_state ();
- }
-
if (alist()->automation_state() == Touch) {
/* subtle. aligns the user value with the playback */
set_value (get_value ());
if (_state != Write) {
root->add_property ("state", auto_state_to_string (_state));
} else {
- root->add_property ("state", auto_state_to_string (Off));
+ if (_events.empty ()) {
+ root->add_property ("state", auto_state_to_string (Off));
+ } else {
+ root->add_property ("state", auto_state_to_string (Touch));
+ }
}
} else {
/* never save anything but Off for automation state to a template */