+void
+ARDOUR_UI::import_metadata ()
+{
+ SessionMetadataImporter dialog;
+ dialog.set_session (session);
+ editor->ensure_float (dialog);
+ dialog.run ();
+}
+
+void
+ARDOUR_UI::fontconfig_dialog ()
+{
+#ifdef GTKOSX
+ /* X11 users will always have fontconfig info around, but new GTK-OSX users
+ may not and it can take a while to build it. Warn them.
+ */
+
+ Glib::ustring fontconfig = Glib::build_filename (Glib::get_home_dir(), ".fontconfig");
+
+ if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
+ MessageDialog msg (*new_session_dialog,
+ _("Welcome to Ardour.\n\n"
+ "The program will take a bit longer to start up\n"
+ "while the system fonts are checked.\n\n"
+ "This will only be done once, and you will\n"
+ "not see this message again\n"),
+ true,
+ Gtk::MESSAGE_INFO,
+ Gtk::BUTTONS_OK);
+ pop_back_splash ();
+ msg.show_all ();
+ msg.present ();
+ msg.run ();
+ }
+#endif
+}
+
+void
+ARDOUR_UI::parse_cmdline_path (const Glib::ustring& cmdline_path, Glib::ustring& session_name, Glib::ustring& session_path, bool& existing_session)
+{
+ existing_session = false;
+
+ if (Glib::file_test (cmdline_path, Glib::FILE_TEST_IS_DIR)) {
+ session_path = cmdline_path;
+ existing_session = true;
+ } else if (Glib::file_test (cmdline_path, Glib::FILE_TEST_IS_REGULAR)) {
+ session_path = Glib::path_get_dirname (string (cmdline_path));
+ existing_session = true;
+ } else {
+ /* it doesn't exist, assume the best */
+ session_path = Glib::path_get_dirname (string (cmdline_path));
+ }
+
+ session_name = basename_nosuffix (string (cmdline_path));
+}
+
+int
+ARDOUR_UI::load_cmdline_session (const Glib::ustring& session_name, const Glib::ustring& session_path, bool& existing_session)
+{
+ /* when this is called, the backend audio system must be running */
+
+ /* the main idea here is to deal with the fact that a cmdline argument for the session
+ can be interpreted in different ways - it could be a directory or a file, and before
+ we load, we need to know both the session directory and the snapshot (statefile) within it
+ that we are supposed to use.
+ */
+
+ if (session_name.length() == 0 || session_path.length() == 0) {