diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-27 20:28:45 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-27 20:28:45 +0200 |
commit | 1f5013b4a872a5a59a14705aa07331baaff5f77f (patch) | |
tree | 5431c34c61f2cd6c6168a73177e69fdbc795b6d9 /libs | |
parent | 1dd4aab0b4d3e14ef93ddb3470d4c386f48cda6b (diff) |
Distinguish error-messages.
The vast majority of errors reported by users as
"Cannot configure audio/midi engine with session parameters"
have nothing to do with engine-parameters.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session.cc | 22 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 17 |
2 files changed, 32 insertions, 7 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 416f972ea7..0463794d84 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -412,9 +412,27 @@ Session::Session (AudioEngine &eng, } } - if (post_engine_init ()) { + int err = post_engine_init (); + if (err) { destroy (); - throw SessionException (_("Cannot configure audio/midi engine with session parameters")); + switch (err) { + case -1: + throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Failed to create background threads."))); + break; + case -2: + case -3: + throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Invalid TempoMap in session-file."))); + break; + case -4: + throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Invalid or corrupt session state."))); + break; + case -5: + throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Port registration failed."))); + break; + default: + throw SessionException (string_compose (_("Cannot initialize session/engine: %1"), _("Unexpected exception during session setup, possibly invalid audio/midi engine parameters. Please see stdout/stderr for details"))); + break; + } } store_recent_sessions (_name, _path); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1bf604ea93..5e1525dbed 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -265,7 +265,15 @@ Session::post_engine_init () _tempo_map = new TempoMap (_current_frame_rate); _tempo_map->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::tempo_map_changed, this, _1)); _tempo_map->MetricPositionChanged.connect_same_thread (*this, boost::bind (&Session::tempo_map_changed, this, _1)); + } catch (std::exception const & e) { + error << _("Unexpected exception during session setup: ") << e.what() << endmsg; + return -2; + } catch (...) { + error << _("Unknown exception during session setup") << endmsg; + return -3; + } + try { /* MidiClock requires a tempo map */ delete midi_clock; @@ -288,7 +296,7 @@ Session::post_engine_init () if (state_tree) { if (set_state (*state_tree->root(), Stateful::loading_state_version)) { error << _("Could not set session state from XML") << endmsg; - return -1; + return -4; } } else { // set_state() will call setup_raid_path(), but if it's a new session we need @@ -351,15 +359,14 @@ Session::post_engine_init () _locations->changed.connect_same_thread (*this, boost::bind (&Session::locations_changed, this)); } catch (AudioEngine::PortRegistrationFailure& err) { - /* handle this one in a different way than all others, so that its clear what happened */ error << err.what() << endmsg; - return -1; + return -5; } catch (std::exception const & e) { error << _("Unexpected exception during session setup: ") << e.what() << endmsg; - return -1; + return -6; } catch (...) { error << _("Unknown exception during session setup") << endmsg; - return -1; + return -7; } BootMessage (_("Reset Remote Controls")); |