MCP: shift-select resets gain to unity
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Apr 2012 17:56:20 +0000 (17:56 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Apr 2012 17:56:20 +0000 (17:56 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11856 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/mackie_control_protocol.cc

index 5c0b3e02c66003c421f6e5cd17f88b508f92d8b5..bef36974c7f5f00e1aff3d25978d9a8d1bb5325f 100644 (file)
@@ -491,14 +491,20 @@ MackieControlProtocol::handle_strip_button (SurfacePort & port, Control & contro
                } else if (control.name() == "select") {
                        Strip* strip = const_cast<Strip*>(dynamic_cast<const Strip*>(&control.group()));
                        if (strip) {
+
                                if ((uint32_t) strip->index() < route_table.size()) {
                                        boost::shared_ptr<Route> r = route_table[strip->index()];
-                                       if (r->remote_control_id() == _current_selected_track) {
-                                               UnselectTrack (); /* EMIT SIGNAL */
-                                               _current_selected_track = -1;
+
+                                       if (_modifier_state == MODIFIER_SHIFT) {
+                                               r->gain_control()->set_value (0.0);
                                        } else {
-                                               SelectByRID (r->remote_control_id()); /* EMIT SIGNAL */
-                                               _current_selected_track = r->remote_control_id();;
+                                               if (r->remote_control_id() == _current_selected_track) {
+                                                       UnselectTrack (); /* EMIT SIGNAL */
+                                                       _current_selected_track = -1;
+                                               } else {
+                                                       SelectByRID (r->remote_control_id()); /* EMIT SIGNAL */
+                                                       _current_selected_track = r->remote_control_id();;
+                                               }
                                        }
                                } 
                        }