13
0

Fix MCP extension number and get master on right surface.

This commit is contained in:
Len Ovens 2015-10-11 21:37:04 -07:00
parent 27f57cde9a
commit 104f43ad37
2 changed files with 6 additions and 16 deletions

View File

@ -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> surface;
if (n == _device_info.master_position()) {
if (is_master) {
stype = mcu;
} else {
stype = ext;

View File

@ -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");