summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-12-15 10:29:45 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-12-16 06:01:47 -0500
commita9a4cfb1668ca7e74e33234ddbc7b7ab55ff0016 (patch)
tree14bb2a7a300fa941ab5f52ca1ea9119bda9a09ba
parent1152bf87a25cc2948514708f7c4a351d041da178 (diff)
mackie: track compressor mode changes in display
-rw-r--r--libs/surfaces/mackie/strip.cc32
-rw-r--r--libs/surfaces/mackie/strip.h2
2 files changed, 26 insertions, 8 deletions
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 600c4fccca..e4e9a19880 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -586,7 +586,7 @@ Strip::notify_eq_change (AutomationType type, uint32_t band, bool force_update)
}
void
-Strip::notify_dyn_change (AutomationType type, bool force_update)
+Strip::notify_dyn_change (AutomationType type, bool force_update, bool propagate_mode)
{
boost::shared_ptr<Route> r = _surface->mcp().subview_route();
@@ -601,6 +601,7 @@ Strip::notify_dyn_change (AutomationType type, bool force_update)
}
boost::shared_ptr<AutomationControl> control;
+ bool reset_all = false;
switch (type) {
case CompThreshold:
@@ -611,6 +612,7 @@ Strip::notify_dyn_change (AutomationType type, bool force_update)
break;
case CompMode:
control = r->comp_mode_controllable ();
+ reset_all = true;
break;
case CompMakeup:
control = r->comp_makeup_controllable ();
@@ -625,6 +627,10 @@ Strip::notify_dyn_change (AutomationType type, bool force_update)
break;
}
+ if (propagate_mode && reset_all) {
+ _surface->subview_mode_changed ();
+ }
+
if (control) {
float val = control->get_value();
queue_parameter_display (type, val);
@@ -764,7 +770,7 @@ Strip::select_event (Button&, ButtonState bs)
void
Strip::vselect_event (Button&, ButtonState bs)
{
- if (_surface->mcp().subview_mode() != None) {
+ if (_surface->mcp().subview_mode() != MackieControlProtocol::None) {
/* subview mode: vpot press acts like a button for toggle parameters */
@@ -1489,11 +1495,19 @@ Strip::subview_mode_changed ()
break;
case MackieControlProtocol::EQ:
- setup_eq_vpot (r);
+ if (r) {
+ setup_eq_vpot (r);
+ } else {
+ /* leave it as it was */
+ }
break;
case MackieControlProtocol::Dynamics:
- setup_dyn_vpot (r);
+ if (r) {
+ setup_dyn_vpot (r);
+ } else {
+ /* leave it as it was */
+ }
break;
}
}
@@ -1542,7 +1556,7 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Route> r)
pc = available[pos];
param = params[pos];
- pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_dyn_change, this, param, false), ui_context());
+ pc->Changed.connect (subview_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_dyn_change, this, param, false, true), ui_context());
_vpot->set_control (pc);
string pot_id;
@@ -1552,7 +1566,11 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Route> r)
pot_id = "Thresh";
break;
case CompSpeed:
- pot_id = "Speed";
+ if (mc) {
+ pot_id = r->comp_speed_name (mc->get_value());
+ } else {
+ pot_id = "Speed";
+ }
break;
case CompMode:
pot_id = "Mode";
@@ -1574,7 +1592,7 @@ Strip::setup_dyn_vpot (boost::shared_ptr<Route> r)
_surface->write (display (0, pot_id));
}
- notify_dyn_change (param, true);
+ notify_dyn_change (param, true, false);
}
void
diff --git a/libs/surfaces/mackie/strip.h b/libs/surfaces/mackie/strip.h
index a030ca5567..e84a0eb8e1 100644
--- a/libs/surfaces/mackie/strip.h
+++ b/libs/surfaces/mackie/strip.h
@@ -174,7 +174,7 @@ private:
void notify_eq_change (ARDOUR::AutomationType, uint32_t band, bool force);
void setup_eq_vpot (boost::shared_ptr<ARDOUR::Route>);
- void notify_dyn_change (ARDOUR::AutomationType, bool force);
+ void notify_dyn_change (ARDOUR::AutomationType, bool force, bool propagate_mode_change);
void setup_dyn_vpot (boost::shared_ptr<ARDOUR::Route>);
};