From 205a66f9f2abd6eac72076f773ce5d75921fa151 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Mon, 27 Apr 2020 18:50:02 -0600 Subject: [PATCH] add refresh_only to scopewindow, fix alsa prefs for capture source, add python to bld_prepare, colorpicker fix for hue/alpha precision problem --- cinelerra-5.1/blds/bld_prepare.sh | 8 ++++---- cinelerra-5.1/cinelerra/adeviceprefs.C | 1 + cinelerra-5.1/cinelerra/canvas.C | 3 ++- cinelerra-5.1/cinelerra/canvas.h | 2 +- cinelerra-5.1/cinelerra/colorpicker.C | 2 +- cinelerra-5.1/cinelerra/cwindowgui.C | 15 ++++++++++----- cinelerra-5.1/cinelerra/cwindowgui.h | 2 +- cinelerra-5.1/cinelerra/editpanel.C | 2 ++ cinelerra-5.1/cinelerra/mainsession.C | 4 ++++ cinelerra-5.1/cinelerra/mainsession.h | 1 + cinelerra-5.1/cinelerra/recordscopes.C | 2 ++ cinelerra-5.1/cinelerra/scopewindow.C | 19 ++++++++++++++++++- cinelerra-5.1/cinelerra/scopewindow.h | 11 ++++++++++- cinelerra-5.1/cinelerra/vwindowgui.C | 15 ++++++++++----- cinelerra-5.1/cinelerra/vwindowgui.h | 2 +- cinelerra-5.1/plugins/videoscope/videoscope.C | 1 + 16 files changed, 69 insertions(+), 21 deletions(-) diff --git a/cinelerra-5.1/blds/bld_prepare.sh b/cinelerra-5.1/blds/bld_prepare.sh index f5201e64..8c0b3511 100755 --- a/cinelerra-5.1/blds/bld_prepare.sh +++ b/cinelerra-5.1/blds/bld_prepare.sh @@ -27,7 +27,7 @@ case "$dir" in libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \ libvorbis-devel texinfo xz-devel lzma-devel cmake udftools git \ autoconf automake rpm-build jbigkit-devel libvdpau-devel libva-devel \ - alsa-lib-devel gtk2-devel pulseaudio-libs-devel libtool + alsa-lib-devel gtk2-devel pulseaudio-libs-devel libtool python yasm=yasm-1.3.0-3.fc24.x86_64.rpm release=http://archives.fedoraproject.org/pub/fedora/linux/releases/24 url=$release/Everything/x86_64/os/Packages/y/$yasm @@ -67,7 +67,7 @@ case "$dir" in ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \ libtiff-devel inkscape cmake patch libnuma-devel lzma-devel udftools git \ yasm autoconf automake rpm-build libjbig-devel libvdpau-devel libva-devel \ - gtk2-devel libusb-1_0-devel libpulse-devel libtool + gtk2-devel libusb-1_0-devel libpulse-devel libtool python if [ ! -f /usr/lib64/libtermcap.so ]; then ln -s libtermcap.so.2 /usr/lib64/libtermcap.so fi @@ -81,7 +81,7 @@ case "$dir" in fonts-dejavu libopenexr-dev festival libfftw3-dev gdb libusb-1.0-0-dev \ libdc1394-22-dev libflac-dev libjbig-dev libvdpau-dev libva-dev \ inkscape libsndfile1-dev libtheora-dev cmake udftools libxml2-utils git \ - autoconf automake debhelper libgtk2.0-dev libpulse-dev + autoconf automake debhelper libgtk2.0-dev libpulse-dev python ;; #"ub16-10") # apt-get -y install libx264-dev libx265-dev libvpx-dev libmjpegtools-dev @@ -94,7 +94,7 @@ case "$dir" in libdc1394-22-dev libiec61883-dev libflac-dev libjbig-dev libusb-1.0-0-dev \ libvdpau-dev libva-dev libsndfile1-dev libtheora-dev cmake udftools \ libxml2-utils git inkscape autoconf automake debhelper libgtk2.0-dev \ - libpulse-dev libtool + libpulse-dev libtool python ;; *) echo "unknown os: $dir" diff --git a/cinelerra-5.1/cinelerra/adeviceprefs.C b/cinelerra-5.1/cinelerra/adeviceprefs.C index ddc75b2f..78cef42d 100644 --- a/cinelerra-5.1/cinelerra/adeviceprefs.C +++ b/cinelerra-5.1/cinelerra/adeviceprefs.C @@ -370,6 +370,7 @@ int ADevicePrefs::create_alsa_objs() ArrayList *alsa_titles = new ArrayList; alsa_titles->set_array_delete(); AudioALSA::list_devices(alsa_titles, 0, mode); + AudioALSA::add_pulse_devices(mode, alsa_titles, 0); alsa_drivers = new ArrayList; for(int i = 0; i < alsa_titles->total; i++) diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index a1f45854..ad5e8811 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -733,6 +733,7 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) } else refresh_frame->transfer_from(output_frame, -1); + draw_scope(refresh_frame, 1); } void Canvas::process_scope(VideoDevice *video, VFrame *frame) @@ -746,7 +747,7 @@ void Canvas::process_scope(VideoDevice *video, VFrame *frame) frame = refresh_frame; } if( frame ) - draw_scope(frame); + draw_scope(frame, 0); } void Canvas::clear(int flash) diff --git a/cinelerra-5.1/cinelerra/canvas.h b/cinelerra-5.1/cinelerra/canvas.h index c3cb2831..51b7a201 100644 --- a/cinelerra-5.1/cinelerra/canvas.h +++ b/cinelerra-5.1/cinelerra/canvas.h @@ -128,7 +128,7 @@ public: virtual void clear(int flash=1); // draw scope virtual int scope_on() { return 0; } - virtual void draw_scope(VFrame *frame) {} + virtual void draw_scope(VFrame *frame, int refresh) {} void process_scope(VideoDevice *video, VFrame *frame); // Get top left offset of canvas relative to output. diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index d14b4c1f..348817c4 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -1364,7 +1364,7 @@ void ColorButtonPicker::update(int color, int alpha) int ColorButtonPicker::handle_new_color(int color, int alpha) { color_button->lock_window("ColorButtonPicker::handle_new_color"); - color_button->update_gui(color, alpha); + color_button->update_gui(color); color_button->unlock_window(); return color_button->handle_new_color(color, alpha); } diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index 1aff4d6c..006d6ddc 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -1095,14 +1095,19 @@ int CWindowCanvas::do_scroll(EDL *edl, float cursor_x, float cursor_y) int CWindowCanvas::scope_on() { - return !gui->edit_panel->scope_dialog ? 0 : - gui->edit_panel->scope_dialog->running(); + 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; + return scope_dialog->running(); } -void CWindowCanvas::draw_scope(VFrame *output) +void CWindowCanvas::draw_scope(VFrame *output, int refresh) { - if( gui->edit_panel->scope_dialog && output ) - gui->edit_panel->scope_dialog->process(output); + if( !output ) return; + 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; + scope_dialog->process(output); } void CWindowCanvas::draw_refresh(int flush) diff --git a/cinelerra-5.1/cinelerra/cwindowgui.h b/cinelerra-5.1/cinelerra/cwindowgui.h index e663c351..df1e01c8 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.h +++ b/cinelerra-5.1/cinelerra/cwindowgui.h @@ -305,7 +305,7 @@ public: void draw_crophandle(int x, int y); int set_fullscreen(int on, int unlock); int scope_on(); - void draw_scope(VFrame *output); + void draw_scope(VFrame *output, int refresh); // Draw the camera/projector overlay in different colors. void draw_outlines(int do_camera); diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index 03eb9e48..2466c150 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -1224,6 +1224,7 @@ void EditPanelScopeGUI::create_objects() use_wave_gain = session->use_wave_gain; use_vect_gain = session->use_vect_gain; use_smooth = session->use_smooth; + use_refresh = session->use_refresh; use_graticule = session->use_graticule; ScopeGUI::create_objects(); } @@ -1239,6 +1240,7 @@ void EditPanelScopeGUI::toggle_event() session->use_wave_gain = use_wave_gain; session->use_vect_gain = use_vect_gain; session->use_smooth = use_smooth; + session->use_refresh = use_refresh; session->use_graticule = use_graticule; } diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index 58ff1724..555a872e 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -109,6 +109,7 @@ MainSession::MainSession(MWindow *mwindow) use_wave_gain = 5; use_vect_gain = 5; use_smooth = 0; + use_refresh = 0; use_graticule = 0; afolders_w = 0; show_vwindow = show_awindow = show_cwindow = show_gwindow = show_lwindow = 0; @@ -328,6 +329,7 @@ void MainSession::default_window_positions(int window_config) use_wave_gain = 5; use_vect_gain = 5; use_smooth = 1; + use_refresh = 0; use_graticule = 0; if(mwindow->edl) @@ -446,6 +448,7 @@ int MainSession::load_defaults(BC_Hash *defaults) use_wave_gain = defaults->get("USE_WAVE_GAIN", use_wave_gain); 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_graticule = defaults->get("USE_GRATICULE", use_graticule); //printf("MainSession::load_defaults 1\n"); @@ -575,6 +578,7 @@ int MainSession::save_defaults(BC_Hash *defaults) defaults->update("USE_WAVE_GAIN", use_wave_gain); defaults->update("USE_VECT_GAIN", use_vect_gain); defaults->update("USE_SMOOTH", use_smooth); + defaults->update("USE_REFRESH", use_refresh); 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 64796f8b..2ed9e5b5 100644 --- a/cinelerra-5.1/cinelerra/mainsession.h +++ b/cinelerra-5.1/cinelerra/mainsession.h @@ -175,6 +175,7 @@ public: int use_wave_gain; int use_vect_gain; int use_smooth; + int use_refresh; int use_graticule; int afolders_w; diff --git a/cinelerra-5.1/cinelerra/recordscopes.C b/cinelerra-5.1/cinelerra/recordscopes.C index 3de960ba..55f5a0c3 100644 --- a/cinelerra-5.1/cinelerra/recordscopes.C +++ b/cinelerra-5.1/cinelerra/recordscopes.C @@ -120,6 +120,7 @@ void RecordScopeGUI::create_objects() use_wave_gain = mwindow->session->use_wave_gain; use_vect_gain = mwindow->session->use_vect_gain; use_smooth = mwindow->session->use_smooth; + use_refresh = -1; use_graticule = mwindow->session->use_graticule; ScopeGUI::create_objects(); } @@ -135,6 +136,7 @@ void RecordScopeGUI::toggle_event() mwindow->session->use_wave_gain = use_wave_gain; mwindow->session->use_vect_gain = use_vect_gain; mwindow->session->use_smooth = use_smooth; + mwindow->session->use_refresh = 0; mwindow->session->use_graticule = use_graticule; } diff --git a/cinelerra-5.1/cinelerra/scopewindow.C b/cinelerra-5.1/cinelerra/scopewindow.C index 9e05c15a..283564bc 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.C +++ b/cinelerra-5.1/cinelerra/scopewindow.C @@ -453,6 +453,7 @@ void ScopeGUI::reset() data_frame = 0; frame_w = 1; use_smooth = 1; + use_refresh = 0; use_wave_gain = 5; use_vect_gain = 5; use_hist = 0; @@ -493,7 +494,10 @@ void ScopeGUI::create_objects() scope_menu->create_objects(); int x1 = x + scope_menu->get_w() + 2*margin; add_subwindow(smooth = new ScopeSmooth(this, x1, y)); - + if( use_refresh >= 0 ) { + y += smooth->get_h() + margin; + add_subwindow(refresh = new ScopeRefresh(this, x, y)); + } create_panels(); update_toggles(); show_window(); @@ -1442,3 +1446,16 @@ int ScopeSmooth::handle_event() return 1; } +ScopeRefresh::ScopeRefresh(ScopeGUI *gui, int x, int y) + : BC_CheckBox(x, y, gui->use_refresh, _("Refresh only")) +{ + this->gui = gui; +} + +int ScopeRefresh::handle_event() +{ + gui->use_refresh = get_value(); + gui->toggle_event(); + return 1; +} + diff --git a/cinelerra-5.1/cinelerra/scopewindow.h b/cinelerra-5.1/cinelerra/scopewindow.h index 7258374b..1f73fc36 100644 --- a/cinelerra-5.1/cinelerra/scopewindow.h +++ b/cinelerra-5.1/cinelerra/scopewindow.h @@ -257,6 +257,14 @@ public: ScopeGUI *gui; }; +class ScopeRefresh : public BC_CheckBox +{ +public: + ScopeRefresh(ScopeGUI *gui, int x, int y); + int handle_event(); + ScopeGUI *gui; +}; + class ScopeGUI : public PluginClientWindow { @@ -303,6 +311,7 @@ public: ScopeVectSlider *vect_slider; ScopeVectGrats *vect_grats; ScopeSmooth *smooth; + ScopeRefresh *refresh; VFrame *grat_image; OverlayFrame *overlay; @@ -321,7 +330,7 @@ public: int use_hist_parade, use_wave_parade; int bins[HIST_SECTIONS][TOTAL_BINS]; - int frame_w, use_smooth; + int frame_w, use_smooth, use_refresh; int use_wave_gain, use_vect_gain; }; diff --git a/cinelerra-5.1/cinelerra/vwindowgui.C b/cinelerra-5.1/cinelerra/vwindowgui.C index 8370b4aa..8a3e5888 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.C +++ b/cinelerra-5.1/cinelerra/vwindowgui.C @@ -829,14 +829,19 @@ void VWindowCanvas::close_source() int VWindowCanvas::scope_on() { - return !gui->edit_panel->scope_dialog ? 0 : - gui->edit_panel->scope_dialog->running(); + 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; + return scope_dialog->running(); } -void VWindowCanvas::draw_scope(VFrame *output) +void VWindowCanvas::draw_scope(VFrame *output, int refresh) { - if( gui->edit_panel->scope_dialog && output ) - gui->edit_panel->scope_dialog->process(output); + if( !output ) return; + 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; + scope_dialog->process(output); } void VWindowCanvas::draw_refresh(int flush) diff --git a/cinelerra-5.1/cinelerra/vwindowgui.h b/cinelerra-5.1/cinelerra/vwindowgui.h index a62a3015..d56cc052 100644 --- a/cinelerra-5.1/cinelerra/vwindowgui.h +++ b/cinelerra-5.1/cinelerra/vwindowgui.h @@ -115,7 +115,7 @@ public: void create_objects(EDL *edl); void zoom_resize_window(float percentage); int scope_on(); - void draw_scope(VFrame *output); + void draw_scope(VFrame *output, int refresh); void draw_refresh(int flush = 1); int need_overlays(); void draw_overlays(); diff --git a/cinelerra-5.1/plugins/videoscope/videoscope.C b/cinelerra-5.1/plugins/videoscope/videoscope.C index f831a809..533f4812 100644 --- a/cinelerra-5.1/plugins/videoscope/videoscope.C +++ b/cinelerra-5.1/plugins/videoscope/videoscope.C @@ -109,6 +109,7 @@ void VideoScopeWindow::create_objects() use_wave_gain = plugin->use_wave_gain; use_vect_gain = plugin->use_vect_gain; use_smooth = plugin->use_smooth; + use_refresh = -1; use_graticule = plugin->use_graticule; ScopeGUI::create_objects(); -- 2.26.2