13
0

Fix region gain for various edit operations

When deriving regions (split, cut), the Region Gain curve
must not be inherited as-is.

See also 8b0ab38675 and e40f58c106
This commit is contained in:
Robin Gareus 2022-11-03 21:22:32 +01:00
parent 2b0e6ec476
commit 7b86ef8eff
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 7 additions and 3 deletions

View File

@ -107,7 +107,7 @@ public:
/** Note: changing the name of a Region does not constitute an edit */
bool set_name (const std::string& str);
PBD::PropertyList derive_properties (bool with_times = true) const;
PBD::PropertyList derive_properties (bool with_times = true, bool with_envelope = false) const;
const DataType& data_type () const { return _type; }
Temporal::TimeDomain time_domain() const;

View File

@ -133,7 +133,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
}
results.clear ();
PropertyList plist (region->derive_properties ());
PropertyList plist (region->derive_properties (true, false));
plist.add (Properties::start, std::numeric_limits<timepos_t>::min());
plist.add (Properties::name, region_name);

View File

@ -33,6 +33,7 @@
#include "pbd/types_convert.h"
#include "pbd/xml++.h"
#include "ardour/audioregion.h"
#include "ardour/debug.h"
#include "ardour/filter.h"
#include "ardour/playlist.h"
@ -1430,7 +1431,7 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
}
PropertyList
Region::derive_properties (bool with_times) const
Region::derive_properties (bool with_times, bool with_envelope) const
{
PropertyList plist (properties ());
plist.remove (Properties::automatic);
@ -1438,6 +1439,9 @@ Region::derive_properties (bool with_times) const
plist.remove (Properties::left_of_split);
plist.remove (Properties::valid_transients);
plist.remove (Properties::whole_file);
if (!with_envelope) {
plist.remove (Properties::envelope);
}
if (!with_times) {
plist.remove (Properties::start);
plist.remove (Properties::length);