X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui.cc;h=d9ac37e36f5c94b038def8a136da7cfaa70746d4;hb=237741d18722252abd4a6a20d3422315481ccffe;hp=4f1c85f6b4c3e7ad2cd6e8799ef08fb6489f27b1;hpb=e8d3c1618755165f3d035178dc0a77675a3a1969;p=ardour.git diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 4f1c85f6b4..d9ac37e36f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -50,6 +50,7 @@ #include "pbd/enumwriter.h" #include "pbd/memento_command.h" #include "pbd/openuri.h" +#include "pbd/stl_delete.h" #include "pbd/file_utils.h" #include "pbd/localtime_r.h" @@ -755,6 +756,7 @@ ARDOUR_UI::starting () try { audio_midi_setup.get (true); } catch (...) { + std::cerr << "audio-midi engine setup failed."<< std::endl; return -1; } @@ -841,6 +843,7 @@ ARDOUR_UI::starting () const bool new_session_required = (ARDOUR_COMMAND_LINE::new_session || brand_new_user); if (get_session_parameters (false, new_session_required, ARDOUR_COMMAND_LINE::load_template)) { + std::cerr << "Cannot get session parameters."<< std::endl; return -1; } } @@ -1413,7 +1416,7 @@ ARDOUR_UI::redisplay_recent_sessions () get_state_files_in_directory (*i, state_file_paths); - vector* states; + vector states; vector item; string fullpath = *i; @@ -1430,8 +1433,9 @@ ARDOUR_UI::redisplay_recent_sessions () } /* now get available states for this session */ + states = Session::possible_states (fullpath); - if ((states = Session::possible_states (fullpath)) == 0) { + if (states.empty()) { /* no state file? */ continue; } @@ -1440,14 +1444,14 @@ ARDOUR_UI::redisplay_recent_sessions () Gtk::TreeModel::Row row = *(recent_session_model->append()); - row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath); row[recent_session_columns.fullpath] = fullpath; row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); if (state_file_names.size() > 1) { + // multiple session files in the session directory - show the directory name. + row[recent_session_columns.visible_name] = Glib::path_get_basename (fullpath); // add the children - for (std::vector::iterator i2 = state_file_names.begin(); i2 != state_file_names.end(); ++i2) { @@ -1458,6 +1462,9 @@ ARDOUR_UI::redisplay_recent_sessions () child_row[recent_session_columns.fullpath] = fullpath; child_row[recent_session_columns.tip] = Glib::Markup::escape_text (fullpath); } + } else { + // only a single session file in the directory - show its actual name. + row[recent_session_columns.visible_name] = state_file_names.front (); } }