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

@ -536,18 +536,30 @@ SessionDialog::existing_file_selected ()
open_button->set_sensitive (false); open_button->set_sensitive (false);
std::string const& s = existing_session_chooser.get_filename ();
if (!Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) {
return;
}
std::string suffix = s.substr (s.find_last_of ('.'));
if (PBD::downcase (suffix).find (advanced_authoring_format_suffix) == 0) {
// OK
} else if (suffix.find (session_archive_suffix) == 0) {
// OK
} else {
float sr; float sr;
SampleFormat sf; SampleFormat sf;
string pv; string pv;
XMLNode engine_hints ("EngineHints");
std::string s = existing_session_chooser.get_filename (); switch (Session::get_info_from_path (s, sr, sf, pv)) {
if (Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) { case 1:
switch (Session::get_info_from_path (s, sr, sf, pv, &engine_hints)) { /* OK */
case 0: { 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;
@ -558,11 +570,13 @@ SessionDialog::existing_file_selected ()
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
SessionDialog::session_selected () SessionDialog::session_selected ()