-//printf("TimeBar::cursor_motion_event %d %p %d\n", __LINE__, this, current_operation);
- switch( current_operation )
- {
- case TIMEBAR_DRAG:
- {
- update_cursor();
- handle_mwindow_drag();
- result = 1;
-//printf("TimeBar::cursor_motion_event %d %d\n", __LINE__, current_operation);
- break;
- }
-
-
- case TIMEBAR_DRAG_LEFT:
- case TIMEBAR_DRAG_RIGHT:
- case TIMEBAR_DRAG_CENTER:
- if( has_preview() )
- result = move_preview(redraw);
- break;
-
- default:
- if( cursor_above() ) {
- highlighted = 1;
- redraw = 1;
+ switch( current_operation ) {
+ case TIMEBAR_DRAG_LEFT:
+ case TIMEBAR_DRAG_RIGHT:
+ case TIMEBAR_DRAG_CENTER:
+ if( has_preview() )
+ result = move_preview(redraw);
+ break;
+
+ case TIMEBAR_DRAG_LABEL:
+ if( drag_label ) {
+ EDL *edl = get_edl();
+ int pixel = get_relative_cursor_x();
+ double position = pixel_to_position(pixel);
+ if( drag_label->label )
+ drag_label->label->position = position;
+ else if( drag_label == in_point ) {
+ if( out_point && edl->local_session->outpoint_valid() ) {
+ double out_pos = edl->local_session->get_outpoint();
+ if( position > out_pos ) {
+ edl->local_session->set_outpoint(position);
+ drag_label = out_point;
+ position = out_pos;
+ }
+ }
+ edl->local_session->set_inpoint(position);
+ }
+ else if( drag_label == out_point ) {
+ if( in_point && edl->local_session->inpoint_valid() ) {
+ double in_pos = edl->local_session->get_inpoint();
+ if( position < in_pos ) {
+ edl->local_session->set_inpoint(position);
+ drag_label = in_point;
+ position = in_pos;
+ }
+ }
+ edl->local_session->set_outpoint(position);