From 002eabc01f5741e3e1292444c7b294b49d0fbebc Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 19 Aug 2024 15:43:12 +0200 Subject: [PATCH] RegionFX: replay control automation (2/2) Trigger GUI updates when region-fx are automated --- gtk2_ardour/region_editor.cc | 16 ++++++++++++++++ gtk2_ardour/region_editor.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 081261e1d2..73572c8c0b 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -51,6 +51,7 @@ #include "new_plugin_preset_dialog.h" #include "region_editor.h" #include "region_view.h" +#include "timers.h" #include "plugin_selector.h" #include "plugin_window_proxy.h" #include "public_editor.h" @@ -552,6 +553,8 @@ RegionEditor::RegionFxBox::RegionFxBox (std::shared_ptr r) _display.signal_key_press_event ().connect (sigc::mem_fun (*this, &RegionFxBox::on_key_press), false); + screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun (*this, &RegionFxBox::update_controls)); + _scroller.show (); _display.show (); @@ -745,6 +748,19 @@ RegionEditor::RegionFxBox::on_key_press (GdkEventKey* ev) return true; } +void +RegionEditor::RegionFxBox::update_controls () +{ + for (auto const& i : _display.children ()) { + std::shared_ptr rfx = i->region_fx_plugin (); + PluginWindowProxy* pwp = dynamic_cast (rfx->window_proxy ()); + if (!pwp || !pwp->get (false) || !pwp->get (false)->is_mapped ()) { + continue; + } + rfx->maybe_emit_changed_signals (); + } +} + void RegionEditor::RegionFxBox::clear_automation (std::weak_ptr wfx) { diff --git a/gtk2_ardour/region_editor.h b/gtk2_ardour/region_editor.h index 35ea310db9..5bd365456e 100644 --- a/gtk2_ardour/region_editor.h +++ b/gtk2_ardour/region_editor.h @@ -109,6 +109,7 @@ private: void notify_plugin_load_fail (uint32_t cnt = 1); bool on_key_press (GdkEventKey*); void clear_automation (std::weak_ptr); + void update_controls (); /* PluginInterestedObject */ bool use_plugins (SelectedPlugins const&); @@ -130,6 +131,8 @@ private: Gtk::EventBox _base; bool _no_redisplay; int _placement; + + sigc::connection screen_update_connection; }; std::shared_ptr _region;