diff options
author | Robin Gareus <robin@gareus.org> | 2016-10-13 02:07:08 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-10-13 02:07:34 +0200 |
commit | eae567bd9e2fe1ac3820490b65f199f6cc23c83d (patch) | |
tree | 2ff21d0ad2070fc0a25282c4fe680272cff3685b /libs | |
parent | c104c9d4726f3ba1ecd352d13b88a57f2f964510 (diff) |
Allow opening sessions with files embedded from removable drives
Otherwise Windows shows a critical error for files embedded from
removable devices.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session_state.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index ec98908a54..ba0474f741 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2112,13 +2112,27 @@ Session::load_sources (const XMLNode& node) set_dirty(); for (niter = nlist.begin(); niter != nlist.end(); ++niter) { +#ifdef PLATFORM_WINDOWS + int old_mode = 0; +#endif + retry: try { +#ifdef PLATFORM_WINDOWS + // do not show "insert media" popups (files embedded from removable media). + old_mode = SetErrorMode(SEM_FAILCRITICALERRORS); +#endif if ((source = XMLSourceFactory (**niter)) == 0) { error << _("Session: cannot create Source from XML description.") << endmsg; } +#ifdef PLATFORM_WINDOWS + SetErrorMode(old_mode); +#endif } catch (MissingSource& err) { +#ifdef PLATFORM_WINDOWS + SetErrorMode(old_mode); +#endif int user_choice; |