fix API errors after cherry-picking empty MIDI file fixes from cairocanvas
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user