From c765079b2f7c5e369875c9f714f078dc0c16af90 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 23 Mar 2020 15:13:39 -0500 Subject: Show Sends button should instigate a Spill, akin to a VCA spill --- gtk2_ardour/foldback_strip.cc | 6 ++++-- gtk2_ardour/mixer_strip.cc | 6 +++--- gtk2_ardour/mixer_ui.cc | 49 +++++++++++++++++++++++++++++++------------ gtk2_ardour/mixer_ui.h | 2 +- gtk2_ardour/route_ui.cc | 5 ++++- 5 files changed, 48 insertions(+), 20 deletions(-) diff --git a/gtk2_ardour/foldback_strip.cc b/gtk2_ardour/foldback_strip.cc index 4abb03aaa8..055f57b5df 100644 --- a/gtk2_ardour/foldback_strip.cc +++ b/gtk2_ardour/foldback_strip.cc @@ -346,7 +346,7 @@ FoldbackStrip::init () _show_sends_button.set_name ("send alert button"); _show_sends_button.set_text (_("Show Sends")); - UI::instance()->set_tip (&_show_sends_button, _("make mixer strips show sends to this bus"), ""); + UI::instance()->set_tip (&_show_sends_button, _("Show the strips that send to this bus, and control them from the faders"), ""); send_display.set_flags (CAN_FOCUS); send_display.set_spacing (4); @@ -404,8 +404,8 @@ FoldbackStrip::init () // or hides. global_vpacker.pack_start (prev_next_box, Gtk::PACK_SHRINK); global_vpacker.pack_start (name_button, Gtk::PACK_SHRINK); - global_vpacker.pack_start (_invert_button_box, Gtk::PACK_SHRINK); global_vpacker.pack_start (_show_sends_button, Gtk::PACK_SHRINK); + global_vpacker.pack_start (_invert_button_box, Gtk::PACK_SHRINK); global_vpacker.pack_start (send_scroller, true, true); #ifndef MIXBUS //add a spacer underneath the foldback bus; @@ -1283,11 +1283,13 @@ void FoldbackStrip::show_sends_clicked () { if (_showing_sends) { + Mixer_UI::instance()->show_spill (boost::shared_ptr()); BusSendDisplayChanged (boost::shared_ptr ()); /* EMIT SIGNAL */ _showing_sends = false; _show_sends_button.set_active (false); send_blink_connection.disconnect (); } else { + Mixer_UI::instance()->show_spill (_route); BusSendDisplayChanged (_route); /* EMIT SIGNAL */ _showing_sends = true; _show_sends_button.set_active (true); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index ba7f6e0942..b35a2b412e 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -662,7 +662,7 @@ MixerStrip::set_route (boost::shared_ptr rt) /* non-master bus */ if (!_route->is_master()) { - rec_mon_table.attach (*show_sends_button, 0, 1, 0, 2); + rec_mon_table.attach (*show_sends_button, 0, 3, 0, 2); show_sends_button->show(); } } @@ -787,7 +787,7 @@ MixerStrip::set_width_enum (Width w, void* owner) case Wide: if (show_sends_button) { - show_sends_button->set_text (_("Aux")); + show_sends_button->set_text (_("Show Sends")); } { @@ -801,7 +801,7 @@ MixerStrip::set_width_enum (Width w, void* owner) case Narrow: if (show_sends_button) { - show_sends_button->set_text (_("Snd")); + show_sends_button->set_text (_("Show")); } gain_meter().setup_meters (); // recalc meter width diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index e568a58623..6eb5095016 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1441,17 +1441,24 @@ Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&) } void -Mixer_UI::spill_redisplay (boost::shared_ptr vca) +Mixer_UI::spill_redisplay (boost::shared_ptr s) { + + boost::shared_ptr vca = boost::dynamic_pointer_cast (s); + boost::shared_ptr r = boost::dynamic_pointer_cast (s); + TreeModel::Children rows = track_model->children(); std::list > vcas; - vcas.push_back (vca); - for (TreeModel::Children::const_iterator i = rows.begin(); i != rows.end(); ++i) { - AxisView* av = (*i)[stripable_columns.strip]; - VCAMasterStrip* vms = dynamic_cast (av); - if (vms && vms->vca()->slaved_to (vca)) { - vcas.push_back (vms->vca()); + if (vca) { + vcas.push_back (vca); + + for (TreeModel::Children::const_iterator i = rows.begin(); i != rows.end(); ++i) { + AxisView* av = (*i)[stripable_columns.strip]; + VCAMasterStrip* vms = dynamic_cast (av); + if (vms && vms->vca()->slaved_to (vca)) { + vcas.push_back (vms->vca()); + } } } @@ -1460,6 +1467,8 @@ Mixer_UI::spill_redisplay (boost::shared_ptr vca) AxisView* av = (*i)[stripable_columns.strip]; MixerStrip* strip = dynamic_cast (av); bool const visible = (*i)[stripable_columns.visible]; + bool slaved = false; + bool feeds = false; if (!strip) { /* we're in the middle of changing a row, don't worry */ @@ -1475,15 +1484,23 @@ Mixer_UI::spill_redisplay (boost::shared_ptr vca) continue; } - bool slaved = false; - for (std::list >::const_iterator m = vcas.begin(); m != vcas.end(); ++m) { - if (strip->route()->slaved_to (*m)) { - slaved = true; - break; + if (vca) { + for (std::list >::const_iterator m = vcas.begin(); m != vcas.end(); ++m) { + if (strip->route()->slaved_to (*m)) { + slaved = true; + break; + } } } - if (slaved && visible) { + if (r) { + feeds = strip->route()->feeds (r); + } + + bool should_show = visible && (slaved || feeds); + should_show |= (strip->route() == r); //the spilled aux should itself be shown... + + if (should_show) { if (strip->packed()) { strip_packer.reorder_child (*strip, -1); /* put at end */ @@ -1518,6 +1535,12 @@ Mixer_UI::redisplay_track_list () } spill_redisplay (sv); return; + } else { + if (_spill_scroll_position <= 0 && scroller.get_hscrollbar()) { + _spill_scroll_position = scroller.get_hscrollbar()->get_adjustment()->get_value(); + } + spill_redisplay (ss); + return; } } diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index 7adc79d99e..7fb0c1f10c 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -246,7 +246,7 @@ private: void track_name_changed (MixerStrip *); void redisplay_track_list (); - void spill_redisplay (boost::shared_ptr); + void spill_redisplay (boost::shared_ptr); bool no_track_list_redisplay; bool track_display_button_press (GdkEventButton*); void strip_width_changed (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 2110c2ff17..3ed8335cee 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -77,6 +77,7 @@ #include "keyboard.h" #include "latency_gui.h" #include "mixer_strip.h" +#include "mixer_ui.h" #include "patch_change_widget.h" #include "plugin_pin_dialog.h" #include "rgb_macros.h" @@ -205,7 +206,7 @@ RouteUI::init () show_sends_button = manage (new ArdourButton); show_sends_button->set_name ("send alert button"); - UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), ""); + UI::instance()->set_tip (show_sends_button, _("Show the strips that send to this bus, and control them from the faders"), ""); monitor_input_button = new ArdourButton (ArdourButton::default_elements); monitor_input_button->set_name ("monitor button"); @@ -1152,8 +1153,10 @@ RouteUI::show_sends_press(GdkEventButton* ev) if (s == _route) { set_showing_sends_to (boost::shared_ptr ()); + Mixer_UI::instance()->show_spill (boost::shared_ptr()); } else { set_showing_sends_to (_route); + Mixer_UI::instance()->show_spill (_route); } } } -- cgit v1.2.3