if a (file) source really cannot be found, differentiate between audio & MIDI.
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 15 Sep 2014 18:09:01 +0000 (14:09 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 15 Sep 2014 18:09:12 +0000 (14:09 -0400)
For now, recovering from missing MIDI is a no-can-do situation (because MIDI is inherently data-editable).

libs/ardour/session_state.cc

index 96f0e5519997335a4cb61bb96bace55c3fb4c2e5..b4dce433272770402b45166dbf9e53bea03bf7ba 100644 (file)
@@ -1907,8 +1907,19 @@ Session::load_sources (const XMLNode& node)
 
                         case -1:
                         default:
-                                warning << _("A sound file is missing. It will be replaced by silence.") << endmsg;
-                                source = SourceFactory::createSilent (*this, **niter, max_framecnt, _current_frame_rate);
+                               switch (err.type) {
+
+                               case DataType::AUDIO:
+                                       warning << _("A sound file is missing. It will be replaced by silence.") << endmsg;
+                                       source = SourceFactory::createSilent (*this, **niter, max_framecnt, _current_frame_rate);
+                                       break;
+
+                               case DataType::MIDI:
+                                       warning << string_compose (_("A MIDI file is missing. %1 cannot currently recover from missing MIDI files"),
+                                                                    PROGRAM_NAME) << endmsg;
+                                       return -1;
+                                       break;
+                               }
                                 break;
                         }
                }