diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-26 15:38:48 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-26 15:38:48 -0400 |
commit | ec2cb3141f19e9567c174fac8b895566a755a415 (patch) | |
tree | c8045ff3e1ec87ebfa88edd52279e2755ea0f6b3 /libs/ardour/session_state.cc | |
parent | 1e6b6df77321958ce50b4db79e446bd2c1ce9f23 (diff) |
next (final?) part of handling missing MIDI files.3.5.403
If an external-to-session file is missing, consider it a fatal error in session
loading.
If an internal-to-session file is missing, just create a new MIDI source with
the same path and ID, and use that instead.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 79d8ca1c02..db1eb30d3c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -74,6 +74,7 @@ #include "pbd/stacktrace.h" #include "pbd/convert.h" #include "pbd/clear_dir.h" +#include "pbd/strsplit.h" #include "ardour/amp.h" #include "ardour/audio_diskstream.h" @@ -1902,7 +1903,13 @@ Session::load_sources (const XMLNode& node) string fullpath; if (!Glib::path_is_absolute (err.path)) { - fullpath = Glib::build_filename (source_search_path (DataType::MIDI).front(), err.path); + vector<Glib::ustring> sdirs; + split (source_search_path (DataType::MIDI), sdirs, ':'); + if (sdirs.empty()) { + fatal << _("Empty MIDI source search path!") << endmsg; + /*NOTREACHED*/ + } + fullpath = Glib::build_filename (sdirs.front(), err.path); } else { /* this should be an unrecoverable error: we would be creating a MIDI file outside the session tree. |