From 69d2758e8c617b2d6da0e9b2729a7b46652496b1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 18 May 2016 17:36:06 -0400 Subject: actual implementation of VCA spill for mixer --- gtk2_ardour/mixer_ui.cc | 60 ++++++++++++++++++++++++++++++++++++++++++++++--- gtk2_ardour/mixer_ui.h | 1 + 2 files changed, 58 insertions(+), 3 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 0c70668d51..39158f6779 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1152,16 +1152,69 @@ Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&) } void -Mixer_UI::redisplay_track_list () +Mixer_UI::spill_redisplay (boost::shared_ptr vca) { TreeModel::Children rows = track_model->children(); - TreeModel::Children::iterator i; - uint32_t n_masters = 0; + for (TreeModel::Children::iterator i = rows.begin(); i != rows.end(); ++i) { + + MixerStrip* strip = (*i)[track_columns.strip]; + + if (!strip) { + /* we're in the middle of changing a row, don't worry */ + continue; + } + + if (!strip->route()) { + /* non-route element */ + continue; + } + + if (strip->route()->is_master() || strip->route()->is_monitor()) { + continue; + } + + if (strip->route()->slaved_to (vca)) { + + strip->set_gui_property ("visible", true); + + if (strip->packed()) { + strip_packer.reorder_child (*strip, -1); /* put at end */ + } else { + strip_packer.pack_start (*strip, false, false); + strip->set_packed (true); + } + + } else { + + strip->set_gui_property ("visible", false); + + if (strip->packed()) { + strip_packer.remove (*strip); + strip->set_packed (false); + } + } + } +} + +void +Mixer_UI::redisplay_track_list () +{ if (no_track_list_redisplay) { return; } + boost::shared_ptr sv = spilled_vca.lock (); + + if (sv) { + spill_redisplay (sv); + return; + } + + TreeModel::Children rows = track_model->children(); + TreeModel::Children::iterator i; + uint32_t n_masters = 0; + container_clear (vca_packer); for (i = rows.begin(); i != rows.end(); ++i) { @@ -2671,6 +2724,7 @@ Mixer_UI::show_vca_slaves (boost::shared_ptr vca) if (v != vca) { spilled_vca = vca; show_vca_change (vca); /* EMIT SIGNAL */ + redisplay_track_list (); } } diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index 465324deb2..78fde73962 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -196,6 +196,7 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p void track_name_changed (MixerStrip *); void redisplay_track_list (); + void spill_redisplay (boost::shared_ptr); bool no_track_list_redisplay; bool track_display_button_press (GdkEventButton*); void strip_width_changed (); -- cgit v1.2.3