actual implementation of VCA spill for mixer
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 18 May 2016 21:36:06 +0000 (17:36 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:43 +0000 (15:30 -0400)
gtk2_ardour/mixer_ui.cc
gtk2_ardour/mixer_ui.h

index 0c70668d519b1449ad4eb8e6978874d221b6212a..39158f6779f487da8291927564ddddb592ddbab4 100644 (file)
@@ -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> 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<VCA> 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> vca)
        if (v != vca) {
                spilled_vca = vca;
                show_vca_change (vca); /* EMIT SIGNAL */
+               redisplay_track_list ();
        }
 }
 
index 465324deb23f993a244d87743495f71cfc2f2a16..78fde7396291cea14cff4f3ffb19628b4211aa4a 100644 (file)
@@ -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<ARDOUR::VCA>);
        bool no_track_list_redisplay;
        bool track_display_button_press (GdkEventButton*);
        void strip_width_changed ();