From a64e7d16c44bba0d137936227fc55871bb26c903 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Fri, 22 Feb 2019 16:07:20 -0700 Subject: [PATCH] add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add stats to render, fix bld_prepare/configure.ac for libusbx --- cinelerra-5.1/blds/PKGBUILD | 2 +- cinelerra-5.1/blds/bld_prepare.sh | 11 ++-- cinelerra-5.1/cinelerra/affine.C | 8 +-- cinelerra-5.1/cinelerra/batchrender.C | 29 ++++++----- cinelerra-5.1/cinelerra/localsession.C | 1 + cinelerra-5.1/cinelerra/localsession.h | 2 +- cinelerra-5.1/cinelerra/mwindow.C | 10 ++-- cinelerra-5.1/cinelerra/mwindowedit.C | 3 ++ cinelerra-5.1/cinelerra/render.C | 28 ++++------ cinelerra-5.1/cinelerra/render.h | 1 + cinelerra-5.1/cinelerra/trackcanvas.C | 43 ++++++++++------ cinelerra-5.1/cinelerra/trackcanvas.h | 2 +- cinelerra-5.1/cinelerra/wwindow.C | 3 +- cinelerra-5.1/cinelerra/zoombar.C | 16 +++++- cinelerra-5.1/cinelerra/zoombar.h | 2 + cinelerra-5.1/configure.ac | 15 +++--- cinelerra-5.1/guicast/bcpopupmenu.C | 9 ++-- cinelerra-5.1/guicast/bcpopupmenu.h | 4 +- cinelerra-5.1/guicast/bctoggle.C | 2 +- cinelerra-5.1/plugins/rotate/rotate.C | 71 ++++++-------------------- cinelerra-5.1/po/de.po | 2 +- 21 files changed, 127 insertions(+), 137 deletions(-) diff --git a/cinelerra-5.1/blds/PKGBUILD b/cinelerra-5.1/blds/PKGBUILD index d1b88827..c1122712 100644 --- a/cinelerra-5.1/blds/PKGBUILD +++ b/cinelerra-5.1/blds/PKGBUILD @@ -10,7 +10,7 @@ DEPENDS=( 'alsa-lib' 'atk' 'bzip2' 'cairo' 'expat' 'fftw' 'flac' 'fontconfig' 'freetype2' 'fribidi' 'gcc-libs' 'gdk-pixbuf2' 'glib2' 'glibc' 'glu' 'graphite' 'gtk2' 'harfbuzz' 'libavc1394' 'libdatrie' 'libdv' 'libffi' 'libglvnd' 'libiec61883' 'libjpeg-turbo' - 'libogg' 'libpng' 'libraw1394' 'libsndfile' 'libthai' + 'libogg' 'libpng' 'libraw1394' 'libsndfile' 'libthai' 'libusb' 'libtheora' 'libtiff' 'libutil-linux' 'libvdpau' 'libvorbis' 'libvpx' 'libx11' 'libxau' 'libxcb' 'libxcomposite' 'libxcursor' 'libxdamage' 'libxdmcp' 'libxext' 'libxfixes' 'libxft' 'libxi' diff --git a/cinelerra-5.1/blds/bld_prepare.sh b/cinelerra-5.1/blds/bld_prepare.sh index 471ea7e9..c79c8ef5 100755 --- a/cinelerra-5.1/blds/bld_prepare.sh +++ b/cinelerra-5.1/blds/bld_prepare.sh @@ -15,7 +15,7 @@ dir="$1" case "$dir" in "centos") - yum -y install nasm libavc1394-devel libusb-devel flac-devel \ + yum -y install nasm libavc1394-devel libusbx-devel flac-devel \ libjpeg-devel libdv-devel libdvdnav-devel libdvdread-devel \ libtheora-devel libiec61883-devel uuid-devel giflib-devel \ ncurses-devel ilmbase-devel fftw-devel OpenEXR-devel \ @@ -38,7 +38,7 @@ case "$dir" in "fedora") dnf install groups "Development Tools" dnf -y --best --allowerasing \ - install nasm yasm libavc1394-devel libusb-devel flac-devel \ + install nasm yasm libavc1394-devel libusbx-devel flac-devel \ libjpeg-devel libdv-devel libdvdnav-devel libdvdread-devel \ libtheora-devel libiec61883-devel esound-devel uuid-devel \ giflib-devel ncurses-devel ilmbase-devel fftw-devel OpenEXR-devel \ @@ -62,7 +62,8 @@ case "$dir" in libdvdnav-devel libdvdread-devel libiec61883-devel libuuid-devel \ 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 gtk2-devel + yasm autoconf automake rpm-build libjbig-devel libvdpau-devel gtk2-devel \ + libusb-1_0-devel if [ ! -f /usr/lib64/libtermcap.so ]; then ln -s libtermcap.so.2 /usr/lib64/libtermcap.so fi @@ -73,7 +74,7 @@ case "$dir" in texinfo libpng12-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ libtiff5-dev exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \ - fonts-dejavu libopenexr-dev festival libfftw3-dev gdb \ + fonts-dejavu libopenexr-dev festival libfftw3-dev gdb libusb-1.0-0-dev \ libdc1394-22-dev libflac-dev libjbig-dev libvdpau-dev \ inkscape libsndfile1-dev libtheora-dev cmake udftools libxml2-utils git \ autoconf automake debhelper libgtk2.0-dev @@ -86,7 +87,7 @@ case "$dir" in libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ libtiff5-dev exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \ fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev gdb \ - libdc1394-22-dev libiec61883-dev libflac-dev libjbig-dev \ + libdc1394-22-dev libiec61883-dev libflac-dev libjbig-dev libusb-1.0-0-dev \ libvdpau-dev libsndfile1-dev libtheora-dev cmake udftools libxml2-utils \ git inkscape autoconf automake debhelper libgtk2.0-dev ;; diff --git a/cinelerra-5.1/cinelerra/affine.C b/cinelerra-5.1/cinelerra/affine.C index a59d6e3e..25af1c98 100644 --- a/cinelerra-5.1/cinelerra/affine.C +++ b/cinelerra-5.1/cinelerra/affine.C @@ -811,10 +811,10 @@ void AffineEngine::rotate(VFrame *output, // All subscripts are clockwise around the quadrangle angle = angle * 2 * M_PI / 360; - double angle1 = atan((double)(in_pivot_y - in_y) / (double)(in_pivot_x - in_x)) + angle; - double angle2 = atan((double)(in_x + in_w - in_pivot_x) / (double)(in_pivot_y - in_y)) + angle; - double angle3 = atan((double)(in_y + in_h - in_pivot_y) / (double)(in_x + in_w - in_pivot_x)) + angle; - double angle4 = atan((double)(in_pivot_x - in_x) / (double)(in_y + in_h - in_pivot_y)) + angle; + double angle1 = atan2((double)(in_pivot_y - in_y), (double)(in_pivot_x - in_x)) + angle; + double angle2 = atan2((double)(in_x + in_w - in_pivot_x), (double)(in_pivot_y - in_y)) + angle; + double angle3 = atan2((double)(in_y + in_h - in_pivot_y), (double)(in_x + in_w - in_pivot_x)) + angle; + double angle4 = atan2((double)(in_pivot_x - in_x), (double)(in_y + in_h - in_pivot_y)) + angle; double radius1 = DISTANCE(in_x, in_y, in_pivot_x, in_pivot_y); double radius2 = DISTANCE(in_x + in_w, in_y, in_pivot_x, in_pivot_y); double radius3 = DISTANCE(in_x + in_w, in_y + in_h, in_pivot_x, in_pivot_y); diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index e8e5fc33..d67b6ad1 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -398,23 +398,26 @@ int BatchRenderThread::test_edl_files() FILE *fp = fopen(path, "r"); if( fp ) { if( warn && mwindow && !is_script ) { - fseek(fp, 0, SEEK_END); - int64_t sz = ftell(fp); - fseek(fp, 0, SEEK_SET); - char *bfr = new char[sz+1]; - int64_t len = fread(bfr, 1, sz+1, fp); - if( len == sz ) { - FileXML file; - XMLBuffer data(bfr, len, 0); - file.set_shared_input(&data); + char *bfr = 0; size_t sz = 0; + struct stat st; + if( !fstat(fileno(fp), &st) ) { + sz = st.st_size; + bfr = new char[sz+1]; + if( fread(bfr, 1, sz+1, fp) != sz ) + ret = 1; + else + bfr[sz] = 0; + } + if( !ret ) { EDL *edl = new EDL; edl->create_objects(); - edl->load_xml(&file, LOAD_ALL); + XMLBuffer data(bfr, sz, 0); + { FileXML file; + file.set_shared_input(&data); + edl->load_xml(&file, LOAD_ALL); } double pos = edl->equivalent_output(mwindow->edl); if( pos >= 0 ) ++not_equiv; edl->remove_user(); } - else - ret = 1; delete [] bfr; } fclose(fp); @@ -1047,7 +1050,9 @@ void BatchRenderSaveList::run() int result2 = filewindow.run_window(); if( !result2 ) { strcpy(thread->batch_path, filewindow.get_submitted_path()); + thread->gui->lock_window("BatchRenderSaveList::run"); thread->gui->batch_path->update(thread->batch_path); + thread->gui->unlock_window(); thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path); thread->save_jobs(thread->batch_path); } diff --git a/cinelerra-5.1/cinelerra/localsession.C b/cinelerra-5.1/cinelerra/localsession.C index 9556dce3..0465795f 100644 --- a/cinelerra-5.1/cinelerra/localsession.C +++ b/cinelerra-5.1/cinelerra/localsession.C @@ -101,6 +101,7 @@ LocalSession::LocalSession(EDL *edl) automation_maxs[AUTOGROUPTYPE_INT255] = 255; zoombar_showautotype = AUTOGROUPTYPE_AUDIO_FADE; + zoombar_showautocolor = -1; floatauto_type = FloatAuto::SMOOTH; diff --git a/cinelerra-5.1/cinelerra/localsession.h b/cinelerra-5.1/cinelerra/localsession.h index ecf48b62..d43b6353 100644 --- a/cinelerra-5.1/cinelerra/localsession.h +++ b/cinelerra-5.1/cinelerra/localsession.h @@ -102,7 +102,7 @@ public: float automation_mins[AUTOGROUPTYPE_COUNT]; float automation_maxs[AUTOGROUPTYPE_COUNT]; - int zoombar_showautotype; + int zoombar_showautotype, zoombar_showautocolor; // Default type of float keyframe int floatauto_type; diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index e6a40ee5..6d4c8fb8 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -249,6 +249,10 @@ MWindow::~MWindow() run_lock->lock("MWindow::~MWindow"); in_destructor = 1; //printf("MWindow::~MWindow %d\n", __LINE__); + if( wwindow && wwindow->is_running() ) + wwindow->close_window(); + if( twindow && twindow->is_running() ) + twindow->close_window(); gui->remote_control->deactivate(); gui->record->stop(); #ifdef HAVE_DVB @@ -286,16 +290,12 @@ MWindow::~MWindow() if( cwindow && cwindow->gui ) cwindow->gui->close(0); if( lwindow && lwindow->gui ) lwindow->gui->close(0); if( gwindow && gwindow->gui ) gwindow->gui->close(0); - if( twindow && twindow->is_running() ) twindow->close_window(); - if( wwindow && wwindow->is_running() ) wwindow->close_window(); vwindows.remove_all_objects(); zwindows.remove_all_objects(); gui->close(0); if( awindow ) awindow->join(); if( cwindow ) cwindow->join(); if( lwindow ) lwindow->join(); - if( twindow ) twindow->join(); - if( wwindow ) wwindow->join(); if( gwindow ) gwindow->join(); join(); #else @@ -307,8 +307,6 @@ MWindow::~MWindow() close_gui(cwindow); close_gui(lwindow); close_gui(gwindow); - close_gui(twindow); - close_gui(wwindow); vwindows.remove_all_objects(); zwindows.remove_all_objects(); gui->close(0); diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 17e74a90..64c54eb1 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -862,6 +862,9 @@ void MWindow::finish_modify_handles() double position = -1; switch( edit_mode ) { case MOVE_RIPPLE: + position = !session->drag_handle ? + session->drag_start : session->drag_position; + break; case MOVE_ROLL: case MOVE_SLIDE: position = session->drag_position; diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index 7bfb1f76..0398ccf0 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -661,6 +661,7 @@ RenderThread::RenderThread(MWindow *mwindow, Render *render) { this->mwindow = mwindow; this->render = render; + render_frames = 0; } RenderThread::~RenderThread() @@ -672,7 +673,7 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, int strategy, int range_type) { // Total length in seconds - double total_length; + double total_length = 0; RenderFarmServer *farm_server = 0; FileSystem fs; const int debug = 0; @@ -737,6 +738,7 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, render->result = 1; } } + render_frames = render->default_asset->frame_rate * total_length; // Generate packages if(!render->result) @@ -807,26 +809,16 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, // Perform local rendering - if(!render->result) { render->start_progress(); - - - MainPackageRenderer package_renderer(render); render->result = package_renderer.initialize(mwindow, command->get_edl(), // Copy of master EDL render->preferences, render->default_asset); - - - - - - while(!render->result) { // Get unfinished job @@ -856,14 +848,8 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, } // file_number - - printf("Render::render_single: Session finished.\n"); - - - - if( strategy == SINGLE_PASS_FARM || strategy == FILE_PER_LABEL_FARM ) { if( !render->progress ) { @@ -904,11 +890,9 @@ if(debug) printf("Render::render %d\n", __LINE__); // Delete the progress box render->stop_progress(); - if(debug) printf("Render::render %d\n", __LINE__); } - // Paste all packages into timeline if desired if(!render->result && @@ -988,6 +972,8 @@ if(debug) printf("Render::render %d\n", __LINE__); void RenderThread::run() { + Timer render_timer; + if( mwindow ) render->preferences->copy_from(mwindow->preferences); @@ -1071,6 +1057,10 @@ void RenderThread::run() } } render->completion->unlock(); + double render_time = render_timer.get_difference() / 1000.0; + double render_rate = render_time > 0 ? render_frames / render_time : 0; + printf("** rendered %jd frames in %0.3f secs, %0.3f fps\n", + render_frames, render_time, render_rate); if( render->mode == Render::INTERACTIVE && render->beep ) mwindow->beep(3000., 1.5, 0.5); diff --git a/cinelerra-5.1/cinelerra/render.h b/cinelerra-5.1/cinelerra/render.h index aa7b652b..d7f57d23 100644 --- a/cinelerra-5.1/cinelerra/render.h +++ b/cinelerra-5.1/cinelerra/render.h @@ -228,6 +228,7 @@ public: MWindow *mwindow; Render *render; + int64_t render_frames; }; class RenderToTracks; diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index bc344756..b9dd3884 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -2227,10 +2227,9 @@ int TrackCanvas::do_keyframes(int cursor_x, if( !result && buttonpress && i == AUTOMATION_SPEED ) mwindow->speed_after(-1); - int current_grouptype = mwindow->edl->local_session->zoombar_showautotype; - if( result && buttonpress && grouptype != current_grouptype ) { - mwindow->edl->local_session->zoombar_showautotype = grouptype; - mwindow->gui->zoombar->update_autozoom(); + if( result && buttonpress ) { + int color = GWindowGUI::auto_colors[i]; + mwindow->gui->zoombar->update_autozoom(grouptype, color); } break; } @@ -2337,7 +2336,6 @@ int TrackCanvas::do_keyframes(int cursor_x, new_cursor = UPRIGHT_ARROW_CURSOR; } - return result; } @@ -4035,7 +4033,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) float change = value - old_value; current->adjust_to_new_coordinates(position, value); update_ganged_autos(change, current->autos->track, current); - show_message(current, 1,", %.2f", current->get_value()); + int color = GWindowGUI::auto_colors[current->autos->autoidx]; + show_message(current, color, ", %.2f", current->get_value()); } break; @@ -4054,7 +4053,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) value * levered_position(position - current->position, current->get_control_in_position())); update_ganged_autos(0, current->autos->track, current); - show_message(current, 1,", %.2f", current->get_control_in_value()); + int color = GWindowGUI::auto_colors[current->autos->autoidx]; + show_message(current, color, ", %.2f", current->get_control_in_value()); } break; } @@ -4068,7 +4068,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) value * levered_position(position - current->position, current->get_control_out_position())); update_ganged_autos(0, current->autos->track, current); - show_message(current, 1,", %.2f", current->get_control_out_value()); + int color = GWindowGUI::auto_colors[current->autos->autoidx]; + show_message(current, color, ", %.2f", current->get_control_out_value()); } break; } } @@ -4088,7 +4089,7 @@ int TrackCanvas::update_drag_toggleauto(int cursor_x, int cursor_y) result = 1; current->value = value; current->position = position; - show_message(current, 0,", %d", current->value); + show_message(current, -1, ", %d", current->value); } return result; @@ -4105,7 +4106,7 @@ int TrackCanvas::update_drag_auto(int cursor_x, int cursor_y) { result = 1; current->position = position; - show_message(current, 0,""); + show_message(current, -1, ""); double position_f = current->autos->track->from_units(current->position); double center_f = (mwindow->edl->local_session->get_selectionstart(1) + @@ -4169,7 +4170,7 @@ int TrackCanvas::update_drag_pluginauto(int cursor_x, int cursor_y) mwindow->session->track_highlighted = track; result = 1; current->position = position; - show_message(current, 0,""); + show_message(current, -1, ""); double position_f = current->autos->track->from_units(current->position); double center_f = (mwindow->edl->local_session->get_selectionstart(1) + @@ -4680,6 +4681,9 @@ int TrackCanvas::button_release_event() } } + if( mwindow->edl->local_session->zoombar_showautocolor >= 0 ) + mwindow->gui->zoombar->update_autozoom(-1); + if (result) cursor_update(0); @@ -5275,7 +5279,7 @@ int TrackCanvas::button_press_event() gui->stop_transport("TrackCanvas::button_press_event"); } - int update_overlay = 0, update_cursor = 0, rerender = 0; + int update_overlay = 0, update_cursor = 0, rerender = 0, update_message = 0; if(get_buttonpress() == WHEEL_UP) { if(shift_down()) @@ -5338,6 +5342,7 @@ int TrackCanvas::button_press_event() if( do_tracks(cursor_x, cursor_y, 1) ) break; + update_message = 1; result = 0; } while(0); else if( ibeam_mode() ) do { @@ -5370,6 +5375,7 @@ int TrackCanvas::button_press_event() if( get_buttonpress() != LEFT_BUTTON ) break; rerender = start_selection(position); mwindow->session->current_operation = SELECT_REGION; + update_message = 1; update_cursor = 1; } while(0); } @@ -5383,9 +5389,12 @@ int TrackCanvas::button_press_event() gui->update_patchbay(); } - if( update_overlay ) { + if( update_message ) + gui->default_message(); + + if( update_overlay ) gui->draw_overlays(1); - } + if( update_cursor < 0 ) { // double_click edit gui->swindow->update_selection(); @@ -5462,11 +5471,11 @@ double TrackCanvas::time_visible() } -void TrackCanvas::show_message(Auto *current, int show_curve_type, const char *fmt, ...) +void TrackCanvas::show_message(Auto *current, int color, const char *fmt, ...) { char string[BCTEXTLEN]; char *cp = string, *ep = cp + sizeof(string)-1; - if( show_curve_type ) { + if( color >= 0 ) { cp += snprintf(string, ep-cp, "%-8s ", FloatAuto::curve_name(((FloatAuto*)current)->curve_mode)); } @@ -5482,7 +5491,7 @@ void TrackCanvas::show_message(Auto *current, int show_curve_type, const char *f va_start(ap, fmt); vsnprintf(cp, ep-cp, fmt, ap); va_end(ap); - gui->show_message(string); + gui->show_message(string, color); } // Patchbay* TrackCanvas::get_patchbay() diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index 91641466..578ebf26 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -360,7 +360,7 @@ public: int update_drag_toggleauto(int cursor_x, int cursor_y); int update_drag_auto(int cursor_x, int cursor_y); int update_drag_pluginauto(int cursor_x, int cursor_y); - void show_message(Auto *current, int show_curve_type, const char *fmt, ...); + void show_message(Auto *current, int color, const char *fmt, ...); // Update status bar to reflect drag operation void update_drag_caption(); diff --git a/cinelerra-5.1/cinelerra/wwindow.C b/cinelerra-5.1/cinelerra/wwindow.C index 4f522f31..8bbc8352 100644 --- a/cinelerra-5.1/cinelerra/wwindow.C +++ b/cinelerra-5.1/cinelerra/wwindow.C @@ -32,6 +32,7 @@ WWindow::WWindow(MWindow *mwindow) { this->mwindow = mwindow; this->result = 0; + this->gui = 0; } WWindow::~WWindow() @@ -59,7 +60,7 @@ BC_Window* WWindow::new_gui() BC_DisplayInfo display_info; int x = display_info.get_abs_cursor_x(); int y = display_info.get_abs_cursor_y(); - WWindowGUI *gui = new WWindowGUI(this, x, y); + gui = new WWindowGUI(this, x, y); gui->create_objects(); return gui; } diff --git a/cinelerra-5.1/cinelerra/zoombar.C b/cinelerra-5.1/cinelerra/zoombar.C index 38f18aeb..79ecfd9c 100644 --- a/cinelerra-5.1/cinelerra/zoombar.C +++ b/cinelerra-5.1/cinelerra/zoombar.C @@ -148,9 +148,22 @@ int ZoomBar::draw() } void ZoomBar::update_autozoom() +{ + update_autozoom(mwindow->edl->local_session->zoombar_showautocolor); +} + +void ZoomBar::update_autozoom(int grouptype, int color) +{ + mwindow->edl->local_session->zoombar_showautotype = grouptype; + update_autozoom(color); +} + +void ZoomBar::update_autozoom(int color) { char string[BCTEXTLEN]; int autogroup_type = mwindow->edl->local_session->zoombar_showautotype; + mwindow->edl->local_session->zoombar_showautocolor = color; + if( color < 0 ) color = get_resources()->default_text_color; switch( autogroup_type ) { case AUTOGROUPTYPE_AUDIO_FADE: case AUTOGROUPTYPE_VIDEO_FADE: @@ -173,9 +186,10 @@ void ZoomBar::update_autozoom() } auto_zoom_text->update(string); const char *group_name = AutoTypeMenu::to_text(autogroup_type); - auto_type->set_text(group_name); + auto_type->set_text(group_name, color); } + int ZoomBar::update() { sample_zoom->update(mwindow->edl->local_session->zoom_sample); diff --git a/cinelerra-5.1/cinelerra/zoombar.h b/cinelerra-5.1/cinelerra/zoombar.h index 9026e316..6c95a3b1 100644 --- a/cinelerra-5.1/cinelerra/zoombar.h +++ b/cinelerra-5.1/cinelerra/zoombar.h @@ -42,6 +42,8 @@ public: void redraw_time_dependancies(); int update(); // redraw the current values void update_autozoom(); + void update_autozoom(int grouptype, int color); + void update_autozoom(int color); int update_clocks(); int update_playback(int64_t new_position); // update the playback position int set_selection(int which_one); diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 0a6cd86b..f3314df1 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -54,7 +54,6 @@ CHECK_WITH([libzmpeg],[build libzmpeg],[LIBZMPEG],[yes]) CHECK_WITH([commercial],[enable commercial capture],[COMMERCIAL],[yes]) CHECK_WITH([thirdparty],[use thirdparty build],[CIN_3RDPARTY],[yes]) CHECK_WITH([shuttle],[shuttle device],[SHUTTLE],[yes]) -CHECK_WITH([shuttle-usb],[use libusb for shuttle],[SHUTTLE_USB],[no]) if test "x$WANT_LV2" != "xno"; then GTK2_LIBS=`pkg-config --libs gtk+-2.0` @@ -577,12 +576,15 @@ CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11]) AC_DEFUN([CHECK_WANT], [ RESULT=yes # WANT_$1 -if test "x$WANT_$1" != "xyes" -a "x$WANT_$1" != "xno" ; then +if test "x$WANT_$1" != "xno" ; then AC_ARG_WITH(m4_tolower([$1]), AC_HELP_STRING([m4_join([-],[--with],m4_tolower([$1]))], [$3] (auto)), [WANT_$1=$withval],[WANT_$1=$2]) m4_quote($4) if test "x$RESULT" = "xno" -a "x$PKG_$1" = "x"; then + if test "x$WANT_$1" = "xyes" ; then + AC_MSG_ERROR([required for $1 support.]) + fi echo "=== want $1 Failed." WANT_$1=no elif test "x$WANT_$1" = "xauto" ; then @@ -638,6 +640,10 @@ CHECK_WANT([ESOUND], [no], [use esd], [ CHECK_LIB([audiofile], [audiofile], [afOpenFile]) CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])]) +CHECK_WANT([SHUTTLE_USB], [yes], [use libusb-1.0], [ + CHECK_LIB([libusbx], [usb-1.0], [libusb_init]) + CHECK_HEADERS([libusbx], [libusb headers], [libusb-1.0/libusb.h])]) + CHECK_WANT([LV2], [auto], [use lv2], [ saved_CFLAGS="$CFLAGS" CHECK_LIB([lilv], [lilv-0], [lilv_world_new]) @@ -850,8 +856,6 @@ echo " using: with-noelision = $WANT_NOELISION" echo " using: with-booby = $WANT_BOOBY" echo " using: with-libzmpeg = $WANT_LIBZMPEG" echo " using: with-commerical = $WANT_COMMERCIAL" -echo " using: with-shuttle = $WANT_SHUTTLE" -echo " using: with-shuttle-usb = $WANT_SHUTTLE_USB" echo "" echo " using: thirdparty build = $WANT_CIN_3RDPARTY" echo " using: single-user = $WANT_CINBIN_BUILD" @@ -875,9 +879,6 @@ fi if test "x$WANT_BOOBY" != "xno"; then CFG_CFLAGS+=" -DBOOBY" fi -if test "x$WANT_SHUTTLE_USB" != "xno"; then - EXTRA_LIBS+=' -lusb-1.0' -fi # intel lock elision bugs if test "x$WANT_NOELISION" != "xno"; then diff --git a/cinelerra-5.1/guicast/bcpopupmenu.C b/cinelerra-5.1/guicast/bcpopupmenu.C index 2fb69d1c..7ef71aec 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.C +++ b/cinelerra-5.1/guicast/bcpopupmenu.C @@ -106,12 +106,12 @@ char* BC_PopupMenu::get_text() return text; } -void BC_PopupMenu::set_text(const char *text) +void BC_PopupMenu::set_text(const char *text, int color) { if(use_title) { strcpy(this->text, text); - draw_title(1); + draw_title(1, color); } } @@ -230,7 +230,7 @@ BC_MenuItem* BC_PopupMenu::get_item(int i) return menu_popup->menu_items.values[i]; } -int BC_PopupMenu::draw_title(int flush) +int BC_PopupMenu::draw_title(int flush, int color) { if(!use_title) return 0; BC_Resources *resources = get_resources(); @@ -240,7 +240,8 @@ int BC_PopupMenu::draw_title(int flush) draw_3segmenth(0, 0, w, images[status]); // Overlay text - set_color(get_resources()->popup_title_text); + if( color < 0 ) color = get_resources()->popup_title_text; + set_color(color); int offset = 0; if(status == BUTTON_DN) offset = 1; diff --git a/cinelerra-5.1/guicast/bcpopupmenu.h b/cinelerra-5.1/guicast/bcpopupmenu.h index 1d683835..db79d202 100644 --- a/cinelerra-5.1/guicast/bcpopupmenu.h +++ b/cinelerra-5.1/guicast/bcpopupmenu.h @@ -64,11 +64,11 @@ public: int total_items(); BC_MenuItem* get_item(int i); // Set title of menu - void set_text(const char *text); + void set_text(const char *text, int color=-1); // Set icon of menu. Disables text. void set_icon(BC_Pixmap *pixmap); // Draw title of menu - int draw_title(int flush); + int draw_title(int flush, int color=-1); int reposition_window(int x, int y); int deactivate(); int activate_menu(); diff --git a/cinelerra-5.1/guicast/bctoggle.C b/cinelerra-5.1/guicast/bctoggle.C index 67af31ec..01832bd4 100644 --- a/cinelerra-5.1/guicast/bctoggle.C +++ b/cinelerra-5.1/guicast/bctoggle.C @@ -97,7 +97,7 @@ void BC_Toggle::calculate_extents(BC_WindowBase *gui, if( caption ) { *text_w = gui->get_text_width(font, caption); - *text_h = gui->get_text_height(font); + *text_h = gui->get_text_height(font, caption); if( resources->toggle_highlight_bg ) { *text_w += resources->toggle_text_margin * 2; diff --git a/cinelerra-5.1/plugins/rotate/rotate.C b/cinelerra-5.1/plugins/rotate/rotate.C index de444618..7d578b7a 100644 --- a/cinelerra-5.1/plugins/rotate/rotate.C +++ b/cinelerra-5.1/plugins/rotate/rotate.C @@ -263,12 +263,7 @@ int RotateReset::handle_event() RotateWindow::RotateWindow(RotateEffect *plugin) - : PluginClientWindow(plugin, - 250, - 230, - 250, - 230, - 0) + : PluginClientWindow(plugin, 300, 230, 300, 230, 0) { this->plugin = plugin; } @@ -279,59 +274,27 @@ void RotateWindow::create_objects() { int x = 10, y = 10; BC_Title *title; - - - add_tool(new BC_Title(x, y, _("Rotate"))); - x += 50; - y += 20; - add_tool(toggle0 = new RotateToggle(this, - plugin, - plugin->config.angle == 0, - x, - y, - 0, - "0")); - x += RADIUS; - y += RADIUS; - add_tool(toggle90 = new RotateToggle(this, - plugin, - plugin->config.angle == 90, - x, - y, - 90, - "90")); - x -= RADIUS; - y += RADIUS; - add_tool(toggle180 = new RotateToggle(this, - plugin, - plugin->config.angle == 180, - x, - y, - 180, - "180")); - x -= RADIUS; - y -= RADIUS; - add_tool(toggle270 = new RotateToggle(this, - plugin, - plugin->config.angle == 270, - x, - y, - 270, - "270")); + x += 50; y += 20; + add_tool(toggle0 = new RotateToggle(this, plugin, + plugin->config.angle == 0, x, y, 0, "0")); + x += RADIUS; y += RADIUS; + add_tool(toggle90 = new RotateToggle(this, plugin, + plugin->config.angle == 90, x, y, 90, "90")); + x -= RADIUS; y += RADIUS; + add_tool(toggle180 = new RotateToggle(this, plugin, + plugin->config.angle == 180, x, y, 180, "180")); + x -= RADIUS; y -= RADIUS; + add_tool(toggle270 = new RotateToggle(this, plugin, + plugin->config.angle == 270, x, y, 270, "270")); // add_subwindow(bilinear = new RotateInterpolate(plugin, 10, y + 60)); - x += 120; - y -= 50; + x += 150; y -= 50; add_tool(fine = new RotateFine(this, plugin, x, y)); y += fine->get_h() + 10; add_tool(text = new RotateText(this, plugin, x, y)); y += 25; add_tool(new BC_Title(x, y, _("Degrees"))); - - - - y += text->get_h() + 10; add_subwindow(title = new BC_Title(x, y, _("Pivot (x,y):"))); y += title->get_h() + 10; @@ -511,7 +474,7 @@ int RotateEffect::process_buffer(VFrame *frame, //printf("RotateEffect::process_buffer %d\n", __LINE__); - if(config.angle == 0) + if(config.angle == 0 && !config.draw_pivot) { read_frame(frame, 0, @@ -574,13 +537,13 @@ int RotateEffect::process_buffer(VFrame *frame, #define DRAW_CENTER(components, type, max) \ { \ type **rows = (type**)get_output()->get_rows(); \ - if( (center_x >= 0 && center_x < w) || (center_y >= 0 && center_y < h) ) \ + if( (center_x >= 0 && center_x < w) && (center_y >= 0 && center_y < h) ) \ { \ - type *hrow = rows[center_y] + components * (center_x - CENTER_W / 2); \ for(int i = center_x - CENTER_W / 2; i <= center_x + CENTER_W / 2; i++) \ { \ if(i >= 0 && i < w) \ { \ + type *hrow = rows[center_y] + components * i; \ hrow[0] = max - hrow[0]; \ hrow[1] = max - hrow[1]; \ hrow[2] = max - hrow[2]; \ diff --git a/cinelerra-5.1/po/de.po b/cinelerra-5.1/po/de.po index 9f16c561..f9759d1e 100644 --- a/cinelerra-5.1/po/de.po +++ b/cinelerra-5.1/po/de.po @@ -11823,7 +11823,7 @@ msgstr "RGBShift" #: plugins/rotate/rotate.C:310 msgid "Draw pivot" -msgstr "Schwenkpunkt darstellen" +msgstr "Schwenkpunkt\ndarstellen" #: plugins/rotate/rotate.C:503 msgid "Degrees" -- 2.26.2