Don't use Session::get_info_from_path for AAF/archive (like v8)

This still has an issue that the engine dialog may show up
before inflating the session, and known sample-rate; but
Ardour 9 can handle this.
This commit is contained in:
Robin Gareus 2025-11-04 00:28:22 +01:00
parent 6211ba8260
commit a458a302d1
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -534,34 +534,48 @@ SessionDialog::existing_file_selected ()
return; return;
} }
open_button->set_sensitive(false); open_button->set_sensitive (false);
float sr; std::string const& s = existing_session_chooser.get_filename ();
SampleFormat sf; if (!Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) {
string pv; return;
XMLNode engine_hints ("EngineHints"); }
std::string s = existing_session_chooser.get_filename (); std::string suffix = s.substr (s.find_last_of ('.'));
if (Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) {
switch (Session::get_info_from_path (s, sr, sf, pv, &engine_hints)) { if (PBD::downcase (suffix).find (advanced_authoring_format_suffix) == 0) {
case 0: { // OK
} else if (suffix.find (session_archive_suffix) == 0) {
// OK
} else {
float sr;
SampleFormat sf;
string pv;
switch (Session::get_info_from_path (s, sr, sf, pv)) {
case 1:
/* OK */
break;
case 0:
//TODO: display the rate somewhere? check that our engine can open this rate? //TODO: display the rate somewhere? check that our engine can open this rate?
/* OK */ /* OK */
} break; break;
case -1: case -1:
error << string_compose (_("Session file %1 does not exist"), s) << endmsg; error << string_compose (_("Session file %1 does not exist"), s) << endmsg;
return; return;
break; break;
case -3: case -3:
error << string_compose (_("Session %1 is from a newer version of %2"), s, PROGRAM_NAME) << endmsg; error << string_compose (_("Session %1 is from a newer version of %2"), s, PROGRAM_NAME) << endmsg;
return; return;
break; break;
default: default:
error << string_compose (_("Cannot get existing session information from %1"), s) << endmsg; error << string_compose (_("Cannot get existing session information from %1"), s) << endmsg;
//fallthrough return;
break;
} }
open_button->set_sensitive(true); //still potentially openable; checks for session archives, .ptf, and .aaf will have to occur later
} }
open_button->set_sensitive(true); //still potentially openable; checks for session archives, .ptf, and .aaf will have to occur later
} }
void void