remove some extraneous code
authorJohn Anderson <ardour@semiosix.com>
Tue, 31 Jul 2007 11:36:58 +0000 (11:36 +0000)
committerJohn Anderson <ardour@semiosix.com>
Tue, 31 Jul 2007 11:36:58 +0000 (11:36 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2198 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/TODO
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_jog_wheel.cc

index 7d6f9451326a3f910ae2231071717100d94adb5d..f05552b42c36e900305c4844f8a8c69fee44b3e0 100644 (file)
@@ -35,7 +35,7 @@ Need UI integration
 -------------------
 * Some indication on the UI of currently bank-switched-in routes?
   Useful for surfaces that don't have a scribble strip.
-* use current zoom setting and snap state for jog wheel
+* use current snap state for jog wheel and ffwd/rew
 
 Actual Mackie
 -------------
index de532e28fa13e27872d01a52968ae22a412fe831..56bec6ecbc80061cbd10a80c8d75991ec51c69d7 100644 (file)
@@ -810,8 +810,7 @@ int MackieControlProtocol::set_state( const XMLNode & node )
 
 void MackieControlProtocol::handle_control_event( SurfacePort & port, Control & control, const ControlState & state )
 {
-       // fetch a RouteSignal so we know what route to update
-       uint32_t index = control.ordinal() - 1 + ( port.number() * port.strips() );
+       // find the route for the control, if there is one
        boost::shared_ptr<Route> route;
        if ( control.group().is_strip() )
        {
@@ -819,10 +818,14 @@ void MackieControlProtocol::handle_control_event( SurfacePort & port, Control &
                {
                        route = master_route();
                }
-               else if ( index < route_table.size() )
-                       route = route_table[index];
                else
-                       cerr << "Warning: index is " << index << " which is not in the route table, size: " << route_table.size() << endl;
+               {
+                       uint32_t index = control.ordinal() - 1 + ( port.number() * port.strips() );
+                       if ( index < route_table.size() )
+                               route = route_table[index];
+                       else
+                               cerr << "Warning: index is " << index << " which is not in the route table, size: " << route_table.size() << endl;
+               }
        }
        
        // This handles control element events from the surface
@@ -831,31 +834,17 @@ void MackieControlProtocol::handle_control_event( SurfacePort & port, Control &
        switch ( control.type() )
        {
                case Control::type_fader:
-                       // TODO this seems to be a duplicate of the above if
-                       if ( control.group().is_strip() )
-                       {
-                               // find the route in the route table for the id
-                               // if the route isn't available, skip it
-                               // at which point the fader should just reset itself
-                               if ( route != 0 )
-                               {
-                                       route->set_gain( slider_position_to_gain( state.pos ), this );
-                                       
-                                       // must echo bytes back to slider now, because
-                                       // the notifier only works if the fader is not being
-                                       // touched. Which it is if we're getting input.
-                                       port.write( builder.build_fader( (Fader&)control, state.pos ) );
-                               }
-                       }
-                       else
+                       // find the route in the route table for the id
+                       // if the route isn't available, skip it
+                       // at which point the fader should just reset itself
+                       if ( route != 0 )
                        {
-                               // master fader
-                               boost::shared_ptr<Route> route = master_route();
-                               if ( route )
-                               {
-                                       route->set_gain( slider_position_to_gain( state.pos ), this );
-                                       port.write( builder.build_fader( (Fader&)control, state.pos ) );
-                               }
+                               route->set_gain( slider_position_to_gain( state.pos ), this );
+                               
+                               // must echo bytes back to slider now, because
+                               // the notifier only works if the fader is not being
+                               // touched. Which it is if we're getting input.
+                               port.write( builder.build_fader( (Fader&)control, state.pos ) );
                        }
                        break;
                        
@@ -877,9 +866,10 @@ void MackieControlProtocol::handle_control_event( SurfacePort & port, Control &
                        else if ( control.group().is_master() )
                        {
                                // master fader touch
-                               boost::shared_ptr<Route> route = master_route();
-                               if ( route )
+                               if ( route != 0 )
+                               {
                                        handle_strip_button( control, state.button_state, route );
+                               }
                        }
                        else
                        {
@@ -894,6 +884,7 @@ void MackieControlProtocol::handle_control_event( SurfacePort & port, Control &
                        {
                                if ( route != 0 )
                                {
+                                       // pan for mono input routes, or stereo linked panners
                                        if ( route->panner().size() == 1 || ( route->panner().size() == 2 && route->panner().linked() ) )
                                        {
                                                // assume pan for now
index dbf18de931490bfb1ddf5a0e758d32d0a2f3e5d9..4ba01c8cf3a5afd862e3be70b2c7e7ac12c2af2c 100644 (file)
@@ -76,7 +76,7 @@ void JogWheel::jog_event( SurfacePort & port, Control & control, const ControlSt
        
        case scrub:
        {
-               if ( state.delta != 0.0 )
+               if ( state.sign != 0 )
                {
                        add_scrub_interval( _scrub_timer.restart() );
                        // x clicks per second => speed == 1.0