From 75b327964bafcccf15e83800132053524aebdf89 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 2 Mar 2016 12:12:18 -0500 Subject: tweak mixer VCA button appearance and prepare for live updates to VCA state --- gtk2_ardour/mixer_strip.cc | 3 +-- gtk2_ardour/route_ui.cc | 36 ++++++++++++++++++++++++++++++++++-- gtk2_ardour/route_ui.h | 2 ++ 3 files changed, 37 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 26977d1e70..3598f19e9b 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -83,8 +83,6 @@ using namespace ArdourMeter; MixerStrip* MixerStrip::_entered_mixer_strip; PBD::Signal1 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 rt) update_mute_display (); update_solo_display (); + update_vca_display (); name_changed (); comment_changed (); route_group_changed (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index efacdb2fc1..53bcef531c 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -27,13 +27,16 @@ #include #include -#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 () { diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 1b021abd66..788c65101b 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -242,6 +242,8 @@ class RouteUI : public virtual AxisView void update_solo_display (); + void update_vca_display (); + virtual void map_frozen (); void adjust_latency (); -- cgit v1.2.3