add refresh on release to scopewindow
authorGood Guy <good1.2guy@gmail.com>
Wed, 6 May 2020 01:04:58 +0000 (19:04 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 6 May 2020 01:04:58 +0000 (19:04 -0600)
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/editpanel.C
cinelerra-5.1/cinelerra/mainsession.C
cinelerra-5.1/cinelerra/mainsession.h
cinelerra-5.1/cinelerra/recordscopes.C
cinelerra-5.1/cinelerra/scopewindow.C
cinelerra-5.1/cinelerra/scopewindow.h
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/cinelerra/vwindowgui.h
cinelerra-5.1/plugins/videoscope/videoscope.C

index 006d6ddc59f148e764d5d55d8af2eb44242fc86b..97ee1ceb260b02849b6f7e0c3545c92674cfc748 100644 (file)
@@ -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:
index 2466c1502cf412f1a06323763e5c8dcc2e18bbba..11e1fc5c84609142bdc9af982999c03c3cedf395 100644 (file)
@@ -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;
 }
 
index 555a872e0b34667cb2e6322f61a9343f0a667200..485a13df53d219630affebc33ec0c5ad19f1a3fd 100644 (file)
@@ -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);
index 2ed9e5b5adbd134a9c586d929269ae9560dbb6af..58115d69fc313b3b1b13d069ec0d04baef702149 100644 (file)
@@ -176,6 +176,7 @@ public:
        int use_vect_gain;
        int use_smooth;
        int use_refresh;
+       int use_release;
        int use_graticule;
 
        int afolders_w;
index 55f5a0c3a01ac6fc7ea3a19166293505a6320216..c9bceab985a8c9fb9d08b0a167e7e8325a834d6e 100644 (file)
@@ -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;
 }
 
index 8f693935cbf85b49f56344f0efb2ddb63e8662fb..b37696733f1c4d8d80b6b180c93a5ab21ec62fd8 100644 (file)
@@ -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)
 {
index 123f45506feea9e29dd2cc6c40b66bf09e012236..385ecaf239ce21a77827b112e7fa126079cbf95b 100644 (file)
@@ -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;
 };
 
index 8a3e5888602f2fc0787d511bb7fee09b9de9a981..25404f32f2f597c1169fb0bbc31ad7a6a0ba2ae3 100644 (file)
@@ -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() ) {
index d56cc052b2b2910c3c74b46897901e5e2b8907a6..d4c395f70b7b92f9879291a9a624021c113ba8ee 100644 (file)
@@ -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);
index 533f481216670e7f5c01c7221b1a60c0ba2a287f..4bd4667870ccff8b48136296af6149f26f6f86e7 100644 (file)
@@ -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();