From: Good Guy Date: Sat, 8 Dec 2018 18:26:51 +0000 (-0700) Subject: fixes for full timeline updates, replace nums with syms for update interface X-Git-Tag: 2019-08~160 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=3fc547b01e919d3044bacf2a78baddeaed04e3a0;p=goodguy%2Fcinelerra.git fixes for full timeline updates, replace nums with syms for update interface --- diff --git a/cinelerra-5.1/cinelerra/assetedit.C b/cinelerra-5.1/cinelerra/assetedit.C index 4df0f70a..c5875635 100644 --- a/cinelerra-5.1/cinelerra/assetedit.C +++ b/cinelerra-5.1/cinelerra/assetedit.C @@ -146,7 +146,7 @@ void AssetEdit::handle_close_event(int result) } //printf("AssetEdit::handle_close_event %d\n", __LINE__); - mwindow->gui->update(0, 2, 0, 0, 0, 0, 0); + mwindow->gui->update(0, FORCE_REDRAW, 0, 0, 0, 0, 0); //printf("AssetEdit::handle_close_event %d\n", __LINE__); // Start index rebuilding diff --git a/cinelerra-5.1/cinelerra/ctimebar.C b/cinelerra-5.1/cinelerra/ctimebar.C index 6929cc12..b9fb0bde 100644 --- a/cinelerra-5.1/cinelerra/ctimebar.C +++ b/cinelerra-5.1/cinelerra/ctimebar.C @@ -30,6 +30,7 @@ #include "mwindow.h" #include "mwindowgui.h" #include "theme.h" +#include "trackcanvas.inc" CTimeBar::CTimeBar(MWindow *mwindow, CWindowGUI *gui, @@ -118,8 +119,7 @@ void CTimeBar::select_label(double position) mwindow->gui->lock_window(); mwindow->gui->hide_cursor(0); mwindow->gui->draw_cursor(1); - mwindow->gui->update(0, 1, // 1 for incremental drawing. 2 for full refresh - 1, 0, 1, 1, 0); + mwindow->gui->update(0, NORMAL_DRAW, 1, 0, 1, 1, 0); mwindow->gui->unlock_window(); mwindow->update_plugin_guis(); //printf("CTimeBar::select_label 2\n"); diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index bd02e239..e800cbbe 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -722,7 +722,7 @@ int CWindowGUI::drag_stop() { mwindow->save_backup(); mwindow->restart_brender(); - mwindow->gui->update(1, 1, 1, 1, 0, 1, 0); + mwindow->gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0); mwindow->undo->update_undo_after(_("insert assets"), LOAD_ALL); mwindow->gui->unlock_window(); mwindow->sync_parameters(CHANGE_ALL); diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index b539bda4..530d530c 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -440,7 +440,7 @@ void EditPanel::set_position(double position) edl->local_session->set_selectionend(position); mwindow->gui->lock_window(); mwindow->find_cursor(); - mwindow->gui->update(1, 1, 1, 1, 1, 1, 0); + mwindow->gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); mwindow->gui->unlock_window(); mwindow->cwindow->update(1, 0, 0, 0, 0); } diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index 31f79e34..ce888faf 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -629,7 +629,7 @@ int GWindowToggle::handle_event() MWindow *mwindow = gui->mwindow; mwindow->gui->lock_window("GWindowToggle::handle_event"); - mwindow->gui->update(1, 1, 0, 0, 1, 0, 0); + mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); mwindow->gui->draw_overlays(1); if( value && info->isauto > 0 ) { diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index 7624da16..123a6eb6 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -128,7 +128,7 @@ int KeyframePopup::update(Automation *automation, Autos *autos, Auto *auto_keyfr mwindow->edl->local_session->set_selectionstart(new_position); mwindow->edl->local_session->set_selectionend(new_position); mwindow->gui->lock_window(); - mwindow->gui->update(1, 1, 1, 1, 1, 1, 0); + mwindow->gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); mwindow->gui->unlock_window(); } return 0; @@ -196,7 +196,7 @@ int KeyframePopupDelete::handle_event() mwindow->undo->update_undo_after(_("delete keyframe"), LOAD_ALL); mwindow->save_backup(); - mwindow->gui->update(0, 1, // 1 for incremental drawing. 2 for full refresh + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); mwindow->update_plugin_guis(); mwindow->restart_brender(); @@ -484,7 +484,7 @@ int KeyframePopupCurveMode::handle_event() mwindow->undo->update_undo_after(_("change keyframe curve mode"), LOAD_ALL); mwindow->save_backup(); - mwindow->gui->update(0, 1, 0,0,0,0,0); // incremental redraw for canvas + mwindow->gui->update(0, NORMAL_DRAW, 0,0,0,0,0); // incremental redraw for canvas mwindow->cwindow->update(0,0, 1, 0,0); // redraw tool window in compositor mwindow->update_plugin_guis(); mwindow->restart_brender(); diff --git a/cinelerra-5.1/cinelerra/menueffects.C b/cinelerra-5.1/cinelerra/menueffects.C index 92217a6b..12ae34e1 100644 --- a/cinelerra-5.1/cinelerra/menueffects.C +++ b/cinelerra-5.1/cinelerra/menueffects.C @@ -518,7 +518,7 @@ void MenuEffectThread::run() mwindow->restart_brender(); mwindow->update_plugin_guis(); - mwindow->gui->update(1, 2, 1, 1, 1, 1, 0); + mwindow->gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); mwindow->sync_parameters(CHANGE_ALL); mwindow->gui->unlock_window(); diff --git a/cinelerra-5.1/cinelerra/mtimebar.C b/cinelerra-5.1/cinelerra/mtimebar.C index 94e7f2d1..8889cc87 100644 --- a/cinelerra-5.1/cinelerra/mtimebar.C +++ b/cinelerra-5.1/cinelerra/mtimebar.C @@ -675,7 +675,7 @@ TimeBarPopupItem::TimeBarPopupItem(MWindow *mwindow, int TimeBarPopupItem::handle_event() { mwindow->edl->session->time_format = value; - mwindow->gui->update(0, 0, 1, 0, 0, 1, 0); + mwindow->gui->update(0, NO_DRAW, 1, 0, 0, 1, 0); mwindow->gui->redraw_time_dependancies(); return 1; } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 3f67230e..07035302 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1388,7 +1388,7 @@ void MWindow::create_mixers() save_backup(); undo->update_undo_after(_("create mixers"), LOAD_ALL); restart_brender(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); sync_parameters(CHANGE_ALL); } @@ -2978,7 +2978,7 @@ void MWindow::set_auto_visibility(Autos *autos, int value) else return; - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->mainmenu->update_toggles(1); gui->unlock_window(); gwindow->gui->update_toggles(1); @@ -3219,7 +3219,7 @@ void MWindow::hide_plugin(Plugin *plugin, int lock) plugin->show = 0; // Update the toggle gui->lock_window("MWindow::hide_plugin"); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); if(lock) plugin_gui_lock->lock("MWindow::hide_plugin"); @@ -3550,7 +3550,7 @@ void MWindow::update_project(int load_mode) gui->load_panes(); } - gui->update(1, 1, 1, 1, 1, 1, 1); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 1); if(debug) PRINT_TRACE gui->unlock_window(); init_brender(); @@ -4055,7 +4055,7 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, restart_brender(); gui->lock_window("MWindow::remove_assets_from_project 3"); - gui->update(1, 1, 1, 1, 0, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0); gui->unlock_window(); // Removes from playback here @@ -4381,7 +4381,7 @@ void MWindow::resync_guis() // Update GUIs restart_brender(); gui->lock_window("MWindow::resync_guis"); - gui->update(1, 1, 1, 1, 1, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0); gui->unlock_window(); cwindow->gui->lock_window("MWindow::resync_guis"); diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index f74bfa0c..3d6a69f0 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -88,7 +88,7 @@ void MWindow::add_audio_track_entry(int above, Track *dst) undo->update_undo_after(_("add track"), LOAD_ALL); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); gui->activate_timeline(); // gui->get_scrollbars(0); @@ -108,7 +108,7 @@ void MWindow::add_video_track_entry(Track *dst) restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); gui->activate_timeline(); // gui->get_scrollbars(0); // gui->canvas->draw(); @@ -128,7 +128,7 @@ void MWindow::add_subttl_track_entry(Track *dst) restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); gui->activate_timeline(); // gui->get_scrollbars(0); // gui->canvas->draw(); @@ -230,7 +230,7 @@ void MWindow::asset_to_all() undo->update_undo_after(_("asset to all"), LOAD_ALL); restart_brender(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); sync_parameters(CHANGE_ALL); } } @@ -290,7 +290,7 @@ void MWindow::asset_to_rate() undo->update_undo_after(_("asset to rate"), LOAD_ALL); restart_brender(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); sync_parameters(CHANGE_ALL); } } @@ -307,7 +307,7 @@ void MWindow::clear_entry() restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); cwindow->refresh_frame(CHANGE_EDL); } @@ -330,7 +330,7 @@ void MWindow::update_gui(int changed_edl) restart_brender(); update_plugin_guis(); if( changed_edl ) { - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); cwindow->refresh_frame(CHANGE_EDL); } @@ -415,7 +415,7 @@ void MWindow::concatenate_tracks() undo->update_undo_after(_("concatenate tracks"), LOAD_EDITS); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); cwindow->refresh_frame(CHANGE_EDL); } @@ -535,7 +535,7 @@ void MWindow::blade(double position) undo->update_undo_after(_("blade"), LOAD_EDITS | LOAD_TIMEBAR); restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); awindow->gui->async_update_assets(); cwindow->refresh_frame(CHANGE_EDL); @@ -559,7 +559,7 @@ void MWindow::cut(double start, double end, double new_position) } restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); awindow->gui->async_update_assets(); cwindow->refresh_frame(CHANGE_EDL); @@ -650,7 +650,7 @@ void MWindow::delete_tracks() restart_brender(); update_plugin_states(); - gui->update(1, 1, 1, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 1, 0, 1, 0, 0); cwindow->refresh_frame(CHANGE_EDL); } @@ -663,7 +663,7 @@ void MWindow::delete_track(Track *track) restart_brender(); update_plugin_states(); - gui->update(1, 1, 1, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 1, 0, 1, 0, 0); cwindow->refresh_frame(CHANGE_EDL); save_backup(); } @@ -758,7 +758,7 @@ void MWindow::insert_effects_cwindow(Track *dest_track) undo->update_undo_after(_("insert effect"), LOAD_EDITS | LOAD_PATCHES); restart_brender(); sync_parameters(CHANGE_EDL); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); } void MWindow::insert_effect(char *title, @@ -884,7 +884,7 @@ void MWindow::finish_modify_handles() restart_brender(); sync_parameters(CHANGE_EDL); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); // label list can be modified awindow->gui->async_update_assets(); cwindow->update(1, 0, 0, 0, 1); @@ -925,8 +925,7 @@ void MWindow::move_edits(ArrayList *edits, cwindow->refresh_frame(CHANGE_EDL); update_plugin_guis(); - gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh - 1, 0, 0, 0, 0); + gui->update(1, NORMAL_DRAW, 1, 0, 0, 0, 0); } void MWindow::move_effect(Plugin *plugin, Track *track, int64_t position) @@ -939,8 +938,7 @@ void MWindow::move_effect(Plugin *plugin, Track *track, int64_t position) restart_brender(); cwindow->refresh_frame(CHANGE_EDL); update_plugin_guis(); - gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh - 0, 0, 0, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 0, 0, 0); } void MWindow::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position) @@ -953,8 +951,7 @@ void MWindow::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t positio restart_brender(); cwindow->refresh_frame(CHANGE_EDL); update_plugin_guis(); - gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh - 0, 0, 0, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 0, 0, 0); } void MWindow::move_plugins_up(PluginSet *plugin_set) @@ -966,8 +963,7 @@ void MWindow::move_plugins_up(PluginSet *plugin_set) save_backup(); undo->update_undo_after(_("move effect up"), LOAD_ALL); restart_brender(); - gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh - 0, 0, 0, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 0, 0, 0); sync_parameters(CHANGE_EDL); } @@ -980,8 +976,7 @@ void MWindow::move_plugins_down(PluginSet *plugin_set) save_backup(); undo->update_undo_after(_("move effect down"), LOAD_ALL); restart_brender(); - gui->update(1, 1, // 1 for incremental drawing. 2 for full refresh - 0, 0, 0, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 0, 0, 0); sync_parameters(CHANGE_EDL); } @@ -993,7 +988,7 @@ void MWindow::move_track_down(Track *track) undo->update_undo_after(_("move track down"), LOAD_ALL); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); sync_parameters(CHANGE_EDL); save_backup(); } @@ -1006,7 +1001,7 @@ void MWindow::move_tracks_down() undo->update_undo_after(_("move tracks down"), LOAD_ALL); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); sync_parameters(CHANGE_EDL); save_backup(); } @@ -1018,7 +1013,7 @@ void MWindow::move_track_up(Track *track) save_backup(); undo->update_undo_after(_("move track up"), LOAD_ALL); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); sync_parameters(CHANGE_EDL); save_backup(); } @@ -1030,7 +1025,7 @@ void MWindow::move_tracks_up() save_backup(); undo->update_undo_after(_("move tracks up"), LOAD_ALL); restart_brender(); - gui->update(1, 1, 0, 0, 1, 0, 0); + gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); sync_parameters(CHANGE_EDL); } @@ -1055,7 +1050,7 @@ void MWindow::mute_selection() restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->refresh_frame(CHANGE_EDL); } } @@ -1105,7 +1100,7 @@ void MWindow::overwrite(EDL *source, int all) restart_brender(); update_plugin_guis(); - gui->update(1, 1, 1, 1, 0, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0); sync_parameters(CHANGE_EDL); } @@ -1156,7 +1151,7 @@ void MWindow::paste() undo->update_undo_after(_("paste"), LOAD_EDITS | LOAD_TIMEBAR); restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 0, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 0, 1, 0); awindow->gui->async_update_assets(); sync_parameters(CHANGE_EDL); } @@ -1192,7 +1187,7 @@ int MWindow::paste_assets(double position, Track *dest_track, int overwrite) undo->update_undo_after(_("paste assets"), LOAD_EDITS); restart_brender(); - gui->update(1, 2, 1, 0, 0, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 0, 0, 1, 0); sync_parameters(CHANGE_EDL); return result; } @@ -1619,7 +1614,7 @@ void MWindow::paste_silence() update_plugin_guis(); restart_brender(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); cwindow->refresh_frame(CHANGE_EDL); } @@ -1634,7 +1629,7 @@ void MWindow::detach_transition(Transition *transition) undo->update_undo_after(_("detach transition"), LOAD_ALL); if( is_video ) restart_brender(); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); sync_parameters(CHANGE_EDL); } @@ -1651,7 +1646,7 @@ void MWindow::detach_transitions() undo->update_undo_after(_("detach transitions"), LOAD_EDITS); sync_parameters(CHANGE_EDL); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); } @@ -1681,7 +1676,7 @@ void MWindow::paste_transitions(int track_type, char *title) undo->update_undo_after(_("attach transitions"), LOAD_EDITS); sync_parameters(CHANGE_EDL); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); } @@ -1693,7 +1688,7 @@ void MWindow::paste_transition_cwindow(Track *dest_track) save_backup(); undo->update_undo_after(_("transition"), LOAD_EDITS); restart_brender(); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); sync_parameters(CHANGE_ALL); } @@ -1714,7 +1709,7 @@ void MWindow::paste_audio_transition() undo->update_undo_after(_("transition"), LOAD_EDITS); sync_parameters(CHANGE_EDL); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); } void MWindow::paste_video_transition() @@ -1736,7 +1731,7 @@ void MWindow::paste_video_transition() sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); } void MWindow::shuffle_edits() @@ -1754,7 +1749,7 @@ void MWindow::shuffle_edits() sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 1, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 1, 0, 0, 0, 0); gui->unlock_window(); } @@ -1773,7 +1768,7 @@ void MWindow::reverse_edits() sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 1, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 1, 0, 0, 0, 0); gui->unlock_window(); } @@ -1792,7 +1787,7 @@ void MWindow::align_edits() sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 1, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 1, 0, 0, 0, 0); gui->unlock_window(); } @@ -1811,7 +1806,7 @@ void MWindow::set_edit_length(double length) sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 1, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 1, 0, 0, 0, 0); gui->unlock_window(); } @@ -1831,7 +1826,7 @@ void MWindow::set_transition_length(Transition *transition, double length) edl->session->default_transition_length = length; sync_parameters(CHANGE_PARAMS); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); } @@ -1851,7 +1846,7 @@ void MWindow::set_transition_length(double length) edl->session->default_transition_length = length; sync_parameters(CHANGE_PARAMS); restart_brender(); - gui->update(0, 1, 0, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); gui->unlock_window(); } @@ -1880,7 +1875,7 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) update_plugin_states(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 1); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 1); gui->update_proxy_toggle(); gui->unlock_window(); cwindow->update(1, 1, 1, 1, 1); @@ -2021,7 +2016,7 @@ void MWindow::splice(EDL *source, int all) undo->update_undo_after(_("splice"), LOAD_EDITS | LOAD_TIMEBAR); update_plugin_guis(); restart_brender(); - gui->update(1, 1, 1, 1, 0, 1, 0); + gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0); sync_parameters(CHANGE_EDL); } @@ -2175,7 +2170,7 @@ void MWindow::trim_selection() save_backup(); undo->update_undo_after(_("trim selection"), LOAD_EDITS | LOAD_TIMEBAR); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); awindow->gui->async_update_assets(); restart_brender(); @@ -2207,7 +2202,7 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui) update_plugin_states(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 1); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 1); gui->update_proxy_toggle(); gui->unlock_window(); cwindow->update(1, 1, 1, 1, 1); @@ -2283,7 +2278,7 @@ void MWindow::map_audio(int pattern) pattern == MWindow::AUDIO_1_TO_1 ? _("map 1:1") : _("map 5.1:2"), LOAD_AUTOMATION); sync_parameters(CHANGE_PARAMS); - gui->update(0, 1, 0, 0, 1, 0, 0); + gui->update(0, NORMAL_DRAW, 0, 0, 1, 0, 0); } void MWindow::remap_audio(int pattern) @@ -2357,7 +2352,7 @@ void MWindow::cut_commercials() restart_brender(); update_plugin_guis(); - gui->update(1, 2, 1, 1, 1, 1, 0); + gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); cwindow->update(1, 0, 0, 0, 1); cwindow->refresh_frame(CHANGE_EDL); #endif diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 70c4808a..36532ac7 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -698,28 +698,17 @@ void MWindowGUI::draw_indexes(Indexable *indexable) } } -void MWindowGUI::draw_canvas(int mode /* = 0 */, int hide_cursor /* = 1 */) +void MWindowGUI::draw_canvas(int redraw, int hide_cursor) { - if(mode != IGNORE_THREAD) - { - resource_thread->stop_draw(1); - } + resource_thread->stop_draw(0); - - for(int i = 0; i < TOTAL_PANES; i++) - { - if(pane[i]) - { + int mode = redraw ? FORCE_REDRAW : NORMAL_DRAW; + for(int i = 0; i < TOTAL_PANES; i++) { + if( pane[i] ) pane[i]->canvas->draw(mode, hide_cursor); - } - } - - - if(mode != IGNORE_THREAD) - { - resource_thread->start_draw(); } + resource_thread->start_draw(); } void MWindowGUI::flash_canvas(int flush) @@ -801,7 +790,7 @@ void MWindowGUI::update_scrollbars(int flush) { if(pane[i]) { - pane[i]->update(1, 0, 0, 0); + pane[i]->update(1, NO_DRAW, 0, 0); } } if(flush) this->flush(); @@ -877,10 +866,8 @@ void MWindowGUI::update(int scrollbars, mwindow->edl->tracks->update_y_pixels(mwindow->theme); - if(do_canvas && do_canvas != IGNORE_THREAD) - { + if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD ) resource_thread->stop_draw(1); - } for(int i = 0; i < TOTAL_PANES; i++) { @@ -890,10 +877,8 @@ void MWindowGUI::update(int scrollbars, patchbay); } - if(do_canvas && do_canvas != IGNORE_THREAD) - { + if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD ) resource_thread->start_draw(); - } // if(scrollbars) this->get_scrollbars(0); // if(timebar) this->timebar->update(0); @@ -923,8 +908,7 @@ void MWindowGUI::update(int scrollbars, // Can't age if the cache called this to draw missing picons // or the GUI is updating the status of the draw toggle. - if(do_canvas != FORCE_REDRAW && do_canvas != IGNORE_THREAD) - { + if( do_canvas != FORCE_REDRAW && do_canvas != IGNORE_THREAD ) { unlock_window(); mwindow->age_caches(); lock_window("MWindowGUI::update"); @@ -1304,7 +1288,7 @@ int MWindowGUI::keypress_event() if( !selected && this_track ) this_track->record = 1; } - update(0, 1, 0, 0, 1, 0, 1); + update(0, NORMAL_DRAW, 0, 0, 1, 0, 1); unlock_window(); mwindow->cwindow->update(0, 1, 1); lock_window("MWindowGUI::keypress_event 3"); @@ -1842,7 +1826,7 @@ void MWindowGUI::delete_y_pane(int cursor_y) void MWindowGUI::stop_pane_drag() { dragging_pane = 0; - resource_thread->stop_draw(1); + resource_thread->stop_draw(0); if(x_pane_drag) { diff --git a/cinelerra-5.1/cinelerra/mwindowgui.h b/cinelerra-5.1/cinelerra/mwindowgui.h index ee920186..6484dc81 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.h +++ b/cinelerra-5.1/cinelerra/mwindowgui.h @@ -111,9 +111,11 @@ public: int focus_in_event(); int focus_out_event(); -// do_canvas - 1 for incremental drawing of resources -// FORCE_REDRAW for delete and redraw of resources -// IGNORE_THREAD to ignore picon thread +// do_canvas - +// NO_DRAW disable canvas draw +// IGNORE_THREAD to ignore picon thread +// NORMAL_DRAW for incremental drawing of resources +// FORCE_REDRAW for delete and redraw of resources void update(int scrollbars, int do_canvas, int timebar, @@ -130,7 +132,7 @@ public: void update_proxy_toggle(); void update_plugintoggles(); void update_scrollbars(int flush); - void draw_canvas(int mode, int hide_cursor); + void draw_canvas(int redraw, int hide_cursor); void flash_canvas(int flush); int show_window(int flush=1); void deactivate_timeline(); diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index c55f6228..5fafa512 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -577,7 +577,7 @@ void MWindow::select_all() edl->local_session->set_selectionstart(0); edl->local_session->set_selectionend(edl->tracks->total_length()); } - gui->update(0, 1, 1, 1, 0, 1, 0); + gui->update(0, NORMAL_DRAW, 1, 1, 0, 1, 0); gui->activate_timeline(); cwindow->update(1, 0, 0, 0, 1); update_plugin_guis(); diff --git a/cinelerra-5.1/cinelerra/patchgui.C b/cinelerra-5.1/cinelerra/patchgui.C index f7f4c7e2..169ff600 100644 --- a/cinelerra-5.1/cinelerra/patchgui.C +++ b/cinelerra-5.1/cinelerra/patchgui.C @@ -254,7 +254,7 @@ void PatchGUI::toggle_behavior(int type, break; case Tracks::DRAW: - mwindow->gui->update(0, 1, 0, 0, 0, 0, 0); + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); break; case Tracks::EXPAND: diff --git a/cinelerra-5.1/cinelerra/plugindialog.C b/cinelerra-5.1/cinelerra/plugindialog.C index ad964d52..89de2f99 100644 --- a/cinelerra-5.1/cinelerra/plugindialog.C +++ b/cinelerra-5.1/cinelerra/plugindialog.C @@ -175,14 +175,7 @@ void PluginDialogThread::handle_close_event(int result) mwindow->restart_brender(); mwindow->update_plugin_states(); mwindow->sync_parameters(CHANGE_EDL); - mwindow->gui->update(1, - 1, - 0, - 0, - 1, - 0, - 0); - + mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); mwindow->gui->unlock_window(); } } diff --git a/cinelerra-5.1/cinelerra/pluginpopup.C b/cinelerra-5.1/cinelerra/pluginpopup.C index 961f46b9..0421531a 100644 --- a/cinelerra-5.1/cinelerra/pluginpopup.C +++ b/cinelerra-5.1/cinelerra/pluginpopup.C @@ -140,13 +140,7 @@ int PluginPopupDetach::handle_event() mwindow->gui->lock_window("PluginPopupDetach::handle_event"); - mwindow->gui->update(0, - 1, - 0, - 0, - 0, - 0, - 0); + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); mwindow->gui->unlock_window(); mwindow->restart_brender(); mwindow->sync_parameters(CHANGE_EDL); @@ -217,7 +211,7 @@ PluginPopupShow::~PluginPopupShow() int PluginPopupShow::handle_event() { mwindow->show_plugin(popup->plugin); - mwindow->gui->update(0, 1, 0, 0, 0, 0, 0); + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); return 1; } @@ -238,7 +232,7 @@ PluginPopupOn::~PluginPopupOn() int PluginPopupOn::handle_event() { popup->plugin->on = !get_checked(); - mwindow->gui->update(0, 1, 0, 0, 0, 0, 0); + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); mwindow->restart_brender(); mwindow->sync_parameters(CHANGE_EDL); return 1; diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 31bd5b8a..28b5ecc3 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -329,7 +329,7 @@ int PreferencesThread::apply_settings() if(redraw_times) { mwindow->gui->lock_window("PreferencesThread::apply_settings 3"); - mwindow->gui->update(0, 0, 1, 0, 0, 1, 0); + mwindow->gui->update(0, NO_DRAW, 1, 0, 0, 1, 0); mwindow->gui->redraw_time_dependancies(); mwindow->gui->unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/record.C b/cinelerra-5.1/cinelerra/record.C index 96ec0f82..76990e67 100644 --- a/cinelerra-5.1/cinelerra/record.C +++ b/cinelerra-5.1/cinelerra/record.C @@ -432,7 +432,7 @@ void Record::run() mwindow->undo->update_undo_after(_("record"), LOAD_ALL); mwindow->restart_brender(); mwindow->update_plugin_guis(); - mwindow->gui->update(1, 2, 1, 1, 1, 1, 0); + mwindow->gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); mwindow->sync_parameters(CHANGE_ALL); } mwindow->gui->unlock_window(); diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index e7b3e12d..7bfb1f76 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -948,13 +948,7 @@ if(debug) printf("Render::render %d\n", __LINE__); if(debug) printf("Render::render %d\n", __LINE__); mwindow->update_plugin_guis(); if(debug) printf("Render::render %d\n", __LINE__); - mwindow->gui->update(1, - 2, - 1, - 1, - 1, - 1, - 0); + mwindow->gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0); if(debug) printf("Render::render %d\n", __LINE__); mwindow->sync_parameters(CHANGE_ALL); if(debug) printf("Render::render %d\n", __LINE__); diff --git a/cinelerra-5.1/cinelerra/resourcethread.C b/cinelerra-5.1/cinelerra/resourcethread.C index 70138be0..ae861e96 100644 --- a/cinelerra-5.1/cinelerra/resourcethread.C +++ b/cinelerra-5.1/cinelerra/resourcethread.C @@ -270,8 +270,10 @@ void ResourceThread::stop_draw(int reset) //printf("ResourceThread::stop_draw %d %d\n", __LINE__, reset); //BC_Signals::dump_stack(); - if(reset) items.remove_all_objects(); - operation_count++; + if( reset ) { + items.remove_all_objects(); + ++operation_count; + } item_lock->unlock(); prev_x = -1; prev_h = 0; @@ -757,7 +759,7 @@ void ResourceThread::do_audio(AResourceThreadItem *item) low); if(timer->get_difference() > 250 || item->last) { - mwindow->gui->update(0, 3, 0, 0, 0, 0, 0); + mwindow->gui->update(0, IGNORE_THREAD, 0, 0, 0, 0, 0); timer->update(); } } diff --git a/cinelerra-5.1/cinelerra/swindow.C b/cinelerra-5.1/cinelerra/swindow.C index 1604d8db..e7ab36c2 100644 --- a/cinelerra-5.1/cinelerra/swindow.C +++ b/cinelerra-5.1/cinelerra/swindow.C @@ -461,7 +461,7 @@ int MWindow::paste_subtitle_text(char *text, double start, double end) sync_parameters(CHANGE_EDL); restart_brender(); - gui->update(0, 1, 1, 0, 0, 0, 0); + gui->update(0, NORMAL_DRAW, 1, 0, 0, 0, 0); gui->unlock_window(); return 0; diff --git a/cinelerra-5.1/cinelerra/timelinepane.C b/cinelerra-5.1/cinelerra/timelinepane.C index 09455b84..466b5332 100644 --- a/cinelerra-5.1/cinelerra/timelinepane.C +++ b/cinelerra-5.1/cinelerra/timelinepane.C @@ -288,15 +288,13 @@ void TimelinePane::update(int scrollbars, int patchbay) { if(timebar && this->timebar) this->timebar->update(0); - if(scrollbars) - { + if(scrollbars) { if(samplescroll && this->samplescroll) samplescroll->set_position(); if(trackscroll && this->trackscroll) trackscroll->set_position(); } if(patchbay && this->patchbay) this->patchbay->update(); - if(do_canvas) - { + if( do_canvas != NO_DRAW ) { this->canvas->draw(do_canvas, 1); this->cursor->show(); this->canvas->flash(0); diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index b2510711..c746de71 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -144,7 +144,7 @@ void TrackCanvas::create_objects() pankeyframe_pixmap = new BC_Pixmap(this, mwindow->theme->pankeyframe_data, PIXMAP_ALPHA); projectorkeyframe_pixmap = new BC_Pixmap(this, mwindow->theme->projectorkeyframe_data, PIXMAP_ALPHA); maskkeyframe_pixmap = new BC_Pixmap(this, mwindow->theme->maskkeyframe_data, PIXMAP_ALPHA); - draw(); + draw(NORMAL_DRAW, 1); update_cursor(0); flash(0); } @@ -152,7 +152,7 @@ void TrackCanvas::create_objects() void TrackCanvas::resize_event() { //printf("TrackCanvas::resize_event 1\n"); - draw(0, 0); + draw(NORMAL_DRAW, 0); flash(0); //printf("TrackCanvas::resize_event 2\n"); } @@ -650,7 +650,6 @@ void TrackCanvas::draw(int mode, int hide_cursor) { const int debug = 0; - // Swap pixmap layers if(get_w() != background_pixmap->get_w() || get_h() != background_pixmap->get_h()) @@ -699,7 +698,7 @@ void TrackCanvas::draw_indexes(Indexable *indexable) // Don't redraw raw samples if(index_state->index_zoom > mwindow->edl->local_session->zoom_sample) return; - draw_resources(0, 1, indexable); + draw_resources(NORMAL_DRAW, 1, indexable); draw_overlays(); flash(0); } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index b42660c5..d6787999 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -43,20 +43,13 @@ #include "resourcepixmap.inc" #include "timelinepane.inc" #include "track.inc" +#include "trackcanvas.inc" #include "tracks.inc" #include "transitionhandles.inc" #include "keyframe.inc" #include -// draw mode: -// NORMAL_DRAW causes incremental drawing of pixmaps. Used for navigation and index refresh. -// FORCE_REDRAW causes all resource pixmaps to be redrawn from scratch. Used by editing. -// IGNORE_THREAD causes resource pixmaps to ignore picon thread. Used by Piconthread. -#define NORMAL_DRAW 1 -#define FORCE_REDRAW 2 -#define IGNORE_THREAD 3 - class TrackCanvas : public BC_SubWindow { public: @@ -273,7 +266,7 @@ public: void update_transitions(); void update_keyframe_handles(Track *track); // Draw everything to synchronize with the view. - void draw(int mode = 0, int hide_cursor = 1); + void draw(int mode, int hide_cursor); // Draw resources during index building void draw_indexes(Indexable *indexable); // Get location of edit on screen without boundary checking diff --git a/cinelerra-5.1/cinelerra/trackcanvas.inc b/cinelerra-5.1/cinelerra/trackcanvas.inc index 8d31d86a..96c6c8c5 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.inc +++ b/cinelerra-5.1/cinelerra/trackcanvas.inc @@ -27,4 +27,14 @@ class TrackCanvas; #define HANDLE_W 8 #define HANDLE_H 8 +// draw mode: +// NO_DRAW used in MWindowGUI/TimelinePane update to disable canvas update +// NORMAL_DRAW causes incremental drawing of pixmaps. Used for navigation and index refresh. +// FORCE_REDRAW causes all resource pixmaps to be redrawn from scratch. Used by editing. +// IGNORE_THREAD causes resource pixmaps to ignore picon thread. Used by Piconthread. +#define NO_DRAW 0 +#define NORMAL_DRAW 1 +#define FORCE_REDRAW 2 +#define IGNORE_THREAD 3 + #endif diff --git a/cinelerra-5.1/cinelerra/transitionpopup.C b/cinelerra-5.1/cinelerra/transitionpopup.C index 97e5eeb7..c5d82b4b 100644 --- a/cinelerra-5.1/cinelerra/transitionpopup.C +++ b/cinelerra-5.1/cinelerra/transitionpopup.C @@ -159,7 +159,7 @@ int TransitionLengthText::handle_event() { gui->thread->length = result; mwindow->gui->lock_window(); - mwindow->gui->update(0, 1, 0, 0, 0, 0, 0); + mwindow->gui->update(0, NORMAL_DRAW, 0, 0, 0, 0, 0); mwindow->gui->unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/viewmenu.C b/cinelerra-5.1/cinelerra/viewmenu.C index 206faf43..6a2df105 100644 --- a/cinelerra-5.1/cinelerra/viewmenu.C +++ b/cinelerra-5.1/cinelerra/viewmenu.C @@ -43,7 +43,7 @@ int ShowAssets::handle_event() { set_checked(get_checked() ^ 1); mwindow->edl->session->show_assets = get_checked(); - mwindow->gui->update(1, 1, 0, 0, 1, 0, 0); + mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); mwindow->gui->unlock_window(); mwindow->gwindow->gui->update_toggles(1); mwindow->gui->lock_window("ShowAssets::handle_event"); @@ -64,7 +64,7 @@ int ShowTitles::handle_event() { set_checked(get_checked() ^ 1); mwindow->edl->session->show_titles = get_checked(); - mwindow->gui->update(1, 1, 0, 0, 1, 0, 0); + mwindow->gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0); mwindow->gui->unlock_window(); mwindow->gwindow->gui->update_toggles(1); mwindow->gui->lock_window("ShowTitles::handle_event");