From dd81c77161e8a41e054b077cd682626ff69623de Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 12 Apr 2012 01:05:18 +0000 Subject: [PATCH] MCP: probably fix crash from flip mode, and debug modifier state in pothandler git-svn-id: svn://localhost/ardour2/branches/3.0@11932 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/surfaces/mackie/strip.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index 7304301e51..5c5b7264e5 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -473,6 +473,7 @@ Strip::handle_pot (Pot& pot, float delta) case MackieControlProtocol::Normal: /* pot controls pan */ case MackieControlProtocol::Mirror: /* pot + fader control pan */ case MackieControlProtocol::Zero: /* pot controls pan, faders don't move */ + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("modifier state %1\n", _surface->mcp().modifier_state())); if (_surface->mcp().modifier_state() & MackieControlProtocol::MODIFIER_CONTROL) { DEBUG_TRACE (DEBUG::MackieControl, "pot using control to alter width\n"); ac = pannable->pan_width_control; @@ -486,14 +487,16 @@ Strip::handle_pot (Pot& pot, float delta) break; } - double p = ac->get_value(); - - // calculate new value, and adjust - p += delta; - p = min (1.0, p); - p = max (0.0, p); - - ac->set_value (p); + if (ac) { + double p = ac->get_value(); + + // calculate new value, and adjust + p += delta; + p = min (1.0, p); + p = max (0.0, p); + + ac->set_value (p); + } } }