Allow moving the playhead to the mouse position with 'p' press.
This commit is contained in:
parent
78a3399260
commit
2a7f14870c
|
@ -702,6 +702,17 @@ Timeline::handle ( int m )
|
|||
|
||||
return 1;
|
||||
}
|
||||
case 'p':
|
||||
{
|
||||
int X = Fl::event_x() - Track::width();
|
||||
|
||||
if ( X > 0 )
|
||||
{
|
||||
transport.locate( xoffset + x_to_ts( X ) );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
default:
|
||||
return Fl_Overlay_Window::handle( m );
|
||||
}
|
||||
|
|
|
@ -31,3 +31,9 @@ Transport::poll ( void )
|
|||
|
||||
rolling = ts == JackTransportRolling;
|
||||
}
|
||||
|
||||
void
|
||||
Transport::locate ( nframes_t frame )
|
||||
{
|
||||
jack_transport_locate( engine->client(), frame );
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ struct Transport : public jack_position_t
|
|||
bool rolling;
|
||||
|
||||
void poll ( void );
|
||||
void locate ( nframes_t frame );
|
||||
};
|
||||
|
||||
extern Transport transport;
|
||||
|
|
Loading…
Reference in New Issue