+boost::shared_ptr<Region>
+RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs,
+ const std::string& name, layer_t layer, Region::Flag flags, bool announce)
+
+{
+ boost::shared_ptr<const AudioRegion> other;
+
+ /* used by AudioFilter when constructing a new region that is intended to have nearly
+ identical settings to an original, but using different sources.
+ */
+
+ if ((other = boost::dynamic_pointer_cast<AudioRegion>(region)) != 0) {
+ AudioRegion* ar = new AudioRegion (other, srcs, srcs.front()->length(srcs.front()->timeline_position()), name, layer, flags);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
+ boost::shared_ptr<AudioRegion> arp (ar);
+ boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (arp));
+ ret->unlock_property_changes ();
+ if (announce) {
+ CheckNewRegion (ret);
+ }
+ return ret;
+ } else {
+ fatal << _("programming error: RegionFactory::create() called with unknown Region type")
+ << endmsg;
+ /*NOTREACHED*/
+ return boost::shared_ptr<Region>();
+ }
+}
+