, _gain (0)
, _index (index)
, _surface (&s)
+ , _route_locked (false)
{
/* build the controls for this track, which will automatically add them
to the Group
void
Strip::set_route (boost::shared_ptr<Route> r)
{
+ if (_route_locked) {
+ return;
+ }
+
route_connections.drop_connections ();
_route = r;
Strip::notify_solo_changed ()
{
if (_route && _solo) {
- _surface->write (_solo->led().set_state (_route->soloed() ? on : off));
+ _surface->write (_solo->set_state (_route->soloed() ? on : off));
}
}
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Strip %1 mute changed\n", _index));
if (_route && _mute) {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("\troute muted ? %1\n", _route->muted()));
- DEBUG_TRACE (DEBUG::MackieControl, string_compose ("mute message: %1\n", _mute->led().set_state (_route->muted() ? on : off)));
+ DEBUG_TRACE (DEBUG::MackieControl, string_compose ("mute message: %1\n", _mute->set_state (_route->muted() ? on : off)));
- _surface->write (_mute->led().set_state (_route->muted() ? on : off));
+ _surface->write (_mute->set_state (_route->muted() ? on : off));
}
}
Strip::notify_record_enable_changed ()
{
if (_route && _recenable) {
- _surface->write (_recenable->led().set_state (_route->record_enabled() ? on : off));
+ _surface->write (_recenable->set_state (_route->record_enabled() ? on : off));
}
}
}
_surface->write (display (0, line1));
- _surface->write (blank_display (1));
}
}
if (!_route) {
// no route so always switch the light off
// because no signals will be emitted by a non-route
- _surface->write (button.led().set_state (off));
+ _surface->write (button.set_state (off));
return;
}
} else if (button.id() >= Button::select_base_id &&
button.id() < Button::select_base_id + 8) {
- _surface->mcp().select_track (_route);
+ int lock_mod = (MackieControlProtocol::MODIFIER_CONTROL|MackieControlProtocol::MODIFIER_SHIFT);
+
+ if ((_surface->mcp().modifier_state() & lock_mod) == lock_mod) {
+ if (_route) {
+ _route_locked = !_route_locked;
+ }
+ } else {
+ _surface->mcp().select_track (_route);
+ }
} else if (button.id() >= Button::vselect_base_id &&
button.id() < Button::vselect_base_id + 8) {
return retval;
}
+
+void
+Strip::lock_route ()
+{
+ /* don't lock unless we have a route */
+ if (_route) {
+ _route_locked = true;
+ }
+}
+
+void
+Strip::unlock_route ()
+{
+ _route_locked = false;
+}