diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2020-03-23 15:13:39 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2020-03-23 15:24:08 -0500 |
commit | c765079b2f7c5e369875c9f714f078dc0c16af90 (patch) | |
tree | b1d6fb5406b1a36b26e3594db227712242cc53f7 /gtk2_ardour/mixer_ui.cc | |
parent | 7058a8074fa7d8778e30ef2e0adbe5e69f179d63 (diff) |
Show Sends button should instigate a Spill, akin to a VCA spill
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 49 |
1 files changed, 36 insertions, 13 deletions
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> vca) +Mixer_UI::spill_redisplay (boost::shared_ptr<Stripable> s) { + + boost::shared_ptr<VCA> vca = boost::dynamic_pointer_cast<VCA> (s); + boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route> (s); + TreeModel::Children rows = track_model->children(); std::list<boost::shared_ptr<VCA> > 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<VCAMasterStrip*> (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<VCAMasterStrip*> (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> vca) AxisView* av = (*i)[stripable_columns.strip]; MixerStrip* strip = dynamic_cast<MixerStrip*> (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> vca) continue; } - bool slaved = false; - for (std::list<boost::shared_ptr<VCA> >::const_iterator m = vcas.begin(); m != vcas.end(); ++m) { - if (strip->route()->slaved_to (*m)) { - slaved = true; - break; + if (vca) { + for (std::list<boost::shared_ptr<VCA> >::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; } } |