13
0

notify control protocols about plugin selection in a processor box

This commit is contained in:
Paul Davis 2024-07-29 10:19:44 -06:00
parent 83984a7884
commit caa0cc8790
2 changed files with 19 additions and 1 deletions

View File

@ -77,6 +77,8 @@
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour/value_as_string.h" #include "ardour/value_as_string.h"
#include "control_protocol/control_protocol.h"
#include "LuaBridge/LuaBridge.h" #include "LuaBridge/LuaBridge.h"
#include "actions.h" #include "actions.h"
@ -1956,6 +1958,7 @@ ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelecto
*/ */
processor_display.set_data ("ardour-bindings", bindings); processor_display.set_data ("ardour-bindings", bindings);
processor_display.SelectionAdded.connect (sigc::mem_fun (*this, &ProcessorBox::selection_added));
_width = Wide; _width = Wide;
processor_menu = 0; processor_menu = 0;
@ -2714,7 +2717,6 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry*
ret = true; ret = true;
} else if (processor && ev->button == 1 && selected) { } else if (processor && ev->button == 1 && selected) {
// this is purely informational but necessary for route params UI // this is purely informational but necessary for route params UI
ProcessorSelected (processor); // emit ProcessorSelected (processor); // emit
@ -4957,3 +4959,17 @@ ProcessorBox::load_bindings ()
{ {
bindings = Bindings::get_bindings (X_("Processor Box")); bindings = Bindings::get_bindings (X_("Processor Box"));
} }
void
ProcessorBox::selection_added (ProcessorEntry& pe)
{
std::shared_ptr<Processor> proc = pe.processor ();
std::shared_ptr<PluginInsert> pi = std::dynamic_pointer_cast<PluginInsert> (proc);
if (pi) {
/* be explicit here about the fact that we're using a weak
pointer, even though we probably don't need to be.
*/
std::weak_ptr<PluginInsert> wpi;
ControlProtocol::PluginSelected (wpi);
}
}

View File

@ -653,6 +653,8 @@ private:
PBD::ScopedConnection amp_config_connection; PBD::ScopedConnection amp_config_connection;
static bool _ignore_rb_change; static bool _ignore_rb_change;
void selection_added (ProcessorEntry&);
}; };
#endif /* __ardour_gtk_processor_box__ */ #endif /* __ardour_gtk_processor_box__ */