Properly create new presets, i.e. without duplicate id's on save-after-rename
[ardour.git] / libs / ardour / filter.cc
index 2ff93316f316392880f9c605d373d30fe9bf8523..c82f6ae4d6d4a438313892fcac4780dd8899332e 100644 (file)
@@ -70,7 +70,7 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
                try {
                        nsrcs.push_back (boost::dynamic_pointer_cast<Source> (
                                SourceFactory::createWritable (region->data_type(), session,
-                                                              path, false, session.frame_rate())));
+                                                              path, string(), false, session.frame_rate())));
                }
 
                catch (failed_constructor& err) {
@@ -116,7 +116,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
        /* create a new region */
 
        if (region_name.empty()) {
-               region_name = session.new_region_name (region->name());
+               region_name = RegionFactory::new_region_name (region->name());
        }
        results.clear ();
 
@@ -138,6 +138,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
                audio_r->set_fade_in (audio_region->fade_in ());
                audio_r->set_fade_out_active (audio_region->fade_out_active ());
                audio_r->set_fade_out (audio_region->fade_out ());
+               *(audio_r->envelope()) = *(audio_region->envelope ());
        }
        results.push_back (r);