summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-18 23:42:54 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-18 23:42:54 +0000
commit508b5fa34126bc144e263da52f8bb7fcbdb42f4a (patch)
tree19793a8d33d6ea3b10a5beaa2d3eb6fc66543ae6
parentd4a4dc20ab7e4a424e9c8783cb4745fce3f6a937 (diff)
Disallow import-without-copy for MIDI files (#4148).
git-svn-id: svn://localhost/ardour2/branches/3.0@12774 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/sfdb_ui.cc13
1 files 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<string>::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;