diff --git a/Timeline/Timeline.C b/Timeline/Timeline.C index 8486688..7a2e9fe 100644 --- a/Timeline/Timeline.C +++ b/Timeline/Timeline.C @@ -702,6 +702,12 @@ Timeline::handle ( int m ) return 1; } + case FL_Home: + transport.locate( 0 ); + return 1; + case ' ': + transport.toggle(); + return 1; case 'p': { int X = Fl::event_x() - Track::width(); diff --git a/Timeline/Transport.C b/Timeline/Transport.C index 322be1f..bc46c1a 100644 --- a/Timeline/Transport.C +++ b/Timeline/Transport.C @@ -22,12 +22,14 @@ Transport transport; +#define client engine->client() + void Transport::poll ( void ) { jack_transport_state_t ts; - ts = jack_transport_query( engine->client(), this ); + ts = jack_transport_query( client, this ); rolling = ts == JackTransportRolling; } @@ -35,5 +37,29 @@ Transport::poll ( void ) void Transport::locate ( nframes_t frame ) { - jack_transport_locate( engine->client(), frame ); + jack_transport_locate( client, frame ); +} + + +void +Transport::start ( void ) +{ +// MESSAGE( "Starting transport" ); + jack_transport_start( client ); +} + +void +Transport::stop ( void ) +{ +// MESSAGE( "Stopping transport" ); + jack_transport_stop( client ); +} + +void +Transport::toggle ( void ) +{ + if ( rolling ) + stop(); + else + start(); } diff --git a/Timeline/Transport.H b/Timeline/Transport.H index 87187e9..66c1ccc 100644 --- a/Timeline/Transport.H +++ b/Timeline/Transport.H @@ -28,6 +28,9 @@ struct Transport : public jack_position_t void poll ( void ); void locate ( nframes_t frame ); + void start ( void ); + void stop ( void ); + void toggle ( void ); }; extern Transport transport;