diff options
author | Robin Gareus <robin@gareus.org> | 2020-01-30 04:12:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-01-30 04:12:19 +0100 |
commit | 0d127813fb6c4a5baa8802f09d32c1fc9b6a0f63 (patch) | |
tree | 041985b39ecfc1b6443ebbd77c666006533ee20a /libs/ardour/session_state.cc | |
parent | 998fadda573f7e6b1432bba2ed3b2b555d358964 (diff) |
Allow StateProtector to save pending files
This is in preparation for saving state while the session is
record-arm'ed. Most notably config changes and undo/redo.
In case both normal and pending save happens, pending must be
last and is required to recover from crashes during recording.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index e7b1a29d3e..757344f69c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -785,10 +785,20 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot } if (g_atomic_int_get(&_suspend_save)) { - _save_queued = true; + /* StateProtector cannot be used for templates or save-as */ + assert (!template_only && !switch_to_snapshot && !for_archive && snapshot_name.empty ()); + if (pending) { + _save_queued_pending = true; + } else { + _save_queued = true; + } return 1; } - _save_queued = false; + if (pending) { + _save_queued_pending = false; + } else { + _save_queued = false; + } snapshot_t fork_state = NormalSave; if (!snapshot_name.empty() && snapshot_name != _current_snapshot_name && !template_only && !pending && !for_archive) { |