- if( playback_start > cursor_position && ( position < 0 || playback_start < position ) )
- position = playback_start;
- else if( playback_end > cursor_position && ( position < 0 || playback_end < position ) )
- position = playback_end;
-
- if( position >= 0 ) {
- edl->local_session->set_selectionend(position);
- if(!shift_down)
- edl->local_session->set_selectionstart(
- edl->local_session->get_selectionend(1));
-
- update_plugin_guis();
- TimelinePane *pane = gui->get_focused_pane();
- if(edl->local_session->get_selectionend(1) >=
- (double)edl->local_session->view_start[pane->number] *
- edl->local_session->zoom_sample /
- edl->session->sample_rate +
- pane->canvas->time_visible() ||
- edl->local_session->get_selectionend(1) < (double)edl->local_session->view_start[pane->number] *
- edl->local_session->zoom_sample /
- edl->session->sample_rate)
- {
- samplemovement((int64_t)(edl->local_session->get_selectionend(1) *
- edl->session->sample_rate /
- edl->local_session->zoom_sample -
- pane->canvas->get_w() /
- 2),
- pane->number);
- cwindow->update(1, 0, 0, 0, 0);
- }
- else
- {
- gui->update_patchbay();
- gui->update_timebar(0);
- gui->hide_cursor(0);
- gui->draw_cursor(0);
- gui->zoombar->update();
- gui->flash_canvas(1);
- cwindow->update(1, 0, 0, 0, 1);
- }
- }
- else
- {
- goto_end();
- }
- return 0;
+ if( playback_start > position && playback_start < new_position )
+ new_position = playback_start;
+ else if( playback_end > position && playback_end < new_position )
+ new_position = playback_end;
+ if( new_position > total_length )
+ new_position = total_length;
+ edl->local_session->set_selectionend(new_position);
+//printf("MWindow::next_edit_handle %d\n", shift_down);
+ if( !shift_down )
+ edl->local_session->set_selectionstart(new_position);
+ return find_selection(new_position);