diff options
author | John Anderson <ardour@semiosix.com> | 2007-07-20 14:26:35 +0000 |
---|---|---|
committer | John Anderson <ardour@semiosix.com> | 2007-07-20 14:26:35 +0000 |
commit | d013570b133ed28086767b443c1f0e30d47237b8 (patch) | |
tree | 6aa1534da2b636c31c454a07d5e73676d9394174 /libs/surfaces/mackie/mackie_jog_wheel.cc | |
parent | cf90cfa4c10ee58ec65da833f5969b3f5f9c931e (diff) |
make scrolling work. various comments and TODO cleanups
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2161 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/mackie/mackie_jog_wheel.cc')
-rw-r--r-- | libs/surfaces/mackie/mackie_jog_wheel.cc | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/libs/surfaces/mackie/mackie_jog_wheel.cc b/libs/surfaces/mackie/mackie_jog_wheel.cc index 481c45bffc..9996a7bb29 100644 --- a/libs/surfaces/mackie/mackie_jog_wheel.cc +++ b/libs/surfaces/mackie/mackie_jog_wheel.cc @@ -67,15 +67,10 @@ void JogWheel::jog_event( SurfacePort & port, Control & control, const ControlSt switch ( jog_wheel_state() ) { case scroll: - //ScrollTimeline causes crashes - if ( _mcp.mcu_port().emulation() == MackiePort::bcf2000 ) - _mcp.ScrollTimeline( state.ticks * state.sign / 100.0 ); - else - _mcp.ScrollTimeline( state.ticks * state.sign / 100.0 ); + _mcp.ScrollTimeline( state.delta * state.sign ); break; case zoom: - // TODO do a for loop for each, to number of ticks if ( state.sign > 0 ) for ( unsigned int i = 0; i < state.ticks; ++i ) _mcp.ZoomIn(); else @@ -83,27 +78,23 @@ void JogWheel::jog_event( SurfacePort & port, Control & control, const ControlSt break; case speed: - { - // block because we initialize a variable - // locally, _transport_speed is an absolute value... - // fairly arbitrary scaling function - _transport_speed += scaled_delta( state, _mcp.get_session().transport_speed() ); - - // make sure not weirdness get so the session - if ( _transport_speed < 0 || isnan( _transport_speed ) ) - { - _transport_speed = 0.0; - } - - // translated current speed to a signed transport velocity - _mcp.get_session().request_transport_speed( transport_speed() * transport_direction() ); + // locally, _transport_speed is an positive value + // fairly arbitrary scaling function + _transport_speed += scaled_delta( state, _mcp.get_session().transport_speed() ); + + // make sure not weirdness get so the session + if ( _transport_speed < 0 || isnan( _transport_speed ) ) + { + _transport_speed = 0.0; + } + + // translate _transport_speed speed to a signed transport velocity + _mcp.get_session().request_transport_speed( transport_speed() * transport_direction() ); break; - } case scrub: { add_scrub_interval( _scrub_timer.restart() ); - // copied from tranzport driver float speed = 0.0; // This should really be part of the surface object |