triggerUI: somewhat functioning inline trigger box UI

This commit is contained in:
Paul Davis 2021-10-03 12:29:26 -06:00
parent 7d0c67e376
commit bfc3c51052
4 changed files with 34 additions and 25 deletions

View File

@ -2099,6 +2099,14 @@ MixerStrip::hide_master_spacer (bool yn)
}
}
void
MixerStrip::create_trigger_display (boost::shared_ptr<TriggerBox> tb)
{
if (!trigger_display) {
trigger_display = new TriggerBoxWidget (*(tb.get())); /* XXX fix to use shared ptr */
}
}
void
MixerStrip::toggle_trigger_display ()
{
@ -2108,11 +2116,9 @@ MixerStrip::toggle_trigger_display ()
if (trigger_display->get_parent() == &global_vpacker) {
global_vpacker.remove (*trigger_display);
global_vpacker.pack_start (processor_box, true, true);
global_vpacker.reorder_child (processor_box, 4);
} else {
global_vpacker.remove (processor_box);
global_vpacker.pack_start (*trigger_display, true, true);
trigger_display->show ();
global_vpacker.reorder_child (*trigger_display, 4);
}
}

View File

@ -70,6 +70,7 @@ namespace ARDOUR {
class PortInsert;
class Bundle;
class Plugin;
class TriggerBox;
}
namespace Gtk {
class Window;
@ -153,6 +154,7 @@ public:
void set_selected (bool yn);
void toggle_trigger_display ();
void create_trigger_display (boost::shared_ptr<ARDOUR::TriggerBox>);
static MixerStrip* entered_mixer_strip() { return _entered_mixer_strip; }

View File

@ -3808,7 +3808,7 @@ ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor, bool us
boost::shared_ptr<Return> retrn;
boost::shared_ptr<PluginInsert> plugin_insert;
boost::shared_ptr<PortInsert> port_insert;
boost::shared_ptr<TriggerBox> triggerbox;
#ifdef HAVE_BEATBOX
boost::shared_ptr<BeatBox> beatbox;
#endif
@ -3897,26 +3897,6 @@ ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor, bool us
gidget = plugin_ui;
} else if ((triggerbox = boost::dynamic_pointer_cast<TriggerBox> (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<TriggerBoxWindow *> (w);
}
gidget = tw;
} else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (processor)) != 0) {
if (!ARDOUR_UI_UTILS::engine_is_running ()) {
@ -4311,6 +4291,23 @@ ProcessorBox::edit_aux_send (boost::shared_ptr<Processor> processor)
return true;
}
bool
ProcessorBox::edit_triggerbox (boost::shared_ptr<Processor> processor)
{
boost::shared_ptr<TriggerBox> tb;
if ((tb = boost::dynamic_pointer_cast<TriggerBox> (processor)) == 0) {
return false;
}
if (_parent_strip) {
_parent_strip->create_trigger_display (tb);
_parent_strip->toggle_trigger_display ();
}
return true;
}
void
ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
{
@ -4320,6 +4317,9 @@ ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
if (edit_aux_send (processor)) {
return;
}
if (edit_triggerbox (processor)) {
return;
}
if (!ARDOUR_UI_UTILS::engine_is_running ()) {
return;
}

View File

@ -438,7 +438,8 @@ public:
void hide_things ();
bool edit_aux_send(boost::shared_ptr<ARDOUR::Processor>);
bool edit_aux_send (boost::shared_ptr<ARDOUR::Processor>);
bool edit_triggerbox (boost::shared_ptr<ARDOUR::Processor>);
/* Everything except a WindowProxy object should use this to get the window */
Gtk::Window* get_processor_ui (boost::shared_ptr<ARDOUR::Processor>) const;