summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_audio_import.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-07-18 00:50:15 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-07-18 00:50:15 +0000
commit932cca703eafaaa50d7acf1bc25da487a7b3abba (patch)
tree1be21bf062d518b6f2d649cac79a204b3fc5a87c /gtk2_ardour/editor_audio_import.cc
parent9b7e3a892a23bb27a72b915ff3f3e7ac0fd20f0a (diff)
imported files retain BWF timestamp info (nick murtagh) ; logarithm plugin controls can be properly controlled by generic GUI (nick murtagh); properly delete AU plugin *and* GUI (fixes crashing bug for Carbon-GUI based AU's)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5374 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_audio_import.cc')
-rw-r--r--gtk2_ardour/editor_audio_import.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index 1b34d1e2a6..902093b342 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -683,8 +683,11 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
ustring region_name;
uint32_t input_chan = 0;
uint32_t output_chan = 0;
+ bool use_timestamp;
+
+ use_timestamp = (pos == -1);
- if (pos == -1) { // "use timestamp"
+ if (use_timestamp) {
if (sources[0]->natural_position() != 0) {
pos = sources[0]->natural_position();
} else {
@@ -697,10 +700,15 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
/* take all the sources we have and package them up as a region */
region_name = region_name_from_path (paths.front(), (sources.size() > 1), false);
-
- regions.push_back (boost::dynamic_pointer_cast<AudioRegion>
+ boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>
(RegionFactory::create (sources, 0, sources[0]->length(), region_name, 0,
- Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External))));
+ Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)));
+
+ if (use_timestamp) {
+ ar->special_set_position(sources[0]->natural_position());
+ }
+
+ regions.push_back (ar);
} else if (target_regions == -1 || target_regions > 1) {
@@ -718,11 +726,15 @@ Editor::add_sources (vector<Glib::ustring> paths, SourceList& sources, nframes64
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource> (*x);
region_name = region_name_from_path (afs->path(), false, true, sources.size(), n);
-
- regions.push_back (boost::dynamic_pointer_cast<AudioRegion>
+ boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>
(RegionFactory::create (just_one, 0, (*x)->length(), region_name, 0,
- Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External))));
+ Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)));
+
+ if (use_timestamp) {
+ ar->special_set_position((*x)->natural_position());
+ }
+ regions.push_back (ar);
}
}