Prepare to replace Signal RegionFxChanged with Property

Properties::region_fx may not be emitted for add/remove/reorder
cases when no disk-reader overrride is required.
However we need to inform the GUI when such changes happen,
and various UI widgets listen to property changes.
This commit is contained in:
Robin Gareus 2026-01-19 03:13:23 +01:00
parent c6e5521918
commit 5dccad42a2
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 9 additions and 0 deletions

View file

@ -79,6 +79,7 @@ namespace Properties {
LIBARDOUR_API extern PBD::PropertyDescriptor<uint64_t> reg_group;
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> contents; // type doesn't matter here, used for signal only
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_fx; // type doesn't matter here, used for signal only
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_fx_changed; // type doesn't matter here, used for signal only
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_tempo; // type doesn't matter here, used for signal only
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> region_meter; // type doesn't matter here, used for signal only
};

View file

@ -522,6 +522,7 @@ AudioRegion::set_fade_before_fx (bool yn)
if (!_invalidated.exchange (true)) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
}
send_change (PropertyChange (Properties::region_fx_changed)); /* EMIT SIGNAL */
RegionFxChanged (); /* EMIT SIGNAL */
}
}
@ -2591,6 +2592,7 @@ AudioRegion::_add_plugin (std::shared_ptr<RegionFxPlugin> rfx, std::shared_ptr<R
if (!_invalidated.exchange (true)) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
}
send_change (PropertyChange (Properties::region_fx_changed)); /* EMIT SIGNAL */
RegionFxChanged (); /* EMIT SIGNAL */
return true;
}
@ -2621,6 +2623,7 @@ AudioRegion::remove_plugin (std::shared_ptr<RegionFxPlugin> fx)
if (!_invalidated.exchange (true)) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
}
send_change (PropertyChange (Properties::region_fx_changed)); /* EMIT SIGNAL */
RegionFxChanged (); /* EMIT SIGNAL */
_session.set_dirty ();
return true;
@ -2633,6 +2636,7 @@ AudioRegion::reorder_plugins (RegionFxList const& new_order)
if (!_invalidated.exchange (true)) {
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
}
send_change (PropertyChange (Properties::region_fx_changed)); /* EMIT SIGNAL */
RegionFxChanged (); /* EMIT SIGNAL */
}

View file

@ -85,6 +85,7 @@ namespace ARDOUR {
PBD::PropertyDescriptor<uint64_t> reg_group;
PBD::PropertyDescriptor<bool> contents;
PBD::PropertyDescriptor<bool> region_fx;
PBD::PropertyDescriptor<bool> region_fx_changed;
PBD::PropertyDescriptor<bool> region_tempo;
PBD::PropertyDescriptor<bool> region_meter;
@ -191,6 +192,8 @@ Region::make_property_quarks ()
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for contents = %1\n", Properties::contents.property_id));
Properties::region_fx.property_id = g_quark_from_static_string (X_("region-fx"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for region-fx = %1\n", Properties::region_fx.property_id));
Properties::region_fx_changed.property_id = g_quark_from_static_string (X_("region-fx-changed"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for region-fx-changed = %1\n", Properties::region_fx_changed.property_id));
Properties::time_domain.property_id = g_quark_from_static_string (X_("time_domain"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for time_domain = %1\n", Properties::time_domain.property_id));
Properties::reg_group.property_id = g_quark_from_static_string (X_("rgroup"));
@ -1636,6 +1639,7 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
fx_latency_changed (true);
fx_tail_changed (true);
send_change (PropertyChange (Properties::region_fx)); // trigger DiskReader overwrite
send_change (PropertyChange (Properties::region_fx_changed));
RegionFxChanged (); /* EMIT SIGNAL */
}
}