From 78d8a2448d51d6bee47c2d216957203454c42cda Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 31 Aug 2021 22:33:47 -0600 Subject: [PATCH] allow editing of triggerbox processor --- gtk2_ardour/processor_box.cc | 41 ++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index aad13868bb..7a78e342b0 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -98,6 +98,7 @@ #include "script_selector.h" #include "send_ui.h" #include "timers.h" +#include "triggerbox_ui.h" #include "new_plugin_preset_dialog.h" #include "pbd/i18n.h" @@ -2926,19 +2927,18 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr w) if (boost::dynamic_pointer_cast (p)) { have_ui = true; - } - else if (boost::dynamic_pointer_cast (p)) { + } else if (boost::dynamic_pointer_cast (p)) { have_ui = true; - } - else if (boost::dynamic_pointer_cast (p)) { + } else if (boost::dynamic_pointer_cast (p)) { if (!boost::dynamic_pointer_cast (p)) { have_ui = true; } - } - else if (boost::dynamic_pointer_cast (p)) { + } else if (boost::dynamic_pointer_cast (p)) { if (!boost::dynamic_pointer_cast (p)) { have_ui = true; } + } else if (boost::dynamic_pointer_cast (p)) { + have_ui = true; } #ifdef HAVE_BEATBOX else if (boost::dynamic_pointer_cast (p)) { @@ -3014,6 +3014,7 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) boost::shared_ptr send = boost::dynamic_pointer_cast (processor); boost::shared_ptr ext = boost::dynamic_pointer_cast (processor); + boost::shared_ptr tb = boost::dynamic_pointer_cast (processor); #ifdef HAVE_BEATBOX boost::shared_ptr bb = boost::dynamic_pointer_cast (processor); #endif @@ -3022,9 +3023,9 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr p) //faders and meters are not deletable, copy/paste-able, so they shouldn't be selectable #ifdef HAVE_BEATBOX - if (!send && !plugin_insert && !ext && !stub && !bb) { + if (!send && !plugin_insert && !ext && !stub && !bb && !tb) { #else - if (!send && !plugin_insert && !ext && !stub) { + if (!send && !plugin_insert && !ext && !stub && !tb) { #endif e->set_selectable(false); } @@ -3787,7 +3788,8 @@ ProcessorBox::processor_can_be_edited (boost::shared_ptr processor) if (boost::dynamic_pointer_cast (processor) || boost::dynamic_pointer_cast (processor) || boost::dynamic_pointer_cast (processor) || - boost::dynamic_pointer_cast (processor) + boost::dynamic_pointer_cast (processor) || + boost::dynamic_pointer_cast (processor) #ifdef HAVE_BEATBOX || boost::dynamic_pointer_cast (processor) #endif @@ -3818,6 +3820,7 @@ ProcessorBox::get_editor_window (boost::shared_ptr processor, bool us boost::shared_ptr retrn; boost::shared_ptr plugin_insert; boost::shared_ptr port_insert; + boost::shared_ptr triggerbox; #ifdef HAVE_BEATBOX boost::shared_ptr beatbox; #endif @@ -3906,6 +3909,26 @@ ProcessorBox::get_editor_window (boost::shared_ptr processor, bool us gidget = plugin_ui; + } else if ((triggerbox = boost::dynamic_pointer_cast (processor)) != 0) { + + if (!ARDOUR_UI_UTILS::engine_is_running ()) { + return 0; + } + + TriggerBoxWindow* tw; + + Window* w = get_processor_ui (triggerbox); + + if (w == 0) { + tw = new TriggerBoxWindow (*(triggerbox.get())); /* XXX fix me to use shared ptr */ + set_processor_ui (triggerbox, tw); + + } else { + tw = dynamic_cast (w); + } + + gidget = tw; + } else if ((port_insert = boost::dynamic_pointer_cast (processor)) != 0) { if (!ARDOUR_UI_UTILS::engine_is_running ()) {