+ /** create a region with specified sources @param srcs and XML state */
+ static boost::shared_ptr<Region> create (SourceList& srcs, const XMLNode&);
+
+ static void get_regions_using_source (boost::shared_ptr<Source>, std::set<boost::shared_ptr<Region> >& );
+ static void remove_regions_using_source (boost::shared_ptr<Source>);
+
+ static void map_remove (boost::weak_ptr<Region>);
+ static void delete_all_regions ();
+ static const RegionMap& regions() { return region_map; }
+ static uint32_t nregions ();
+
+ static int region_name (std::string &, std::string, bool new_level = false);
+ static std::string new_region_name (std::string);
+ static std::string compound_region_name (const std::string& playlist, uint32_t compound_ops, uint32_t depth, bool whole_source);
+
+ /* when we make a compound region, for every region involved there
+ * are two "instances" - the original, which is removed from this
+ * playlist, and a copy, which is added to the playlist used as
+ * the source for the compound.
+ *
+ * when we uncombine, we want to put the originals back into this
+ * playlist after we remove the compound. this map lets us
+ * look them up easily. note that if the compound was trimmed or
+ * split, we may have to trim the originals
+ * and they may not be added back if the compound was trimmed
+ * or split sufficiently.
+ */
+
+ typedef std::map<boost::shared_ptr<Region>, boost::shared_ptr<Region> > CompoundAssociations;
+ static CompoundAssociations& compound_associations() { return _compound_associations; }
+
+ static void add_compound_association (boost::shared_ptr<Region>, boost::shared_ptr<Region>);
+
+ /* 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<Region>);
+
+ private:
+ friend class ::RegionNamingTest;
+
+ static void region_changed (PBD::PropertyChange const &, boost::weak_ptr<Region>);
+
+ static Glib::Threads::Mutex region_map_lock;
+
+ static RegionMap region_map;
+
+ static Glib::Threads::Mutex 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;