Merged with trunk R1141
[ardour.git] / gtk2_ardour / editor_audio_import.cc
index eb232ff8022bdaa5ca5dbadfa4eaddaa34e7a43e..426ff57a2a42d15d6977631ff428500c4e4d00aa 100644 (file)
@@ -270,7 +270,11 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
                idspec += string_compose(":%1", n);
                
                try {
-                       source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable (DataType::AUDIO, *session, idspec, (mode == ImportAsTrack ? AudioFileSource::Destructive : AudioFileSource::Flag (0))));
+                       source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable 
+                                                                              (DataType::AUDIO, *session, idspec, 
+                                                                               (mode == ImportAsTapeTrack ? 
+                                                                                AudioFileSource::Destructive : 
+                                                                                AudioFileSource::Flag (0))));
                        sources.push_back(source);
                } 
                
@@ -285,7 +289,11 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
        if (sources.empty()) {
                goto out;
        }
-       
+
+       if (sources[0]->natural_position() != 0) {
+               pos = sources[0]->natural_position();
+       } 
+
        region_name = PBD::basename_nosuffix (path);
        region_name += "-0";