X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindowmove.C;h=9d8dae5cd919e009517bd2548c88e4155fcab25c;hb=9c8644d5f3f05b52a81c259c32217bcd57792ae5;hp=5fafa512531adca4235df57462a9b09614ae0d4d;hpb=3fc547b01e919d3044bacf2a78baddeaed04e3a0;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 5fafa512..9d8dae5c 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -145,7 +145,7 @@ void MWindow::fit_selection() } -void MWindow::fit_autos(int doall) +void MWindow::fit_autos(int all) { float min = 0, max = 0; double start, end; @@ -167,7 +167,7 @@ void MWindow::fit_autos(int doall) int forstart = edl->local_session->zoombar_showautotype; int forend = edl->local_session->zoombar_showautotype + 1; - if (doall) { + if( all ) { forstart = 0; forend = AUTOGROUPTYPE_COUNT; } @@ -500,21 +500,10 @@ int MWindow::goto_start() int MWindow::goto_position(double position) { - TimelinePane *pane = gui->get_focused_pane(); - int64_t old_view_start = edl->local_session->view_start[pane->number]; - edl->local_session->set_selectionstart(position); - edl->local_session->set_selectionend(position); - find_cursor(); - int64_t new_view_start = edl->local_session->view_start[pane->number]; - if(new_view_start != old_view_start) - samplemovement(new_view_start, pane->number); - update_plugin_guis(); - gui->update_patchbay(); - gui->update_cursor(); + position = edl->align_to_frame(position, 0); + if( position < 0 ) position = 0; + select_point(position); gui->activate_timeline(); - gui->zoombar->update(); - gui->update_timebar(1); - cwindow->update(1, 0, 0, 0, 1); return 0; } @@ -716,6 +705,25 @@ int MWindow::find_selection(double position, int scroll_display) return 0; } +double MWindow::get_position() +{ + return edl->local_session->get_selectionstart(1); +} + +void MWindow::set_position(double position) +{ + if( position != get_position() ) { + if( position < 0 ) position = 0; + edl->local_session->set_selectionstart(position); + edl->local_session->set_selectionend(position); + gui->lock_window(); + find_cursor(); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); + gui->unlock_window(); + cwindow->update(1, 0, 0, 0, 0); + } +} + int MWindow::expand_y() {