explanatory comment and logic change to cover when we switch to the new session after...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Feb 2017 11:39:44 +0000 (12:39 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 9 Feb 2017 11:40:59 +0000 (12:40 +0100)
gtk2_ardour/ardour_ui.cc

index 2b9624b6636b74abcc1c55219ae173436774c267..e5b13c821cb7832ecdca542ba660e130308b06f1 100644 (file)
@@ -2665,7 +2665,15 @@ ARDOUR_UI::save_session_as ()
                msg.run ();
        }
 
-       if (!sa.include_media) {
+       /* the logic here may seem odd: why isn't the condition sa.switch_to ?
+        * the trick is this: if the new session was copy with media included,
+        * then Session::save_as() will have already done a neat trick to avoid
+        * us having to unload and load the new state. But if the media was not
+        * included, then this is required (it avoids us having to otherwise
+        * drop all references to media (sources).
+        */
+
+       if (!sa.include_media && sa.switch_to) {
                unload_session (false);
                load_session (sa.final_session_folder_name, sa.new_name);
                hide_splash ();