diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-04 16:44:46 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | a03d969a978126d72f0825096d9d9ec89816a0d9 (patch) | |
tree | b0b64e832a345973b1fc541638c7bbaf17bb08e2 /gtk2_ardour/vca_master_strip.cc | |
parent | 00b7385e4c1b8ab341f827323eeca77109349ef0 (diff) |
update VCA assign buttons to show status for VCA strips
Diffstat (limited to 'gtk2_ardour/vca_master_strip.cc')
-rw-r--r-- | gtk2_ardour/vca_master_strip.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc index 595174d059..c0ce5ab2f7 100644 --- a/gtk2_ardour/vca_master_strip.cc +++ b/gtk2_ardour/vca_master_strip.cc @@ -60,7 +60,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v) width_button.set_icon (ArdourIcon::StripWidth); set_tooltip (width_button, _("Click to toggle the width of this VCA strip.")); - assign_button.set_text (_("-vca-")); + assign_button.set_name (X_("vca assign")); set_tooltip (assign_button, _("Click to assign a VCA Master to this VCA")); assign_button.signal_button_release_event().connect (sigc::mem_fun (*this, &VCAMasterStrip::vca_button_release), false); @@ -126,9 +126,40 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v) _selected = true; set_selected (false); set_width (true); + update_vca_display (); _vca->SoloChange.connect (vca_connections, invalidator (*this), boost::bind (&VCAMasterStrip::solo_changed, this), gui_context()); _vca->MuteChange.connect (vca_connections, invalidator (*this), boost::bind (&VCAMasterStrip::mute_changed, this), gui_context()); + + _vca->control()->VCAStatusChange.connect (vca_connections, + invalidator (*this), + boost::bind (&VCAMasterStrip::update_vca_display, this), + gui_context()); +} + +void +VCAMasterStrip::update_vca_display () +{ + VCAList vcas (_session->vca_manager().vcas()); + string label; + + for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) { + if (_vca->control()->slaved_to (*v)) { + if (!label.empty()) { + label += ' '; + } + label += PBD::to_string ((*v)->number(), std::dec); + } + } + + if (label.empty()) { + label = _("-vca-"); + assign_button.set_active_state (Gtkmm2ext::Off); + } else { + assign_button.set_active_state (Gtkmm2ext::ExplicitActive); + } + + assign_button.set_text (label); } string |