Browse Source

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

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
2a7f14870c
3 changed files with 18 additions and 0 deletions
  1. +11
    -0
      Timeline/Timeline.C
  2. +6
    -0
      Timeline/Transport.C
  3. +1
    -0
      Timeline/Transport.H

+ 11
- 0
Timeline/Timeline.C View File

@@ -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 );
}


+ 6
- 0
Timeline/Transport.C View File

@@ -31,3 +31,9 @@ Transport::poll ( void )

rolling = ts == JackTransportRolling;
}

void
Transport::locate ( nframes_t frame )
{
jack_transport_locate( engine->client(), frame );
}

+ 1
- 0
Timeline/Transport.H View File

@@ -27,6 +27,7 @@ struct Transport : public jack_position_t
bool rolling;

void poll ( void );
void locate ( nframes_t frame );
};

extern Transport transport;

Loading…
Cancel
Save