From 508b5fa34126bc144e263da52f8bb7fcbdb42f4a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 18 Jun 2012 23:42:54 +0000 Subject: [PATCH] Disallow import-without-copy for MIDI files (#4148). git-svn-id: svn://localhost/ardour2/branches/3.0@12774 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/sfdb_ui.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index da39d45db6..3a0148469b 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -1028,7 +1028,7 @@ SoundFileOmega::reset_options () /* if we get through this function successfully, this may be reset at the end, once we know if we can use hard links - to do embedding + to do embedding (or if we are importing a MIDI file). */ if (Config->get_only_copy_imported_files()) { @@ -1044,6 +1044,13 @@ SoundFileOmega::reset_options () bool selection_can_be_embedded_with_links = check_link_status (_session, paths); ImportMode mode; + /* See if we are thinking about importing any MIDI files */ + vector::iterator i = paths.begin (); + while (i != paths.end() && SMFSource::safe_midi_file_extension (*i) == false) { + ++i; + } + bool const have_a_midi_file = (i != paths.end ()); + if (check_info (paths, same_size, src_needed, selection_includes_multichannel)) { Glib::signal_idle().connect (sigc::mem_fun (*this, &SoundFileOmega::bad_file_message)); return false; @@ -1196,7 +1203,7 @@ SoundFileOmega::reset_options () if (Config->get_only_copy_imported_files()) { - if (selection_can_be_embedded_with_links) { + if (selection_can_be_embedded_with_links && !have_a_midi_file) { copy_files_btn.set_sensitive (true); } else { copy_files_btn.set_sensitive (false); @@ -1204,7 +1211,7 @@ SoundFileOmega::reset_options () } else { - copy_files_btn.set_sensitive (true); + copy_files_btn.set_sensitive (!have_a_midi_file); } return true;