From 7d3dacd43f05c21420788fe4831d54805609445f Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sun, 4 Feb 2007 20:25:02 +0000 Subject: [PATCH] r987: Fix incomplete UI updates and re-rendering after clicking in the time line. Some updates of the plugin windows and fader slider or missing re-renderings happen at the following instances: - Clicking on an edit boundary. - Clicking on a plugin boundary. - Jumping from label to label with Ctrl-Arrow. - Jumping to the beginning or end of the time line with Pos1 or End. - Selecting a label in the main windows. - Selecting a label in the composer. - Clicking on an automation keyframe. The changes in trackcanvas.C basically unify all do_*() routines to set the flags that indicate what to change to the caller, because all callers already were prepared to do the updates, but were not told to do them. In the other instances the necessary updates are introduced. This fixes bug 327. --- cinelerra/ctimebar.C | 1 + cinelerra/mtimebar.C | 5 ++++- cinelerra/mwindowmove.C | 24 ++++++++++-------------- cinelerra/trackcanvas.C | 49 +++++++++++++++++++++---------------------------- cinelerra/trackcanvas.h | 12 ++++++++---- 5 files changed, 44 insertions(+), 47 deletions(-) diff --git a/cinelerra/ctimebar.C b/cinelerra/ctimebar.C index 3f355e45..30cdb5c9 100644 --- a/cinelerra/ctimebar.C +++ b/cinelerra/ctimebar.C @@ -102,6 +102,7 @@ void CTimeBar::select_label(double position) 1, 0); mwindow->gui->unlock_window(); + mwindow->update_plugin_guis(); //printf("CTimeBar::select_label 2\n"); } diff --git a/cinelerra/mtimebar.C b/cinelerra/mtimebar.C index b1b19261..31399fec 100644 --- a/cinelerra/mtimebar.C +++ b/cinelerra/mtimebar.C @@ -10,6 +10,7 @@ #include "mtimebar.h" #include "mwindowgui.h" #include "mwindow.h" +#include "patchbay.h" #include "preferences.h" #include "theme.h" #include "trackcanvas.h" @@ -430,11 +431,13 @@ void MTimeBar::select_label(double position) } // Que the CWindow - mwindow->cwindow->update(1, 0, 0); + mwindow->cwindow->update(1, 0, 0, 0, 1); mwindow->gui->cursor->hide(0); mwindow->gui->cursor->draw(1); mwindow->gui->canvas->activate(); mwindow->gui->zoombar->update(); + mwindow->gui->patchbay->update(); + mwindow->update_plugin_guis(); update_highlights(); mwindow->gui->canvas->flash(); } diff --git a/cinelerra/mwindowmove.C b/cinelerra/mwindowmove.C index 7dae8788..1181de61 100644 --- a/cinelerra/mwindowmove.C +++ b/cinelerra/mwindowmove.C @@ -417,7 +417,7 @@ int MWindow::goto_end() gui->cursor->update(); gui->canvas->activate(); gui->zoombar->update(); - cwindow->update(1, 0, 0, 0, 0); + cwindow->update(1, 0, 0, 0, 1); return 0; } @@ -444,7 +444,7 @@ int MWindow::goto_start() gui->cursor->update(); gui->canvas->activate(); gui->zoombar->update(); - cwindow->update(1, 0, 0, 0, 0); + cwindow->update(1, 0, 0, 0, 1); return 0; } @@ -506,6 +506,7 @@ int MWindow::next_label(int shift_down) edl->local_session->get_selectionend(1)); update_plugin_guis(); + gui->patchbay->update(); if(edl->local_session->get_selectionend(1) >= (double)edl->local_session->view_start * edl->local_session->zoom_sample / @@ -520,19 +521,17 @@ int MWindow::next_label(int shift_down) edl->local_session->zoom_sample - gui->canvas->get_w() / 2)); - cwindow->update(1, 0, 0, 0, 0); } else { - gui->patchbay->update(); gui->timebar->update(); gui->cursor->hide(0); gui->cursor->draw(1); gui->zoombar->update(); gui->canvas->flash(); gui->flush(); - cwindow->update(1, 0, 0); } + cwindow->update(1, 0, 0, 0, 1); } else { @@ -553,6 +552,7 @@ int MWindow::prev_label(int shift_down) edl->local_session->set_selectionend(edl->local_session->get_selectionstart(1)); update_plugin_guis(); + gui->patchbay->update(); // Scroll the display if(edl->local_session->get_selectionstart(1) >= edl->local_session->view_start * edl->local_session->zoom_sample / @@ -568,20 +568,18 @@ int MWindow::prev_label(int shift_down) edl->local_session->zoom_sample - gui->canvas->get_w() / 2)); - cwindow->update(1, 0, 0, 0, 0); } else // Don't scroll the display { - gui->patchbay->update(); gui->timebar->update(); gui->cursor->hide(0); gui->cursor->draw(1); gui->zoombar->update(); gui->canvas->flash(); gui->flush(); - cwindow->update(1, 0, 0); } + cwindow->update(1, 0, 0, 0, 1); } else { @@ -625,6 +623,7 @@ printf("MWindow::next_edit_handle %d\n", shift_down); edl->local_session->get_selectionend(1)); update_plugin_guis(); + gui->patchbay->update(); if(edl->local_session->get_selectionend(1) >= (double)edl->local_session->view_start * edl->local_session->zoom_sample / @@ -639,19 +638,17 @@ printf("MWindow::next_edit_handle %d\n", shift_down); edl->local_session->zoom_sample - gui->canvas->get_w() / 2)); - cwindow->update(1, 0, 0, 0, 0); } else { - gui->patchbay->update(); gui->timebar->update(); gui->cursor->hide(0); gui->cursor->draw(1); gui->zoombar->update(); gui->canvas->flash(); gui->flush(); - cwindow->update(1, 0, 0); } + cwindow->update(1, 0, 0, 0, 1); } else { @@ -689,6 +686,7 @@ printf("MWindow::next_edit_handle %d\n", shift_down); edl->local_session->set_selectionend(edl->local_session->get_selectionstart(1)); update_plugin_guis(); + gui->patchbay->update(); // Scroll the display if(edl->local_session->get_selectionstart(1) >= edl->local_session->view_start * edl->local_session->zoom_sample / @@ -704,20 +702,18 @@ printf("MWindow::next_edit_handle %d\n", shift_down); edl->local_session->zoom_sample - gui->canvas->get_w() / 2)); - cwindow->update(1, 0, 0, 0, 0); } else // Don't scroll the display { - gui->patchbay->update(); gui->timebar->update(); gui->cursor->hide(0); gui->cursor->draw(1); gui->zoombar->update(); gui->canvas->flash(); gui->flush(); - cwindow->update(1, 0, 0); } + cwindow->update(1, 0, 0, 0, 1); } else { diff --git a/cinelerra/trackcanvas.C b/cinelerra/trackcanvas.C index 56277dff..fc782f71 100644 --- a/cinelerra/trackcanvas.C +++ b/cinelerra/trackcanvas.C @@ -2151,6 +2151,7 @@ int TrackCanvas::do_keyframes(int cursor_x, 1); mwindow->session->current_operation = pre_auto_operations[i]; update_drag_caption(); + rerender = 1; } else { @@ -4119,6 +4120,8 @@ int TrackCanvas::cursor_motion_event() if(do_edit_handles(get_cursor_x(), get_cursor_y(), 0, + rerender, + update_overlay, new_cursor, update_cursor)) { @@ -4129,6 +4132,8 @@ int TrackCanvas::cursor_motion_event() if(do_plugin_handles(get_cursor_x(), get_cursor_y(), 0, + rerender, + update_overlay, new_cursor, update_cursor)) { @@ -4421,6 +4426,8 @@ int TrackCanvas::button_release_event() int TrackCanvas::do_edit_handles(int cursor_x, int cursor_y, int button_press, + int &rerender, + int &update_overlay, int &new_cursor, int &update_cursor) { @@ -4493,20 +4500,8 @@ int TrackCanvas::do_edit_handles(int cursor_x, mwindow->session->drag_origin_y = get_cursor_y(); mwindow->session->drag_start = position; - int rerender = start_selection(position); - if(rerender) - { - gui->unlock_window(); - mwindow->cwindow->update(1, 0, 0); - gui->lock_window("TrackCanvas::do_edit_handles"); - } - gui->timebar->update_highlights(); - gui->zoombar->update(); - gui->cursor->hide(0); - gui->cursor->draw(1); - draw_overlays(); - flash(); - flush(); + rerender = start_selection(position); + update_overlay = 1; } } @@ -4516,6 +4511,8 @@ int TrackCanvas::do_edit_handles(int cursor_x, int TrackCanvas::do_plugin_handles(int cursor_x, int cursor_y, int button_press, + int &rerender, + int &update_overlay, int &new_cursor, int &update_cursor) { @@ -4590,20 +4587,8 @@ int TrackCanvas::do_plugin_handles(int cursor_x, mwindow->session->drag_origin_y = get_cursor_y(); mwindow->session->drag_start = position; - int rerender = start_selection(position); - if(rerender) - { - gui->unlock_window(); - mwindow->cwindow->update(1, 0, 0); - gui->lock_window("TrackCanvas::do_plugin_handles"); - } - gui->timebar->update_highlights(); - gui->zoombar->update(); - gui->cursor->hide(0); - gui->cursor->draw(1); - draw_overlays(); - flash(); - flush(); + rerender = start_selection(position); + update_overlay = 1; } } @@ -5027,6 +5012,8 @@ int TrackCanvas::button_press_event() if(do_edit_handles(cursor_x, cursor_y, 1, + rerender, + update_overlay, new_cursor, update_cursor)) { @@ -5037,6 +5024,8 @@ int TrackCanvas::button_press_event() if(do_plugin_handles(cursor_x, cursor_y, 1, + rerender, + update_overlay, new_cursor, update_cursor)) { @@ -5096,6 +5085,8 @@ int TrackCanvas::button_press_event() if(do_edit_handles(cursor_x, cursor_y, 1, + rerender, + update_overlay, new_cursor, update_cursor)) { @@ -5106,6 +5097,8 @@ int TrackCanvas::button_press_event() if(do_plugin_handles(cursor_x, cursor_y, 1, + rerender, + update_overlay, new_cursor, update_cursor)) { diff --git a/cinelerra/trackcanvas.h b/cinelerra/trackcanvas.h index 569cfca5..c0d7424d 100644 --- a/cinelerra/trackcanvas.h +++ b/cinelerra/trackcanvas.h @@ -243,14 +243,18 @@ public: int do_edit_handles(int cursor_x, int cursor_y, int button_press, - int &redraw, - int &rerender); + int &rerender, + int &update_overlay, + int &new_cursor, + int &update_cursor); // Get plugin and handle the cursor if over int do_plugin_handles(int cursor_x, int cursor_y, int button_press, - int &redraw, - int &rerender); + int &rerender, + int &update_overlay, + int &new_cursor, + int &update_cursor); // Get edit the cursor is over int do_edits(int cursor_x, int cursor_y, -- 2.11.4.GIT