From: Good Guy Date: Wed, 6 May 2020 01:04:58 +0000 (-0600) Subject: add refresh on release to scopewindow X-Git-Tag: 2020-05~10 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=627cc62b6016bc04308043fa5e001e3352b8e558;p=goodguy%2Fcinelerra.git add refresh on release to scopewindow --- diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index 006d6ddc..97ee1ceb 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -1098,6 +1098,7 @@ int CWindowCanvas::scope_on() EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; if( !scope_dialog || !scope_dialog->scope_gui ) return 0; if( scope_dialog->scope_gui->use_refresh ) return 0; + if( scope_dialog->scope_gui->use_release ) return 0; return scope_dialog->running(); } @@ -1107,6 +1108,7 @@ void CWindowCanvas::draw_scope(VFrame *output, int refresh) EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; if( !scope_dialog || !scope_dialog->scope_gui ) return; if( scope_dialog->scope_gui->use_refresh && !refresh ) return; + if( scope_dialog->scope_gui->use_release && refresh >= 0 ) return; scope_dialog->process(output); } @@ -3342,6 +3344,9 @@ int CWindowCanvas::button_release_event() { int result = 0; const char *undo_label = 0; + BC_WindowBase *window = get_canvas(); + if( window && !window->get_video_on() ) + draw_scope(refresh_frame, -1); switch( gui->current_operation ) { case CWINDOW_SCROLL: diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index 2466c150..11e1fc5c 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -1225,6 +1225,7 @@ void EditPanelScopeGUI::create_objects() use_vect_gain = session->use_vect_gain; use_smooth = session->use_smooth; use_refresh = session->use_refresh; + use_release = session->use_release; use_graticule = session->use_graticule; ScopeGUI::create_objects(); } @@ -1241,6 +1242,7 @@ void EditPanelScopeGUI::toggle_event() session->use_vect_gain = use_vect_gain; session->use_smooth = use_smooth; session->use_refresh = use_refresh; + session->use_release = use_release; session->use_graticule = use_graticule; } diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index 555a872e..485a13df 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -110,6 +110,7 @@ MainSession::MainSession(MWindow *mwindow) use_vect_gain = 5; use_smooth = 0; use_refresh = 0; + use_release = 0; use_graticule = 0; afolders_w = 0; show_vwindow = show_awindow = show_cwindow = show_gwindow = show_lwindow = 0; @@ -330,6 +331,7 @@ void MainSession::default_window_positions(int window_config) use_vect_gain = 5; use_smooth = 1; use_refresh = 0; + use_release = 0; use_graticule = 0; if(mwindow->edl) @@ -449,6 +451,7 @@ int MainSession::load_defaults(BC_Hash *defaults) use_vect_gain = defaults->get("USE_VECT_GAIN", use_vect_gain); use_smooth = defaults->get("USE_SMOOTH", use_smooth); use_refresh = defaults->get("USE_REFRESH", use_refresh); + use_release = defaults->get("USE_RELEASE", use_release); use_graticule = defaults->get("USE_GRATICULE", use_graticule); //printf("MainSession::load_defaults 1\n"); @@ -579,6 +582,7 @@ int MainSession::save_defaults(BC_Hash *defaults) defaults->update("USE_VECT_GAIN", use_vect_gain); defaults->update("USE_SMOOTH", use_smooth); defaults->update("USE_REFRESH", use_refresh); + defaults->update("USE_RELEASE", use_release); defaults->update("USE_GRATICULE", use_graticule); defaults->update("ABINS_W", afolders_w); diff --git a/cinelerra-5.1/cinelerra/mainsession.h b/cinelerra-5.1/cinelerra/mainsession.h index 2ed9e5b5..58115d69 100644 --- a/cinelerra-5.1/cinelerra/mainsession.h +++ b/cinelerra-5.1/cinelerra/mainsession.h @@ -176,6 +176,7 @@ public: int use_vect_gain; int use_smooth; int use_refresh; + int use_release; int use_graticule; int afolders_w; diff --git a/cinelerra-5.1/cinelerra/recordscopes.C b/cinelerra-5.1/cinelerra/recordscopes.C index 55f5a0c3..c9bceab9 100644 --- a/cinelerra-5.1/cinelerra/recordscopes.C +++ b/cinelerra-5.1/cinelerra/recordscopes.C @@ -121,6 +121,7 @@ void RecordScopeGUI::create_objects() use_vect_gain = mwindow->session->use_vect_gain; use_smooth = mwindow->session->use_smooth; use_refresh = -1; + use_release = 0; use_graticule = mwindow->session->use_graticule; ScopeGUI::create_objects(); } @@ -137,6 +138,7 @@ void RecordScopeGUI::toggle_event() mwindow->session->use_vect_gain = use_vect_gain; mwindow->session->use_smooth = use_smooth; mwindow->session->use_refresh = 0; + mwindow->session->use_release = 0; mwindow->session->use_graticule = use_graticule; } diff --git a/cinelerra-5.1/cinelerra/scopewindow.C b/cinelerra-5.1/cinelerra/scopewindow.C index 8f693935..b3769673 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.C +++ b/cinelerra-5.1/cinelerra/scopewindow.C @@ -455,6 +455,7 @@ void ScopeGUI::reset() frame_w = 1; use_smooth = 1; use_refresh = 0; + use_release = 0; use_wave_gain = 5; use_vect_gain = 5; use_hist = 0; @@ -919,6 +920,7 @@ void ScopeGUI::process(VFrame *output_frame) void ScopeGUI::update_toggles() { scope_menu->update_toggles(); + settings->update_toggles(); } ScopePanel::ScopePanel(ScopeGUI *gui, int x, int y, int w, int h) @@ -1297,7 +1299,11 @@ int ScopeSettingOn::handle_event() break; case SCOPE_REFRESH: gui->use_refresh = v; + gui->use_release = 0; break; + case SCOPE_RELEASE: + gui->use_release = v; + gui->use_refresh = 0; } gui->toggle_event(); gui->update_toggles(); @@ -1310,6 +1316,8 @@ ScopeSettings::ScopeSettings(ScopeGUI *gui, int x, int y) : BC_PopupMenu(x, y, xS(125), _("Settings")) { this->gui = gui; + refresh_on = 0; + release_on = 0; } void ScopeSettings::create_objects() @@ -1320,7 +1328,10 @@ void ScopeSettings::create_objects() if( gui->use_refresh >= 0 ) { add_item(refresh_on = new ScopeSettingOn(this, _("Refresh on Stop"), SCOPE_REFRESH)); + add_item(release_on = + new ScopeSettingOn(this, _("Refresh on Release"), SCOPE_RELEASE)); refresh_on->set_checked(gui->use_refresh); + release_on->set_checked(gui->use_release); } add_item(new BC_MenuItem(_("-VectorWheel Grids-"))); @@ -1346,6 +1357,14 @@ void ScopeSettings::create_objects() } } +void ScopeSettings::update_toggles() +{ + if( refresh_on ) + refresh_on->set_checked(gui->use_refresh); + if( release_on ) + release_on->set_checked(gui->use_release); +} + ScopeGratItem::ScopeGratItem(ScopeSettings *settings, const char *text, int idx) : BC_MenuItem(text) { diff --git a/cinelerra-5.1/cinelerra/scopewindow.h b/cinelerra-5.1/cinelerra/scopewindow.h index 123f4550..385ecaf2 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.h +++ b/cinelerra-5.1/cinelerra/scopewindow.h @@ -36,7 +36,7 @@ enum { SCOPE_HISTOGRAM, SCOPE_HISTOGRAM_RGB, SCOPE_WAVEFORM, SCOPE_WAVEFORM_RGB, SCOPE_WAVEFORM_PLY, SCOPE_VECTORSCOPE, SCOPE_VECTORWHEEL, - SCOPE_SMOOTH, SCOPE_REFRESH, + SCOPE_SMOOTH, SCOPE_REFRESH, SCOPE_RELEASE, }; // Number of divisions in histogram. @@ -200,10 +200,12 @@ class ScopeSettings : public BC_PopupMenu public: ScopeSettings(ScopeGUI *gui, int x, int y); void create_objects(); + void update_toggles(); ScopeGUI *gui; ScopeSettingOn *smooth_on; ScopeSettingOn *refresh_on; + ScopeSettingOn *release_on; }; @@ -323,7 +325,8 @@ public: int use_hist_parade, use_wave_parade; int bins[HIST_SECTIONS][TOTAL_BINS]; - int frame_w, use_smooth, use_refresh; + int frame_w, use_smooth; + int use_refresh, use_release; int use_wave_gain, use_vect_gain; }; diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 8a3e5888..25404f32 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -832,6 +832,7 @@ int VWindowCanvas::scope_on() EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; if( !scope_dialog || !scope_dialog->scope_gui ) return 0; if( scope_dialog->scope_gui->use_refresh ) return 0; + if( scope_dialog->scope_gui->use_release ) return 0; return scope_dialog->running(); } @@ -841,9 +842,18 @@ void VWindowCanvas::draw_scope(VFrame *output, int refresh) EditPanelScopeDialog *scope_dialog = gui->edit_panel->scope_dialog; if( !scope_dialog || !scope_dialog->scope_gui ) return; if( scope_dialog->scope_gui->use_refresh && !refresh ) return; + if( scope_dialog->scope_gui->use_release && refresh >= 0 ) return; scope_dialog->process(output); } +int VWindowCanvas::button_release_event() +{ + BC_WindowBase *window = get_canvas(); + if( window && !window->get_video_on() ) + draw_scope(refresh_frame, -1); + return Canvas::button_release_event(); +} + void VWindowCanvas::draw_refresh(int flush) { if( !get_canvas()->get_video_on() ) { diff --git a/cinelerra-5.1/cinelerra/vwindowgui.h b/cinelerra-5.1/cinelerra/vwindowgui.h index d56cc052..d4c395f7 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.h +++ b/cinelerra-5.1/cinelerra/vwindowgui.h @@ -113,6 +113,7 @@ class VWindowCanvas : public Canvas public: VWindowCanvas(MWindow *mwindow, VWindowGUI *gui); void create_objects(EDL *edl); + int button_release_event(); void zoom_resize_window(float percentage); int scope_on(); void draw_scope(VFrame *output, int refresh); diff --git a/cinelerra-5.1/plugins/videoscope/videoscope.C b/cinelerra-5.1/plugins/videoscope/videoscope.C index 533f4812..4bd46678 100644 --- a/cinelerra-5.1/plugins/videoscope/videoscope.C +++ b/cinelerra-5.1/plugins/videoscope/videoscope.C @@ -110,6 +110,7 @@ void VideoScopeWindow::create_objects() use_vect_gain = plugin->use_vect_gain; use_smooth = plugin->use_smooth; use_refresh = -1; + use_release = 0; use_graticule = plugin->use_graticule; ScopeGUI::create_objects();