From bdfd71602f7fb6b19985b457e9cd8e8ae5307ad7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 27 May 2012 18:22:45 +0000 Subject: [PATCH] add a fix for the one problem case from the last commit: region splitting, where we don't announce regions until the entire edit op is done, but for naming purpoes each new region created needs to be in the map. likely that i will commit a better, cleaner fix for this later git-svn-id: svn://localhost/ardour2/branches/3.0@12458 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 8 ++++++++ libs/ardour/ardour/region_factory.h | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 7f4c22616e..de24266374 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5916,6 +5916,10 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList plist.add (ARDOUR::Properties::layer, 0); boost::shared_ptr nr = RegionFactory::create (r->sources(), plist, false); + /* because we set annouce to false, manually add the new region to the + RegionFactory map + */ + RegionFactory::map_add (nr); pl->add_region (nr, r->position() + pos); @@ -5940,6 +5944,10 @@ Editor::split_region_at_points (boost::shared_ptr r, AnalysisFeatureList plist.add (ARDOUR::Properties::layer, 0); boost::shared_ptr nr = RegionFactory::create (r->sources(), plist, false); + /* because we set annouce to false, manually add the new region to the + RegionFactory map + */ + RegionFactory::map_add (nr); pl->add_region (nr, r->position() + pos); if (select_new) { diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 80584e6859..4ba261f80c 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -111,6 +111,13 @@ public: static void add_compound_association (boost::shared_ptr, boost::shared_ptr); + /* exposed because there may be cases where regions are created with + * announce=false but they still need to be in the map soon after + * creation. + */ + + static void map_add (boost::shared_ptr); + private: static void region_changed (PBD::PropertyChange const &, boost::weak_ptr); @@ -118,7 +125,6 @@ public: static Glib::StaticMutex region_map_lock; static RegionMap region_map; - static void map_add (boost::shared_ptr); static Glib::StaticMutex region_name_map_lock;