update UI, new info API, display created_version in tooltip
authorRobin Gareus <robin@gareus.org>
Fri, 20 Jan 2017 17:16:32 +0000 (18:16 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 20 Jan 2017 17:16:32 +0000 (18:16 +0100)
gtk2_ardour/session_dialog.cc
session_utils/common.cc
tools/luadevel/luasession.cc

index 5ad245eeb5495db0b8b6f366558c0408f468a02b..71df823ee06a4c8664fe7ff301906c0a3e339ac7 100644 (file)
@@ -734,6 +734,7 @@ SessionDialog::redisplay_recent_sessions ()
 
                float sr;
                SampleFormat sf;
+               std::string created_version;
 
                std::string state_file_basename;
 
@@ -755,10 +756,9 @@ SessionDialog::redisplay_recent_sessions ()
                g_stat (s.c_str(), &gsb);
 
                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;
 
-               if (Session::get_info_from_path (s, sr, sf) == 0) {
+               if (Session::get_info_from_path (s, sr, sf, created_version) == 0) {
                        row[recent_session_columns.sample_rate] = rate_as_string (sr);
                        switch (sf) {
                        case FormatFloat:
@@ -776,6 +776,12 @@ SessionDialog::redisplay_recent_sessions ()
                        row[recent_session_columns.disk_format] = "--";
                }
 
+               if (created_version.empty()) {
+                       row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
+               } else {
+                       row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname + "\n" + created_version);
+               }
+
                ++session_snapshot_count;
 
                if (state_file_names.size() > 1) {
@@ -794,7 +800,11 @@ SessionDialog::redisplay_recent_sessions ()
 
                                child_row[recent_session_columns.visible_name] = *i2;
                                child_row[recent_session_columns.fullpath] = s;
-                               child_row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
+                               if (created_version.empty()) {
+                                       child_row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
+                               } else {
+                                       child_row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname + "\n" + created_version);
+                               }
                                g_stat (s.c_str(), &gsb);
                                child_row[recent_session_columns.time_modified] = gsb.st_mtime;
 
@@ -805,7 +815,7 @@ SessionDialog::redisplay_recent_sessions ()
                                        most_recent = gsb.st_mtime;
                                }
 #if 0
-                               if (Session::get_info_from_path (s, sr, sf) == 0) {
+                               if (Session::get_info_from_path (s, sr, sf, created_version) == 0) {
                                        child_row[recent_session_columns.sample_rate] = rate_as_string (sr);
                                        switch (sf) {
                                        case FormatFloat:
index 8d1cdec950d8afb39c3b9c8650701b23ef9b6efb..99ed10d32d35d0dd9f04585e394bb863d15f15e1 100644 (file)
@@ -120,9 +120,10 @@ static Session * _load_session (string dir, string state)
 
        float sr;
        SampleFormat sf;
+       std::string v;
 
        std::string s = Glib::build_filename (dir, state + statefile_suffix);
-       if (Session::get_info_from_path (s, sr, sf) == 0) {
+       if (Session::get_info_from_path (s, sr, sf, v) == 0) {
                if (engine->set_sample_rate (sr)) {
                        std::cerr << "Cannot set session's samplerate.\n";
                        return 0;
index a131bb443f799b5720119ead85a0a42a9e3f75ec..8de36360704f9487694e9c9349734f0819cdaf19 100644 (file)
@@ -239,13 +239,14 @@ static Session * _load_session (string dir, string state) // throws
 
        float sr;
        SampleFormat sf;
+       std::string v;
        std::string s = Glib::build_filename (dir, state + statefile_suffix);
        if (!Glib::file_test (dir, Glib::FILE_TEST_EXISTS)) {
                std::cerr << "Cannot find session: " << s << "\n";
                return 0;
        }
 
-       if (Session::get_info_from_path (s, sr, sf) != 0) {
+       if (Session::get_info_from_path (s, sr, sf, v) != 0) {
                std::cerr << "Cannot get samplerate from session.\n";
                return 0;
        }