X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsession_dialog.cc;h=225b02df84ba3d42eab0748bacff1f232778db26;hb=29b80725559c8fd60ae51bf33270963e647d0c1c;hp=cc587b2da2e7d3f6962f49b5610aaf7e148beaca;hpb=663dd1cf2cf982033eb0baf72e932624bbaf0991;p=ardour.git diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index cc587b2da2..225b02df84 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -31,6 +31,7 @@ #include +#include "pbd/basename.h" #include "pbd/failed_constructor.h" #include "pbd/file_utils.h" #include "pbd/replace_all.h" @@ -53,7 +54,7 @@ #include "session_dialog.h" #include "opts.h" #include "engine_dialog.h" -#include "i18n.h" +#include "pbd/i18n.h" #include "tooltips.h" #include "ui_config.h" #include "utils.h" @@ -130,12 +131,13 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name, if (recent_session_model) { int cnt = redisplay_recent_sessions (); if (cnt > 0) { - recent_scroller.set_size_request (-1, 80); recent_scroller.show(); recent_label.show (); if (cnt > 4) { recent_scroller.set_size_request (-1, 300); + } else { + recent_scroller.set_size_request (-1, 80); } } else { recent_scroller.hide(); @@ -179,13 +181,15 @@ SessionDialog::SessionDialog () get_vbox()->pack_start (recent_scroller, true, true); get_vbox()->show_all (); - recent_scroller.set_size_request (-1, 80); recent_scroller.show(); int cnt = redisplay_recent_sessions (); if (cnt > 4) { recent_scroller.set_size_request (-1, 300); + } else { + recent_scroller.set_size_request (-1, 80); } + } @@ -247,6 +251,10 @@ SessionDialog::session_name (bool& should_be_new) if (iter) { should_be_new = false; + string s = (*iter)[recent_session_columns.fullpath]; + if (Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) { + return PBD::basename_nosuffix (s); + } return (*iter)[recent_session_columns.visible_name]; } @@ -340,7 +348,10 @@ SessionDialog::setup_initial_choice_box () string image_path; - if (find_file (ardour_data_search_path(), "small-splash.png", image_path)) { + Searchpath rc (ARDOUR::ardour_data_search_path()); + rc.add_subdirectory_to_paths ("resources"); + + if (find_file (rc, PROGRAM_NAME "-small-splash.png", image_path)) { Gtk::Image* image; if ((image = manage (new Gtk::Image (image_path))) != 0) { hbox->pack_start (*image, false, false); @@ -408,6 +419,17 @@ SessionDialog::setup_initial_choice_box () centering_vbox->pack_start (*browse_label, false, false, 12); centering_vbox->pack_start (existing_session_chooser, false, false); + /* --disable plugins UI */ + + _disable_plugins.set_label (_("Safe Mode: Disable all Plugins")); + _disable_plugins.set_flags (Gtk::CAN_FOCUS); + _disable_plugins.set_relief (Gtk::RELIEF_NORMAL); + _disable_plugins.set_mode (true); + _disable_plugins.set_active (ARDOUR::Session::get_disable_all_loaded_plugins()); + _disable_plugins.set_border_width(0); + _disable_plugins.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::disable_plugins_clicked)); + centering_vbox->pack_start (_disable_plugins, false, false); + /* pack it all up */ centering_hbox->pack_start (*centering_vbox, true, true); @@ -693,14 +715,27 @@ SessionDialog::redisplay_recent_sessions () float sr; SampleFormat sf; - std::string state_file_basename = state_file_names.front(); + + std::string state_file_basename; + + if (state_file_names.size() > 1) { + state_file_basename = Session::get_snapshot_from_instant (dirname); + std::string s = Glib::build_filename (dirname, state_file_basename + statefile_suffix); + if (!Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) { + state_file_basename = ""; + } + } + + if (state_file_basename.empty()) { + state_file_basename = state_file_names.front(); + } std::string s = Glib::build_filename (dirname, state_file_basename + statefile_suffix); GStatBuf gsb; g_stat (s.c_str(), &gsb); - row[recent_session_columns.fullpath] = dirname; /* just the dir, but this works too */ + row[recent_session_columns.fullpath] = s; row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname); row[recent_session_columns.time_modified] = gsb.st_mtime; @@ -708,13 +743,13 @@ SessionDialog::redisplay_recent_sessions () row[recent_session_columns.sample_rate] = rate_as_string (sr); switch (sf) { case FormatFloat: - row[recent_session_columns.disk_format] = _("32 bit float"); + row[recent_session_columns.disk_format] = _("32-bit float"); break; case FormatInt24: - row[recent_session_columns.disk_format] = _("24 bit"); + row[recent_session_columns.disk_format] = _("24-bit"); break; case FormatInt16: - row[recent_session_columns.disk_format] = _("16 bit"); + row[recent_session_columns.disk_format] = _("16-bit"); break; } } else { @@ -755,13 +790,13 @@ SessionDialog::redisplay_recent_sessions () child_row[recent_session_columns.sample_rate] = rate_as_string (sr); switch (sf) { case FormatFloat: - child_row[recent_session_columns.disk_format] = _("32 bit float"); + child_row[recent_session_columns.disk_format] = _("32-bit float"); break; case FormatInt24: - child_row[recent_session_columns.disk_format] = _("24 bit"); + child_row[recent_session_columns.disk_format] = _("24-bit"); break; case FormatInt16: - child_row[recent_session_columns.disk_format] = _("16 bit"); + child_row[recent_session_columns.disk_format] = _("16-bit"); break; } } else { @@ -1131,6 +1166,12 @@ SessionDialog::recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*) response (RESPONSE_ACCEPT); } +void +SessionDialog::disable_plugins_clicked () +{ + ARDOUR::Session::set_disable_all_loaded_plugins (_disable_plugins.get_active()); +} + void SessionDialog::existing_session_selected () {