Don't strip suffixes twice from peakfile names, otherwise source names like fred...
[ardour.git] / libs / ardour / region_factory.cc
index b4beddfb640610a2709891373736a8885e78aa5b..44615e2182be9adba6aa9c2cf9046c5f564a0047 100644 (file)
@@ -17,7 +17,6 @@
 
 */
 
-#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
 #include "pbd/error.h"
@@ -46,7 +45,7 @@ Glib::StaticMutex RegionFactory::region_name_map_lock;
 std::map<std::string, uint32_t> RegionFactory::region_name_map;
 
 boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<const Region> region)
+RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
 {
        boost::shared_ptr<Region> ret;
        boost::shared_ptr<const AudioRegion> ar;
@@ -73,12 +72,17 @@ RegionFactory::create (boost::shared_ptr<const Region> region)
        }
 
        if (ret) {
+               ret->set_name (new_region_name(ret->name()));
                map_add (ret);
 
                /* pure copy constructor - no property list */
                /* pure copy constructor - no CheckNewRegion emitted */
+               if (announce) {
+                       CheckNewRegion (ret);
+               }
        }
 
+
        return ret;
 }
 
@@ -123,7 +127,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, b
        }
 
        if (ret) {
-               ret->set_properties (plist);
+               ret->apply_changes (plist);
                map_add (ret);
 
                if (announce) {
@@ -162,7 +166,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs,
 
        if (ret) {
 
-               ret->set_properties (plist);
+               ret->apply_changes (plist);
                map_add (ret);
 
                if (announce) {
@@ -207,7 +211,7 @@ RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool a
 
        if (ret) {
 
-               ret->set_properties (plist);
+               ret->apply_changes (plist);
                map_add (ret);
 
                if (announce) {