+void
+ARDOUR_UI::quick_snapshot_session (bool switch_to_it)
+{
+ char timebuf[128];
+ time_t n;
+ struct tm local_time;
+
+ time (&n);
+ localtime_r (&n, &local_time);
+ strftime (timebuf, sizeof(timebuf), "%FT%H.%M.%S", &local_time);
+
+ save_state (timebuf, switch_to_it);
+}
+
+
+bool
+ARDOUR_UI::process_snapshot_session_prompter (ArdourPrompter& prompter, bool switch_to_it)
+{
+ string snapname;
+
+ prompter.get_result (snapname);
+
+ bool do_save = (snapname.length() != 0);
+
+ if (do_save) {
+ char illegal = Session::session_name_is_legal(snapname);
+ if (illegal) {
+ MessageDialog msg (string_compose (_("To ensure compatibility with various systems\n"
+ "snapshot names may not contain a '%1' character"), illegal));
+ msg.run ();
+ return false;
+ }
+ }
+
+ vector<std::string> p;
+ get_state_files_in_directory (_session->session_directory().root_path(), p);
+ vector<string> n = get_file_names_no_extension (p);
+
+ if (find (n.begin(), n.end(), snapname) != n.end()) {
+
+ do_save = overwrite_file_dialog (prompter,
+ _("Confirm Snapshot Overwrite"),
+ _("A snapshot already exists with that name. Do you want to overwrite it?"));
+ }
+
+ if (do_save) {
+ save_state (snapname, switch_to_it);
+ }
+ else {
+ return false;
+ }
+
+ return true;
+}
+
+