diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-15 19:53:10 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-15 19:53:10 -0400 |
commit | 0f529ee8b4747d3d5d72db269e5c49b4ffb156c0 (patch) | |
tree | de8655c6d24342677b340a251b7ed9cdf96b9847 | |
parent | 2c00c0c0252022769a4bf3eb76856b494205c81a (diff) |
fix API errors after cherry-picking empty MIDI file fixes from cairocanvas
-rw-r--r-- | libs/ardour/session.cc | 4 | ||||
-rw-r--r-- | libs/ardour/smf_source.cc | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 2d26cb73b4..dd0cbc6d2f 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3606,8 +3606,10 @@ Session::create_midi_source_by_stealing_name (boost::shared_ptr<Track> track) /* MIDI files are small, just put them in the first location of the session source search path. */ + vector<string> dirs; - const string path = Glib::build_filename (source_search_path (DataType::MIDI).front(), name); + split (source_search_path(DataType::MIDI), dirs, ':'); + const string path = Glib::build_filename (dirs.front(), name); return boost::dynamic_pointer_cast<SMFSource> ( SourceFactory::createWritable ( diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index caaa71d39d..e32c14acb3 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -153,7 +153,12 @@ SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist) path for MIDI files, which is assumed to be the correct "main" location. */ - std::vector<string> sdirs = s.source_search_path (DataType::MIDI); + std::vector<Glib::ustring> sdirs; + split (s.source_search_path (DataType::MIDI), sdirs, ':'); + if (sdirs.empty()) { + fatal << _("Empty MIDI source search path!") << endmsg; + /*NOTREACHED*/ + } _path = Glib::build_filename (sdirs.front(), _path); /* This might be important, too */ _file_is_new = true; |