From 104f43ad37e7fd6cfc5d273d1ec2cec003c29265 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Sun, 11 Oct 2015 21:37:04 -0700 Subject: [PATCH] Fix MCP extension number and get master on right surface. --- libs/surfaces/mackie/mackie_control_protocol.cc | 16 +++------------- libs/surfaces/mackie/surface_port.cc | 6 +++--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 6f81b57c59..9f9f33b633 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -775,18 +775,7 @@ MackieControlProtocol::create_surfaces () for (uint32_t n = 0; n < 1 + _device_info.extenders(); ++n) { bool is_master = false; - if (_device_info.master_position() == 0) { - /* unspecified master position, use first surface */ - if (n == 0) { - is_master = true; - if (_device_info.extenders() == 0) { - device_name = _device_info.name(); - } else { - device_name = X_("mackie control"); - } - } - } else if ((n+1) == _device_info.master_position()) { - /* specified master position, uses 1-based counting for user interaction */ + if (n == _device_info.master_position()) { is_master = true; if (_device_info.extenders() == 0) { device_name = _device_info.name(); @@ -799,10 +788,11 @@ MackieControlProtocol::create_surfaces () if (!is_master) { device_name = string_compose (X_("mackie control ext %1"), n+1); } + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Port Name for surface %1 is %2\n", n, device_name)); boost::shared_ptr surface; - if (n == _device_info.master_position()) { + if (is_master) { stype = mcu; } else { stype = ext; diff --git a/libs/surfaces/mackie/surface_port.cc b/libs/surfaces/mackie/surface_port.cc index 6f243a5444..009f45d136 100644 --- a/libs/surfaces/mackie/surface_port.cc +++ b/libs/surfaces/mackie/surface_port.cc @@ -62,12 +62,12 @@ SurfacePort::SurfacePort (Surface& s) string out_name; if (_surface->mcp().device_info().extenders() > 0) { - if (_surface->number() + 1 == _surface->mcp().device_info().master_position()) { + if (_surface->number() == _surface->mcp().device_info().master_position()) { in_name = X_("mackie control in"); out_name = X_("mackie control out"); } else { - in_name = string_compose (X_("mackie control in ext %1"), _surface->number()); - out_name = string_compose (X_("mackie control out ext %1"), _surface->number()); + in_name = string_compose (X_("mackie control in ext %1"), (_surface->number() + 1)); + out_name = string_compose (X_("mackie control out ext %1"), _surface->number() + 1); } } else { in_name = X_("mackie control in");