session rename details:
authorRobin Gareus <robin@gareus.org>
Sun, 5 Apr 2015 14:02:07 +0000 (16:02 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 5 Apr 2015 14:02:07 +0000 (16:02 +0200)
* 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)

libs/ardour/session_state.cc

index c514aa9861b077abc8ea010ae90cfed2d151cbf4..3f1fd7bf7c5141b11df3dd7965cdc4d1f183a801 100644 (file)
@@ -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