summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/region_factory.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-18 16:57:03 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-18 16:57:03 +0000
commit611936f3461005dcc89af2ad9e426d6d4aca3cf1 (patch)
tree232869133d7b7b4b8eca8168253244fe2426770a /libs/ardour/ardour/region_factory.h
parent20ceeb6d3ea5ed9caa78aaaa6fc88f5219e3886c (diff)
Use a map of region names to speed up
RegionFactory::new_region_name; should help with #2982. git-svn-id: svn://localhost/ardour2/branches/3.0@12753 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/region_factory.h')
-rw-r--r--libs/ardour/ardour/region_factory.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h
index 4ba261f80c..471f172440 100644
--- a/libs/ardour/ardour/region_factory.h
+++ b/libs/ardour/ardour/region_factory.h
@@ -31,6 +31,7 @@
#include "ardour/types.h"
class XMLNode;
+class RegionNamingTest;
namespace ARDOUR {
@@ -119,6 +120,7 @@ public:
static void map_add (boost::shared_ptr<Region>);
private:
+ friend class ::RegionNamingTest;
static void region_changed (PBD::PropertyChange const &, boost::weak_ptr<Region>);
@@ -126,10 +128,15 @@ public:
static RegionMap region_map;
- static Glib::StaticMutex region_name_map_lock;
-
- static std::map<std::string, uint32_t> region_name_map;
- static void update_region_name_map (boost::shared_ptr<Region>);
+ static Glib::StaticMutex region_name_maps_mutex;
+ /** map of partial region names and suffix numbers */
+ static std::map<std::string, uint32_t> region_name_number_map;
+ /** map of complete region names with their region ID */
+ static std::map<std::string, PBD::ID> region_name_map;
+ static void add_to_region_name_maps (boost::shared_ptr<Region>);
+ static void rename_in_region_name_maps (boost::shared_ptr<Region>);
+ static void update_region_name_number_map (boost::shared_ptr<Region>);
+ static void remove_from_region_name_map (std::string);
static PBD::ScopedConnectionList* region_list_connections;
static CompoundAssociations _compound_associations;