+
+ /* make a new whole-file region that copies almost everything from the old one, but
+ uses the new sources (and new length and name)
+ */
+
+ boost::shared_ptr<AudioRegion> ar;
+ boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource>(nsrcs.front());
+
+ string whole_file_region_name = region_name_from_path (afs->path(), true);
+
+ ar = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create
+ (nsrcs, 0, nsrcs.front()->length(), whole_file_region_name, 0,
+ Region::Flag (Region::WholeFile|Region::DefaultFlags)));
+
+ /* now make a copy of the region that copies almost everything from the old one, but
+ uses the new sources (and new length and name)
+ */
+