tweak mixer VCA button appearance and prepare for live updates to VCA state
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 2 Mar 2016 17:12:18 +0000 (12:12 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:39 +0000 (15:30 -0400)
gtk2_ardour/mixer_strip.cc
gtk2_ardour/route_ui.cc
gtk2_ardour/route_ui.h

index 26977d1e70ea9cc0c057f76de95fa515fac185d5..3598f19e9b5d4398c4bf18c5b33ad9fe4f250a8f 100644 (file)
@@ -83,8 +83,6 @@ using namespace ArdourMeter;
 MixerStrip* MixerStrip::_entered_mixer_strip;
 PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
 
-static const uint32_t n_vca_buttons = 4;
-
 MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, bool in_mixer)
        : AxisView(sess)
        , RouteUI (sess)
@@ -649,6 +647,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
 
        update_mute_display ();
        update_solo_display ();
+       update_vca_display ();
        name_changed ();
        comment_changed ();
        route_group_changed ();
index efacdb2fc1f1ad7cd5182c66fd9b5cd7a71a892e..53bcef531c276609f83b37ce65571706212e85a6 100644 (file)
 #include <gtkmm2ext/gtk_ui.h>
 #include <gtkmm2ext/utils.h>
 
-#include "ardour/route_group.h"
-#include "ardour/dB.h"
 #include "pbd/memento_command.h"
 #include "pbd/stacktrace.h"
 #include "pbd/controllable.h"
 #include "pbd/enumwriter.h"
 
+#include "ardour/dB.h"
+#include "ardour/route_group.h"
+#include "ardour/vca.h"
+#include "ardour/vca_manager.h"
+
 #include "ardour_ui.h"
 #include "editor.h"
 #include "route_ui.h"
@@ -1273,6 +1276,35 @@ RouteUI::update_mute_display ()
         mute_button->set_active_state (mute_active_state (_session, _route));
 }
 
+void
+RouteUI::update_vca_display ()
+{
+       if (!vca_button) {
+               return;
+       }
+
+       VCAList vcas (_session->vca_manager().vcas());
+       string label;
+
+       for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
+               if (_route->slaved_to (*v)) {
+                       if (!label.empty()) {
+                               label += ' ';
+                       }
+                       label += PBD::to_string ((*v)->number(), std::dec);
+               }
+       }
+
+       if (label.empty()) {
+               label = _("-vca-");
+               vca_button->set_active_state (Gtkmm2ext::Off);
+       } else {
+               vca_button->set_active_state (Gtkmm2ext::ExplicitActive);
+       }
+
+       vca_button->set_text (label);
+}
+
 void
 RouteUI::route_rec_enable_changed ()
 {
index 1b021abd668706d2089af5a830198ea7a854fc0d..788c65101b60137472a13b2413762098229f2a3a 100644 (file)
@@ -242,6 +242,8 @@ class RouteUI : public virtual AxisView
 
        void update_solo_display ();
 
+       void update_vca_display ();
+
        virtual void map_frozen ();
 
        void adjust_latency ();