MCP: fix handling of vpot presses
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Apr 2012 21:22:36 +0000 (21:22 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Apr 2012 21:22:36 +0000 (21:22 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12100 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol.h
libs/surfaces/mackie/strip.cc

index c1f53179763f85c038a0fc8f58a74ba0ecdd4330..ccd29a4d3984bfb12032723ffbb00755ca89f173 100644 (file)
@@ -352,6 +352,10 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force)
 
        /* reset this to get the right display of view mode after the switch */
        set_view_mode (_view_mode);
+
+       /* make sure selection is correct */
+       
+       // gui_track_selection_changed (_last_selected_routes);
        
        /* current bank has not been saved */
        session->set_dirty();
@@ -1203,6 +1207,8 @@ MackieControlProtocol::gui_track_selection_changed (ARDOUR::RouteNotificationLis
        for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
                (*s)->gui_selection_changed (rl);
        }
+       
+       // _last_selected_routes = *rl;
 }
 
 framepos_t
index 0df770b36eab788ad46da8e55edb9cd3943ec232..8bcec0933a122e1583d040586cd08a3e4554e4b4 100644 (file)
@@ -285,7 +285,7 @@ class MackieControlProtocol
        ButtonMap                 button_map;
        int16_t                  _ipmidi_base;
        bool                      needs_ipmidi_restart;
-
+       
        void create_surfaces ();
        bool periodic();
        void build_gui ();
index af859ab41d1abb9a49e4fdb96533571a324a30c3..704671c84c0cac2b18c0568565bbec7323c66ce0 100644 (file)
@@ -461,15 +461,25 @@ Strip::vselect_event (Button& button, ButtonState bs)
                int ms = _surface->mcp().modifier_state();
                                
                if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
-                       boost::shared_ptr<AutomationControl> ac = button.control ();
 
-                       if (ac) {
+                       /* get the corresponding vpot and whatever its
+                        * controlling
+                        */
+
+                       Pot* pot = _surface->pots[Pot::ID + _index];
+
+                       if (pot) {
+                               boost::shared_ptr<AutomationControl> ac = pot->control ();
                                
-                               /* reset to default/normal value */
-                               ac->set_value (ac->normal());
+                               if (ac) {
+                                       
+                                       /* reset to default/normal value */
+                                       ac->set_value (ac->normal());
+                               }
                        }
 
                }  else {
+
                        DEBUG_TRACE (DEBUG::MackieControl, "switching to next pot mode\n");
                        next_pot_mode ();
                }