- if (init (_path, true)) {
- throw failed_constructor ();
+ /* we expect the file to exist, but if no MIDI data was ever added
+ it will have been removed at last session close. so, we don't
+ require it to exist if it was marked Empty.
+ */
+
+ try {
+
+ if (init (_path, true)) {
+ throw failed_constructor ();
+ }
+
+ } catch (MissingSource& err) {
+
+ if (_flags & Source::Empty) {
+ /* we don't care that the file was not found, because
+ it was empty. But FileSource::init() will have
+ failed to set our _path correctly, so we have to do
+ this ourselves. Use the first entry in the search
+ path for MIDI files, which is assumed to be the
+ correct "main" location.
+ */
+ std::vector<string> sdirs = s.source_search_path (DataType::MIDI);
+ _path = Glib::build_filename (sdirs.front(), _path);
+ /* This might be important, too */
+ _file_is_new = true;
+ } else {
+ /* pass it on */
+ throw;
+ }