diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-21 19:02:20 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-21 19:02:20 +0000 |
commit | 88acb20c73c1818705d49add9d330f4df683999c (patch) | |
tree | 0027917f65aaa502377786a5a232a00dc47ebf7b | |
parent | afa29d319007ce20bd1546c343e9277c58c80c1a (diff) |
minor tweaks to get region names right for imports
git-svn-id: svn://localhost/ardour2/trunk@1242 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/import.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 015b34c1b4..e6be0f4fc2 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -215,8 +215,13 @@ Session::import_audiofile (import_status& status) sources.push_back(newfiles[n]); } - boost::shared_ptr<AudioRegion> r (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (sources, 0, newfiles[0]->length(), region_name_from_path (basepath, true), - 0, AudioRegion::Flag (AudioRegion::DefaultFlags | AudioRegion::WholeFile)))); + bool strip_paired_suffixes = (newfiles.size() > 1); + + boost::shared_ptr<AudioRegion> r (boost::dynamic_pointer_cast<AudioRegion> + (RegionFactory::create (sources, 0, + newfiles[0]->length(), + region_name_from_path (basepath, strip_paired_suffixes), + 0, AudioRegion::Flag (AudioRegion::DefaultFlags | AudioRegion::WholeFile)))); status.new_regions.push_back (r); @@ -229,11 +234,14 @@ Session::import_audiofile (import_status& status) /* The sources had zero-length when created, which means that the Session did not bother to create whole-file AudioRegions for them. Do it now. + + Note: leave any trailing paired indicators from the file names as part + of the region name. */ status.new_regions.push_back (boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (boost::static_pointer_cast<Source> (newfiles[n]), 0, newfiles[n]->length(), - region_name_from_path (newfiles[n]->name(), true), + region_name_from_path (newfiles[n]->name(), false), 0, AudioRegion::Flag (AudioRegion::DefaultFlags | AudioRegion::WholeFile | AudioRegion::Import)))); } } |