return ret;
}
}
- cerr << "SS canfail\n";
+
save_ardour_state (); /* XXX cannot fail? yeah, right ... */
return 0;
}
int ret = -1;
bool likely_new = false;
- if (! load_template.empty()) {
+ if (!load_template.empty()) {
should_be_new = true;
template_name = load_template;
}
to find the session.
*/
- if (ARDOUR_COMMAND_LINE::session_name.find (statefile_suffix) != string::npos) {
+ string::size_type suffix = ARDOUR_COMMAND_LINE::session_name.find (statefile_suffix);
+
+ if (suffix != string::npos) {
session_path = Glib::path_get_dirname (ARDOUR_COMMAND_LINE::session_name);
+ session_name = ARDOUR_COMMAND_LINE::session_name.substr (0, suffix);
+ session_name = Glib::path_get_basename (session_name);
} else {
session_path = ARDOUR_COMMAND_LINE::session_name;
+ session_name = Glib::path_get_basename (ARDOUR_COMMAND_LINE::session_name);
}
- session_name = Glib::path_get_basename (ARDOUR_COMMAND_LINE::session_name);
-
} else {
bool const apply = run_startup (should_be_new, load_template);
goto_editor_window ();
}
-/** @return -2 if the load failed because we are not connected to the AudioEngine */
+/** @param snap_name Snapshot name (without .ardour suffix).
+ * @return -2 if the load failed because we are not connected to the AudioEngine.
+ */
int
ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name, std::string mix_template)
{
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
}
#endif
+/** @param snapshot_name Name to save under, without .ardour / .pending prefix */
int
Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot)
{