From 3e04e30e9ee8ad4d4c71183a351063d5d2ea145a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 1 May 2021 14:36:51 +0200 Subject: [PATCH] Allow to create regions from sources with signals suspended See also 65cc9264c802e15043c8f59c05c34941f8ff31bf --- libs/ardour/ardour/region_factory.h | 6 +++--- libs/ardour/region_factory.cc | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index f0bb5fa1ad..359edc4808 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -73,11 +73,11 @@ public: /** create a region from a single Source */ static boost::shared_ptr create (boost::shared_ptr, - const PBD::PropertyList&, bool announce = true); + const PBD::PropertyList&, bool announce = true, ThawList* tl = 0); /** create a region from a multiple sources */ static boost::shared_ptr create (const SourceList &, - const PBD::PropertyList&, bool announce = true); + const PBD::PropertyList&, bool announce = true, ThawList* tl = 0); /** 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, ThawList* tl = 0); @@ -86,7 +86,7 @@ public: const PBD::PropertyList&, bool announce = true, ThawList* tl = 0); /** 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); + const PBD::PropertyList&, bool announce = true, ThawList* tl = 0); /** create a region with no sources, using XML state */ static boost::shared_ptr create (Session&, XMLNode&, bool); diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 371b1d8266..8e0828868e 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -196,7 +196,7 @@ RegionFactory::create (boost::shared_ptr region, MusicSample offset, con } boost::shared_ptr -RegionFactory::create (boost::shared_ptr region, const SourceList& srcs, const PropertyList& plist, bool announce) +RegionFactory::create (boost::shared_ptr region, const SourceList& srcs, const PropertyList& plist, bool announce, ThawList* tl) { boost::shared_ptr ret; boost::shared_ptr other; @@ -218,6 +218,11 @@ RegionFactory::create (boost::shared_ptr region, const SourceList& srcs, } if (ret) { + if (tl) { + ret->suspend_property_changes (); + tl->add (ret); + } + ret->apply_changes (plist); if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) { @@ -235,15 +240,15 @@ RegionFactory::create (boost::shared_ptr region, const SourceList& srcs, } boost::shared_ptr -RegionFactory::create (boost::shared_ptr src, const PropertyList& plist, bool announce) +RegionFactory::create (boost::shared_ptr src, const PropertyList& plist, bool announce, ThawList* tl) { SourceList srcs; srcs.push_back (src); - return create (srcs, plist, announce); + return create (srcs, plist, announce, tl); } boost::shared_ptr -RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool announce) +RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool announce, ThawList* tl) { boost::shared_ptr ret; boost::shared_ptr as; @@ -260,6 +265,11 @@ RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool a } if (ret) { + if (tl) { + ret->suspend_property_changes (); + tl->add (ret); + } + ret->apply_changes (plist); if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {