X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Fardour%2Fregion_factory.h;h=a3f61f88197528965eabc6c9fe0d44598f185b6e;hb=a855119bdd94aad90f4cfec3066a367b0675a8e9;hp=a9b73dc46260c27d1c47daa531a27a1b27a26f03;hpb=b0e4f81eb3a38b7236ec39f11d5211840a064d15;p=ardour.git diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index a9b73dc462..a3f61f8819 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -1,21 +1,25 @@ /* - Copyright (C) 2000-2007 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ + * Copyright (C) 2000-2017 Paul Davis + * Copyright (C) 2006-2012 David Robillard + * Copyright (C) 2009-2012 Carl Hetherington + * Copyright (C) 2015-2017 Robin Gareus + * Copyright (C) 2016-2017 Nick Mainsbridge + * Copyright (C) 2018-2019 Ben Loftis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #ifndef __ardour_region_factory_h__ #define __ardour_region_factory_h__ @@ -58,8 +62,11 @@ public: */ static PBD::Signal1 > CheckNewRegion; - /** create a "pure copy" of Region @param other */ - static boost::shared_ptr create (boost::shared_ptr other, bool announce = false); + /** create a "pure copy" of Region \p other */ + static boost::shared_ptr create (boost::shared_ptr other, bool announce = false, bool fork = false); + static boost::shared_ptr create (boost::shared_ptr other, bool announce, bool fork) { + return create (boost::shared_ptr(other), announce, fork); + } /** create a region from a single Source */ static boost::shared_ptr create (boost::shared_ptr, @@ -68,21 +75,23 @@ public: /** create a region from a multiple sources */ static boost::shared_ptr create (const SourceList &, const PBD::PropertyList&, bool announce = true); - /** create a copy of @other starting at zero within @param other's sources */ + /** create a copy of \p other starting at zero within \p other's sources */ static boost::shared_ptr create (boost::shared_ptr other, const PBD::PropertyList&, bool announce = true); - /** create a copy of @param other starting at @param offset within @param other */ - static boost::shared_ptr create (boost::shared_ptr other, frameoffset_t offset, + /** create a copy of \p other starting at \p offset within \p other */ + static boost::shared_ptr create (boost::shared_ptr other, ARDOUR::MusicSample offset, const PBD::PropertyList&, bool announce = true); - /** create a "copy" of @param other but using a different set of sources @param srcs */ + /** create a "copy" of \p other but using a different set of sources \p srcs */ static boost::shared_ptr create (boost::shared_ptr other, const SourceList& srcs, const PBD::PropertyList&, bool announce = true); /** create a region with no sources, using XML state */ static boost::shared_ptr create (Session&, XMLNode&, bool); - /** create a region with specified sources @param srcs and XML state */ + /** create a region with specified sources \p srcs and XML state */ static boost::shared_ptr create (SourceList& srcs, const XMLNode&); + static boost::shared_ptr get_whole_region_for_source (boost::shared_ptr); + static void get_regions_using_source (boost::shared_ptr, std::set >& ); static void remove_regions_using_source (boost::shared_ptr); @@ -90,6 +99,15 @@ public: static void delete_all_regions (); static const RegionMap& regions() { return region_map; } static uint32_t nregions (); + + static void foreach_region (boost::function )> f) { + Glib::Threads::Mutex::Lock ls (region_map_lock); + for (RegionMap::const_iterator i = region_map.begin(); i != region_map.end(); ++i) { + f ( (*i).second ); + } + } + + static int region_name (std::string &, std::string, bool new_level = false); static std::string new_region_name (std::string); @@ -117,7 +135,7 @@ public: * announce=false but they still need to be in the map soon after * creation. */ - + static void map_add (boost::shared_ptr); private: