fix invalid mapping detection
[ardour.git] / libs / ardour / import.cc
index 3ed028ef918d2a09719a8953993d5cacb7efc550..0656cdca6fd1ce32466dc6d3e5cbb58d18364d03 100644 (file)
@@ -34,7 +34,7 @@
 #include <sndfile.h>
 #include <samplerate.h>
 
-#include <glib/gstdio.h>
+#include "pbd/gstdio_compat.h"
 #include <glibmm.h>
 
 #include <boost/scoped_array.hpp>
@@ -417,14 +417,14 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status,
                                        break;
                                }
                        } else {
-                               info << string_compose (_("Track %1 of %2 contained no usable MIDI data"), i, source->file_path()) << endmsg;
+                               info << string_compose (_("Track %1 of %2 contained no usable MIDI data"), i, source->num_tracks()) << endmsg;
                        }
 
                        ++s; // next source
                }
 
-       } catch (...) {
-               error << string_compose (_("MIDI file %1 was not readable (no reason available)"), source->file_path()) << endmsg;
+       } catch (exception& e) {
+               error << string_compose (_("MIDI file could not be written (best guess: %1)"), e.what()) << endmsg;
        }
 
        if (buf) {
@@ -488,7 +488,7 @@ Session::import_files (ImportStatus& status)
                                return;
                        }
                }
-               
+
                if (channels == 0) {
                        error << _("Import: file contains no channels.") << endmsg;
                        continue;
@@ -553,7 +553,7 @@ Session::import_files (ImportStatus& status)
                                        Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
                                }
                        }
-                       
+
                        /* imported, copied files cannot be written or removed
                         */
 
@@ -591,7 +591,7 @@ Session::import_files (ImportStatus& status)
                } catch (...) {
                        error << _("Failed to remove some files after failed/cancelled import operation") << endmsg;
                }
-                               
+
        }
 
        status.done = true;