summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/mixer_strip.cc3
-rw-r--r--gtk2_ardour/vca_master_strip.cc105
-rw-r--r--gtk2_ardour/vca_master_strip.h14
3 files changed, 121 insertions, 1 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 523b6cf477..9963737188 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -2523,6 +2523,7 @@ MixerStrip::vca_assign (boost::shared_ptr<VCA> vca)
return;
}
_route->gain_control()->add_master (vca);
+ vca->add_solo_mute_target (_route);
}
void
@@ -2535,8 +2536,10 @@ MixerStrip::vca_unassign (boost::shared_ptr<VCA> vca)
if (!vca) {
/* null VCA means drop all VCA assignments */
_route->gain_control()->clear_masters ();
+ /* XXX Need to remove all solo/mute target entries */
} else {
_route->gain_control()->remove_master (vca);
+ vca->remove_solo_mute_target (_route);
}
}
diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc
index bd77dfd09d..220673c294 100644
--- a/gtk2_ardour/vca_master_strip.cc
+++ b/gtk2_ardour/vca_master_strip.cc
@@ -18,10 +18,12 @@
#include "pbd/convert.h"
+#include "ardour/rc_configuration.h"
#include "ardour/vca.h"
#include "tooltips.h"
#include "vca_master_strip.h"
+#include "gui_thread.h"
#include "i18n.h"
@@ -34,18 +36,30 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
: AxisView (s)
, _vca (v)
, gain_meter (s, 250)
+ , wide (true)
{
gain_meter.set_controls (boost::shared_ptr<Route>(),
boost::shared_ptr<PeakMeter>(),
boost::shared_ptr<Amp>(),
_vca->control());
+ solo_button.set_name ("solo button");
+ set_tooltip (solo_button, _("Solo slaves"));
+ solo_button.signal_button_release_event().connect (sigc::mem_fun (*this, &VCAMasterStrip::solo_release), false);
+
+ mute_button.set_name ("mute button");
+ set_tooltip (mute_button, _("Mute slaves"));
+ mute_button.signal_button_release_event().connect (sigc::mem_fun (*this, &VCAMasterStrip::mute_release), false);
+
hide_button.set_icon (ArdourIcon::CloseCross);
set_tooltip (&hide_button, _("Hide this VCA strip"));
width_button.set_icon (ArdourIcon::StripWidth);
set_tooltip (width_button, _("Click to toggle the width of this VCA strip."));
+ assign_button.set_text (_("-vca-"));
+ set_tooltip (assign_button, _("Click to assign a VCA Master to this VCA"));
+
width_button.signal_button_press_event().connect (sigc::mem_fun(*this, &VCAMasterStrip::width_button_pressed), false);
hide_button.signal_clicked.connect (sigc::mem_fun(*this, &VCAMasterStrip::hide_clicked));
@@ -54,6 +68,10 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
width_hide_box.pack_start (number_label, true, true);
width_hide_box.pack_end (hide_button, false, true);
+ solo_mute_box.set_spacing (2);
+ solo_mute_box.pack_start (mute_button, true, true);
+ solo_mute_box.pack_start (solo_button, true, true);
+
number_label.set_text (PBD::to_string (v->number(), std::dec));
number_label.set_elements((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive));
number_label.set_no_show_all ();
@@ -76,7 +94,9 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
global_vpacker.pack_start (active_button, false, false);
global_vpacker.pack_start (name_button, false, false);
global_vpacker.pack_start (vertical_padding, true, true);
+ global_vpacker.pack_start (solo_mute_box, false, false);
global_vpacker.pack_start (gain_meter, false, false);
+ global_vpacker.pack_start (assign_button, false, false);
global_vpacker.pack_start (bottom_padding, false, false);
global_frame.add (global_vpacker);
@@ -94,11 +114,17 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
active_button.show_all ();
name_button.show_all ();
gain_meter.show_all ();
+ solo_mute_box.show_all ();
+ assign_button.show ();
/* force setting of visible selected status */
_selected = true;
set_selected (false);
+ set_width (true);
+
+ _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());
}
string
@@ -134,3 +160,82 @@ VCAMasterStrip::set_selected (bool yn)
global_frame.queue_draw ();
}
+bool
+VCAMasterStrip::solo_release (GdkEventButton*)
+{
+ _vca->set_solo (!_vca->soloed());
+ return true;
+}
+
+bool
+VCAMasterStrip::mute_release (GdkEventButton*)
+{
+ _vca->set_mute (!_vca->muted());
+ return true;
+}
+
+void
+VCAMasterStrip::set_solo_text ()
+{
+ if (wide) {
+ if (Config->get_solo_control_is_listen_control ()) {
+ switch (Config->get_listen_position()) {
+ case AfterFaderListen:
+ solo_button.set_text (_("AFL"));
+ break;
+ case PreFaderListen:
+ solo_button.set_text (_("PFL"));
+ break;
+ }
+ } else {
+ solo_button.set_text (_("Solo"));
+ }
+ } else {
+ if (Config->get_solo_control_is_listen_control ()) {
+ switch (Config->get_listen_position()) {
+ case AfterFaderListen:
+ solo_button.set_text (_("A"));
+ break;
+ case PreFaderListen:
+ solo_button.set_text (_("P"));
+ break;
+ }
+ } else {
+ solo_button.set_text (_("S"));
+ }
+ }
+}
+
+void
+VCAMasterStrip::set_width (bool w)
+{
+ wide = w;
+
+ if (wide) {
+ mute_button.set_text (_("Mute"));
+ } else {
+ mute_button.set_text (_("m"));
+ }
+
+ set_solo_text ();
+}
+
+void
+VCAMasterStrip::mute_changed ()
+{
+ if (_vca->muted()) {
+ mute_button.set_active_state (ExplicitActive);
+ } else {
+ mute_button.set_active_state (Gtkmm2ext::Off);
+ }
+}
+
+void
+VCAMasterStrip::solo_changed ()
+{
+ if (_vca->soloed()) {
+ solo_button.set_active_state (ExplicitActive);
+ } else {
+ solo_button.set_active_state (Gtkmm2ext::Off);
+ }
+}
diff --git a/gtk2_ardour/vca_master_strip.h b/gtk2_ardour/vca_master_strip.h
index 2533020f61..b65aef0c4a 100644
--- a/gtk2_ardour/vca_master_strip.h
+++ b/gtk2_ardour/vca_master_strip.h
@@ -52,15 +52,27 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
Gtk::VBox global_vpacker;
Gtk::HBox top_padding;
Gtk::HBox bottom_padding;
+ Gtk::HBox width_hide_box;
+ Gtk::HBox solo_mute_box;
ArdourButton width_button;
ArdourButton color_button;
ArdourButton hide_button;
ArdourButton number_label;
- Gtk::HBox width_hide_box;
+ ArdourButton solo_button;
+ ArdourButton mute_button;
+ ArdourButton assign_button;
+ bool wide;
+ PBD::ScopedConnectionList vca_connections;
void hide_clicked();
bool width_button_pressed (GdkEventButton *);
void set_selected (bool);
+ bool solo_release (GdkEventButton*);
+ bool mute_release (GdkEventButton*);
+ void set_width (bool wide);
+ void set_solo_text ();
+ void solo_changed ();
+ void mute_changed ();
};