Allow moving the playhead to the mouse position with 'p' press.

This commit is contained in:
Jonathan Moore Liles 2008-04-21 19:52:59 -05:00
parent 78a3399260
commit 2a7f14870c
3 changed files with 18 additions and 0 deletions

View File

@ -702,6 +702,17 @@ Timeline::handle ( int m )
return 1; return 1;
} }
case 'p':
{
int X = Fl::event_x() - Track::width();
if ( X > 0 )
{
transport.locate( xoffset + x_to_ts( X ) );
}
return 1;
}
default: default:
return Fl_Overlay_Window::handle( m ); return Fl_Overlay_Window::handle( m );
} }

View File

@ -31,3 +31,9 @@ Transport::poll ( void )
rolling = ts == JackTransportRolling; rolling = ts == JackTransportRolling;
} }
void
Transport::locate ( nframes_t frame )
{
jack_transport_locate( engine->client(), frame );
}

View File

@ -27,6 +27,7 @@ struct Transport : public jack_position_t
bool rolling; bool rolling;
void poll ( void ); void poll ( void );
void locate ( nframes_t frame );
}; };
extern Transport transport; extern Transport transport;