From 37d24eee7da6639ade50fbefe9f23b7419d4732c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 2 May 2024 22:50:56 +0200 Subject: [PATCH] Flush Audioregion local [fx] cache when changing region gain --- libs/ardour/ardour/audioregion.h | 1 + libs/ardour/ardour/region.h | 2 +- libs/ardour/audioregion.cc | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index c8e447218b..92a7b8b284 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -279,6 +279,7 @@ class LIBARDOUR_API AudioRegion : public Region, public AudioReadable bool _add_plugin (std::shared_ptr, std::shared_ptr, bool); int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal); + void send_change (const PBD::PropertyChange&); }; } /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 2f51aaf5d7..a66dc036f0 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -565,7 +565,7 @@ protected: virtual bool _add_plugin (std::shared_ptr, std::shared_ptr, bool) { return false; } virtual void fx_latency_changed (bool no_emit); - void send_change (const PBD::PropertyChange&); + virtual void send_change (const PBD::PropertyChange&); virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal); virtual void set_position_internal (timepos_t const & pos); virtual void set_length_internal (timecnt_t const &); diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 3f5aaa82b3..85be9e78f3 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -251,6 +251,27 @@ AudioRegion::init () _fx_latent_read = false; } +void +AudioRegion::send_change (const PropertyChange& what_changed) +{ + + PropertyChange our_interests; + + our_interests.add (Properties::fade_in_active); + our_interests.add (Properties::fade_out_active); + our_interests.add (Properties::scale_amplitude); + our_interests.add (Properties::envelope_active); + our_interests.add (Properties::envelope); + our_interests.add (Properties::fade_in); + our_interests.add (Properties::fade_out); + + if (what_changed.contains (our_interests)) { + _invalidated.exchange (true); + } + + Region::send_change (what_changed); +} + void AudioRegion::copy_plugin_state (std::shared_ptr other) {