summaryrefslogtreecommitdiff
path: root/gtk2_ardour/vca_master_strip.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-18 15:56:52 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:43 -0400
commit45b5c9667e8b2d50250cd6d2846f9e0905fb1e84 (patch)
tree480cf57dde62645645ac0cadfdb51e4b87f4015a /gtk2_ardour/vca_master_strip.cc
parent1d81392e379c96b4014b9cf2cb4d3349a0f4b9bf (diff)
basics of spill control in place (actual change in mixer display, not done)
Diffstat (limited to 'gtk2_ardour/vca_master_strip.cc')
-rw-r--r--gtk2_ardour/vca_master_strip.cc51
1 files changed, 26 insertions, 25 deletions
diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc
index aeef39e924..e40dd96ba3 100644
--- a/gtk2_ardour/vca_master_strip.cc
+++ b/gtk2_ardour/vca_master_strip.cc
@@ -31,6 +31,7 @@
#include "ardour_dialog.h"
#include "floating_text_entry.h"
#include "gui_thread.h"
+#include "mixer_ui.h"
#include "tooltips.h"
#include "ui_config.h"
#include "vca_master_strip.h"
@@ -46,30 +47,6 @@ using std::string;
PBD::Signal1<void,VCAMasterStrip*> VCAMasterStrip::CatchDeletion;
-static string
-verticalize (string const & str)
-{
- return str;
-#if 0
- string ret;
- string::const_iterator s = str.begin();
- ret = *s;
- ret += '\n';
- ++s;
-
- while (s != str.end()) {
- ret += *s;
- ret += '\n';
- ++s;
- }
-
- /* remove terminal newline */
-
- ret.erase (ret.length() - 1, string::npos);
- return ret;
-#endif
-}
-
VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
: AxisView (s)
, _vca (v)
@@ -124,6 +101,7 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
/* horizontally centered, with a little space (5%) at the top */
vertical_button.set_angle (90);
vertical_button.set_layout_font (UIConfiguration::instance().get_NormalBoldFont());
+ vertical_button.signal_clicked.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill));
global_vpacker.set_border_width (1);
global_vpacker.set_spacing (0);
@@ -166,6 +144,8 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
solo_changed ();
mute_changed ();
+ Mixer_UI::instance()->show_vca_change.connect (sigc::mem_fun (*this, &VCAMasterStrip::spill_change));
+
/* this remains unchanged as the name changes */
name_button.set_text (string_compose (X_("VCA %1"), _vca->number()));
@@ -485,7 +465,8 @@ VCAMasterStrip::vca_property_changed (PropertyChange const & what_changed)
void
VCAMasterStrip::update_vca_name ()
{
- vertical_button.set_text (verticalize (short_version (_vca->name(), 15)));
+ /* 20 is a rough guess at the number of letters we can fit. */
+ vertical_button.set_text (short_version (_vca->name(), 20));
}
void
@@ -497,3 +478,23 @@ VCAMasterStrip::build_context_menu ()
items.push_back (MenuElem (_("Rename"), sigc::mem_fun (*this, &VCAMasterStrip::start_name_edit)));
items.push_back (MenuElem (_("Remove")));
}
+
+void
+VCAMasterStrip::spill ()
+{
+ if (Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
+ Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+ } else {
+ Mixer_UI::instance()->show_vca_slaves (_vca);
+ }
+}
+
+void
+VCAMasterStrip::spill_change (boost::shared_ptr<VCA> vca)
+{
+ if (vca != _vca) {
+ vertical_button.set_active_state (Gtkmm2ext::Off);
+ } else {
+ vertical_button.set_active_state (Gtkmm2ext::ExplicitActive);
+ }
+}