summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Anderson <ardour@semiosix.com>2007-07-31 11:36:58 +0000
committerJohn Anderson <ardour@semiosix.com>2007-07-31 11:36:58 +0000
commite57dd28f3316cc026c11725ff6da52f8d559d079 (patch)
tree2d549bae13b72817d97931177d99099cee90aa9b
parent2def7ef1abd7a30e05aa25aebd02e7987946bf1a (diff)
remove some extraneous code
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2198 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/surfaces/mackie/TODO2
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc53
-rw-r--r--libs/surfaces/mackie/mackie_jog_wheel.cc2
3 files changed, 24 insertions, 33 deletions
diff --git a/libs/surfaces/mackie/TODO b/libs/surfaces/mackie/TODO
index 7d6f945132..f05552b42c 100644
--- a/libs/surfaces/mackie/TODO
+++ b/libs/surfaces/mackie/TODO
@@ -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
-------------
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index de532e28fa..56bec6ecbc 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -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
diff --git a/libs/surfaces/mackie/mackie_jog_wheel.cc b/libs/surfaces/mackie/mackie_jog_wheel.cc
index dbf18de931..4ba01c8cf3 100644
--- a/libs/surfaces/mackie/mackie_jog_wheel.cc
+++ b/libs/surfaces/mackie/mackie_jog_wheel.cc
@@ -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