diff options
author | Robin Gareus <robin@gareus.org> | 2015-04-05 16:02:07 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-05 16:02:07 +0200 |
commit | f0231766d7e9806709095c0a8bd89e336bfb8f7b (patch) | |
tree | 7741ca87ad400cb75aa55c815b3dc3c1ddfc9698 /libs/ardour/session_state.cc | |
parent | 4b485332ceaefcea8b803e7342e2a7dba700026e (diff) |
session rename details:
* don’t allow to rename read-only sessions
* prevent periodic save (while rename is in progress)
* no renaming while actively recording (peak files
among other things will mess things up)
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index c514aa9861..3f1fd7bf7c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3624,6 +3624,17 @@ Session::rename (const std::string& new_name) string const old_sources_root = _session_dir->sources_root(); + if (!_writable || (_state_of_the_state & CannotSave)) { + error << _("Cannot rename read-only session.") << endmsg; + return 0; // don't show "messed up" warning + } + if (record_status() == Recording) { + error << _("Cannot rename session while recording") << endmsg; + return 0; // don't show "messed up" warning + } + + StateProtector stp (this); + /* Rename: * session directory |