From 564227981f9c1b021445fa0352b75c7670172912 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Wed, 22 Nov 2017 12:23:49 -0700 Subject: [PATCH] undo/redo mixer, freds vp9, next/prev kfrm, ruleof3rds --- cinelerra-5.1/Cinelerra_factory | 3 + cinelerra-5.1/cinelerra/Makefile | 4 + cinelerra-5.1/cinelerra/autos.C | 12 +- cinelerra-5.1/cinelerra/editpopup.C | 5 +- cinelerra-5.1/cinelerra/mwindow.C | 12 +- cinelerra-5.1/cinelerra/mwindow.h | 4 + cinelerra-5.1/cinelerra/mwindowedit.C | 27 +- cinelerra-5.1/cinelerra/mwindowgui.C | 10 + cinelerra-5.1/cinelerra/mwindowmove.C | 286 +++++++----------- cinelerra-5.1/cinelerra/pluginset.C | 10 + cinelerra-5.1/cinelerra/pluginset.h | 1 + .../video/vp9_0320x240_24or25or30fps.mkv | 14 + .../video/vp9_0320x240_24or25or30fps.webm | 14 + .../video/vp9_0640x360_24or25or30fps.mkv | 14 + .../video/vp9_0640x360_24or25or30fps.webm | 14 + .../vp9_0640x480_lowQuality_24or25or30fps.mkv | 14 + ...vp9_0640x480_lowQuality_24or25or30fps.webm | 14 + ...9_0640x480_mediumQuality_24or25or30fps.mkv | 14 + ..._0640x480_mediumQuality_24or25or30fps.webm | 14 + .../video/vp9_1280x720_24or25or30fps.mkv | 14 + .../video/vp9_1280x720_24or25or30fps.webm | 9 +- .../ffmpeg/video/vp9_1280x720_50or60fps.mkv | 14 + .../ffmpeg/video/vp9_1280x720_50or60fps.webm | 14 + .../video/vp9_1920x1080_24or25or30fps.mkv | 14 + .../video/vp9_1920x1080_24or25or30fps.webm | 14 + .../ffmpeg/video/vp9_1920x1080_50or60fps.mkv | 14 + .../ffmpeg/video/vp9_1920x1080_50or60fps.webm | 14 + .../video/vp9_2560x1440_24or25or30fps.mkv | 14 + .../video/vp9_2560x1440_24or25or30fps.webm | 14 + .../ffmpeg/video/vp9_2560x1440_50or60fps.mkv | 14 + .../ffmpeg/video/vp9_2560x1440_50or60fps.webm | 14 + .../video/vp9_3840x2160_24or25or30fps.mkv | 14 + .../video/vp9_3840x2160_24or25or30fps.webm | 14 + .../ffmpeg/video/vp9_3840x2160_50or60fps.mkv | 14 + .../ffmpeg/video/vp9_3840x2160_50or60fps.webm | 14 + cinelerra-5.1/guicast/bcfilebox.C | 4 +- 36 files changed, 497 insertions(+), 212 deletions(-) create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.webm create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.mkv create mode 100644 cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.webm diff --git a/cinelerra-5.1/Cinelerra_factory b/cinelerra-5.1/Cinelerra_factory index 3cc787ad..05acba1a 100644 --- a/cinelerra-5.1/Cinelerra_factory +++ b/cinelerra-5.1/Cinelerra_factory @@ -81,3 +81,6 @@ + +<F_DRAWGRID x=-1 y=-1 width=iw/3 w=iw/3 height=ih/3 h=ih/3 color=invert c=invert thickness=2 t=2> + diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile index 3be6dadc..a825fbc3 100644 --- a/cinelerra-5.1/cinelerra/Makefile +++ b/cinelerra-5.1/cinelerra/Makefile @@ -449,9 +449,13 @@ tags: $(OBJDIR)/%.o: %.C $(CXX) `cat $(OBJDIR)/c_flags` -DMSGQUAL=$* -c $< -o $@ +$(OBJDIR)/fileexr.o: fileexr.C + $(CXX) `cat $(OBJDIR)/c_flags` -Wno-deprecated -DMSGQUAL=$* -c $< -o $@ + $(OBJDIR)/sha1.o: sha1.C sha1.h $(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@ + $(DCRAW): dcraw.C $(CXX) `cat $(OBJDIR)/c_flags` $(if $(findstring -ggdb,$(CFLAGS)),,-O4) -DNODEPS -DLOCALTIME \ -Wno-misleading-indentation -Wno-sign-compare -Wno-narrowing dcraw.C -c -o $*.o diff --git a/cinelerra-5.1/cinelerra/autos.C b/cinelerra-5.1/cinelerra/autos.C index b895a904..49a8ea1c 100644 --- a/cinelerra-5.1/cinelerra/autos.C +++ b/cinelerra-5.1/cinelerra/autos.C @@ -703,22 +703,14 @@ Auto* Autos::autoof(int64_t position) Auto* Autos::nearest_before(int64_t position) { Auto *current; - - for(current = last; current && current->position >= position; current = PREVIOUS) - { ; } - - + for(current = last; current && current->position >= position; current = PREVIOUS); return current; // return 0 on failure } Auto* Autos::nearest_after(int64_t position) { Auto *current; - - for(current = first; current && current->position <= position; current = NEXT) - { ; } - - + for(current = first; current && current->position <= position; current = NEXT); return current; // return 0 on failure } diff --git a/cinelerra-5.1/cinelerra/editpopup.C b/cinelerra-5.1/cinelerra/editpopup.C index 5c8291a8..df0be8dc 100644 --- a/cinelerra-5.1/cinelerra/editpopup.C +++ b/cinelerra-5.1/cinelerra/editpopup.C @@ -384,9 +384,8 @@ int SnapshotMenuItem::handle_event() static const char *exts[] = { "png", "jpg", "tif" }; time_t tt; time(&tt); struct tm tm; localtime_r(&tt,&tm); - sprintf(filename,"%s/snap_%04d%02d%02d-%02d%02d%02d.%s", - preferences->snapshot_path, - 1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday, + snprintf(filename,sizeof(filename),"%s/snap_%04d%02d%02d-%02d%02d%02d.%s", + preferences->snapshot_path, 1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday, tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]); int fw = edl->get_w(), fh = edl->get_h(); int fcolor_model = edl->session->color_model; diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 426421c3..0bfd3770 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1272,6 +1272,17 @@ void MWindow::close_mixers() } } +void MWindow::open_mixers() +{ + for( int i=0; imixers.size(); ++i ) { + Mixer *mixer = edl->mixers[i]; + ZWindow *zwindow = get_mixer(mixer); + zwindow->set_title(mixer->title); + zwindow->start(); + } + refresh_mixers(); +} + int MWindow::select_zwindow(ZWindow *zwindow) { int ret = 0, n = zwindows.number_of(zwindow); @@ -1350,7 +1361,6 @@ void MWindow::tile_mixers() } } - void MWindow::init_cache() { audio_cache = new CICache(preferences); diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index 271a4f89..19d9436a 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -209,6 +209,7 @@ public: void refresh_mixers(); void stop_mixers(); void close_mixers(); + void open_mixers(); ZWindow *get_mixer(Mixer *&mixer); void del_mixer(ZWindow *zwindow); int mixer_track_active(Track *track); @@ -248,6 +249,7 @@ public: int move_right(int64_t distance = 0); void move_up(int64_t distance = 0); void move_down(int64_t distance = 0); + int find_selection(double position, int scroll_display = 0); // seek to labels // shift_down must be passed by the caller because different windows call @@ -257,6 +259,8 @@ public: // seek to edit handles int next_edit_handle(int shift_down); int prev_edit_handle(int shift_down); +// seek to keyframes + int nearest_plugin_keyframe(int shift_down, int dir); // offset is pixels to add to track_start void trackmovement(int offset, int pane_number); // view_start is pixels diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 84232955..b7fcd9dd 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -74,6 +74,7 @@ #include "vwindow.h" #include "vwindowgui.h" #include "zoombar.h" +#include "zwindow.h" #include "automation.h" #include "maskautos.h" @@ -1874,8 +1875,9 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) { calling_window_gui->unlock_window(); stop_playback(0); + close_mixers(); - cwindow->gui->lock_window("MWindow::redo_entry"); + cwindow->gui->lock_window("MWindow::redo_entry 1"); for( int i = 0; i < vwindows.size(); i++ ) { if( vwindows.get(i)->is_running() ) { if( calling_window_gui != vwindows.get(i)->gui ) { @@ -1883,23 +1885,19 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) } } } - gui->lock_window(); + gui->lock_window("MWindow::redo_entry 3"); undo->redo(); save_backup(); + restart_brender(); update_plugin_states(); update_plugin_guis(); - awindow->gui->async_update_assets(); - restart_brender(); + gui->update(1, 2, 1, 1, 1, 1, 1); + gui->unlock_window(); cwindow->update(1, 1, 1, 1, 1); - - if( calling_window_gui != cwindow->gui ) - cwindow->gui->unlock_window(); - if( calling_window_gui != gui ) - gui->unlock_window(); - + cwindow->gui->unlock_window(); for( int i = 0; i < vwindows.size(); i++ ) { if( vwindows.get(i)->is_running() ) { @@ -1909,7 +1907,14 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) } } + if( calling_window_gui != gui ) + gui->unlock_window(); + + open_mixers(); + awindow->gui->async_update_assets(); + cwindow->refresh_frame(CHANGE_ALL); + calling_window_gui->lock_window("MWindow::redo_entry 4"); } @@ -2160,6 +2165,7 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui) { calling_window_gui->unlock_window(); stop_playback(0); + close_mixers(); cwindow->gui->lock_window("MWindow::undo_entry 1"); for( int i = 0; i < vwindows.size(); i++ ) { @@ -2196,6 +2202,7 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui) awindow->gui->async_update_assets(); + open_mixers(); cwindow->refresh_frame(CHANGE_ALL); calling_window_gui->lock_window("MWindow::undo_entry 4"); } diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 8825e25d..613c0324 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -1168,6 +1168,16 @@ int MWindowGUI::keypress_event() result = 1; break; + case 'k': case 'K': + if( alt_down() ) break; + unlock_window(); + mbuttons->transport->handle_transport(STOP, 1, 0, 0); + lock_window("MWindowGUI::keypress_event 1"); + mwindow->nearest_plugin_keyframe(shift_down(), + !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); + result = 1; + break; + case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': if( !alt_down() || shift_down() ) break; diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 0cd6e455..e86c6b76 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -20,6 +20,7 @@ */ #include "automation.h" +#include "autos.h" #include "clip.h" #include "cplayback.h" #include "cwindow.h" @@ -27,6 +28,7 @@ #include "edits.h" #include "edl.h" #include "edlsession.h" +#include "keyframe.h" #include "labels.h" #include "localsession.h" #include "maincursor.h" @@ -38,11 +40,13 @@ #include "patchbay.h" #include "playbackengine.h" #include "plugin.h" +#include "pluginset.h" #include "resourcethread.h" #include "samplescroll.h" #include "theme.h" #include "trackcanvas.h" #include "tracks.h" +#include "track.h" #include "transportque.h" #include "zoombar.h" @@ -581,215 +585,136 @@ void MWindow::select_all() int MWindow::next_label(int shift_down) { - double cursor_position = edl->local_session->get_selectionstart(1); - Label *current = edl->labels->next_label(cursor_position); - double position = !current ? -1 : current->position; - + double position = edl->local_session->get_selectionend(1); + double total_length = edl->tracks->total_length(); + Label *current = edl->labels->next_label(position); + double new_position = current ? current->position : total_length; // last playback endpoints as fake label positions double playback_start = edl->local_session->playback_start; double playback_end = edl->local_session->playback_end; - if( playback_start > cursor_position && ( position < 0 || playback_start < position ) ) - position = playback_start; - else if( playback_end > cursor_position && ( position < 0 || playback_end < position ) ) - position = playback_end; - - if( position >= 0 ) { - edl->local_session->set_selectionend(position); - if(!shift_down) - edl->local_session->set_selectionstart( - edl->local_session->get_selectionend(1)); - - update_plugin_guis(); - TimelinePane *pane = gui->get_focused_pane(); - if(edl->local_session->get_selectionend(1) >= - (double)edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / edl->session->sample_rate + - pane->canvas->time_visible() || - edl->local_session->get_selectionend(1) < (double)edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / edl->session->sample_rate) { - samplemovement((int64_t)(edl->local_session->get_selectionend(1) * - edl->session->sample_rate / - edl->local_session->zoom_sample - - pane->canvas->get_w() / - 2), - pane->number); - cwindow->update(1, 0, 0, 0, 0); - } - else - { - gui->update_patchbay(); - gui->update_timebar(0); - gui->hide_cursor(0); - gui->draw_cursor(0); - gui->zoombar->update(); - gui->flash_canvas(1); - cwindow->update(1, 0, 0, 0, 1); - } - } - else - { - goto_end(); - } - return 0; + if( playback_start > position && playback_start < new_position ) + new_position = playback_start; + else if( playback_end > position && playback_end < new_position ) + new_position = playback_end; + if( new_position > total_length ) + new_position = total_length; + edl->local_session->set_selectionend(new_position); +//printf("MWindow::next_edit_handle %d\n", shift_down); + if( !shift_down ) + edl->local_session->set_selectionstart(new_position); + return find_selection(new_position); } int MWindow::prev_label(int shift_down) { - double cursor_position = edl->local_session->get_selectionstart(1); - Label *current = edl->labels->prev_label(cursor_position); - double position = !current ? -1 : current->position; - + double position = edl->local_session->get_selectionstart(1); + Label *current = edl->labels->prev_label(position); + double new_position = current ? current->position : 0; // last playback endpoints as fake label positions double playback_start = edl->local_session->playback_start; double playback_end = edl->local_session->playback_end; - if( playback_end < cursor_position && ( position < 0 || playback_end > position ) ) - position = playback_end; - else if( playback_start < cursor_position && ( position < 0 || playback_start > position ) ) - position = playback_start; - - if( position >= 0 ) { - edl->local_session->set_selectionstart(position); - if(!shift_down) - edl->local_session->set_selectionend(edl->local_session->get_selectionstart(1)); - - update_plugin_guis(); - TimelinePane *pane = gui->get_focused_pane(); - if(edl->local_session->get_selectionstart(1) >= edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / edl->session->sample_rate + - pane->canvas->time_visible() || - edl->local_session->get_selectionstart(1) < edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / edl->session->sample_rate ) { - samplemovement((int64_t)(edl->local_session->get_selectionstart(1) * - edl->session->sample_rate / - edl->local_session->zoom_sample - - pane->canvas->get_w() / - 2), - pane->number); - cwindow->update(1, 0, 0, 0, 0); - } - else -// Don't scroll the display - { - gui->update_patchbay(); - gui->update_timebar(0); - gui->hide_cursor(0); - gui->draw_cursor(0); - gui->zoombar->update(); - gui->flash_canvas(1); - cwindow->update(1, 0, 0, 0, 1); - } - } - else - { - goto_start(); - } - return 0; + if( playback_end < position && playback_end > new_position ) + new_position = playback_end; + else if( playback_start < position && playback_start > new_position ) + new_position = playback_start; + if( new_position < 0 ) + new_position = 0; + edl->local_session->set_selectionstart(new_position); +//printf("MWindow::next_edit_handle %d\n", shift_down); + if( !shift_down ) + edl->local_session->set_selectionend(new_position); + return find_selection(new_position); } - int MWindow::next_edit_handle(int shift_down) { double position = edl->local_session->get_selectionend(1); double new_position = edl->next_edit(position); - if( new_position < edl->tracks->total_length() ) { - edl->local_session->set_selectionend(new_position); + double total_length = edl->tracks->total_length(); + if( new_position >= total_length ) + new_position = total_length; + edl->local_session->set_selectionend(new_position); //printf("MWindow::next_edit_handle %d\n", shift_down); - if(!shift_down) - edl->local_session->set_selectionstart( - edl->local_session->get_selectionend(1)); - - update_plugin_guis(); - TimelinePane *pane = gui->get_focused_pane(); - if(edl->local_session->get_selectionend(1) >= - (double)edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / - edl->session->sample_rate + - pane->canvas->time_visible() || - edl->local_session->get_selectionend(1) < (double)edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / - edl->session->sample_rate) - { - samplemovement((int64_t)(edl->local_session->get_selectionend(1) * - edl->session->sample_rate / - edl->local_session->zoom_sample - - pane->canvas->get_w() / - 2), - pane->number); - cwindow->update(1, 0, 0, 0, 0); - } - else - { - gui->update_patchbay(); - gui->update_timebar(0); - gui->hide_cursor(0); - gui->draw_cursor(0); - gui->zoombar->update(); - gui->flash_canvas(1); - cwindow->update(1, 0, 0, 0, 1); - } - } - else - { - goto_end(); - } - return 0; + if( !shift_down ) + edl->local_session->set_selectionstart(new_position); + return find_selection(new_position); } int MWindow::prev_edit_handle(int shift_down) { double position = edl->local_session->get_selectionstart(1); double new_position = edl->prev_edit(position); - - if(new_position != -1) { - edl->local_session->set_selectionstart(new_position); -//printf("MWindow::next_edit_handle %d\n", shift_down); - if(!shift_down) - edl->local_session->set_selectionend(edl->local_session->get_selectionstart(1)); - - update_plugin_guis(); -// Scroll the display - TimelinePane *pane = gui->get_focused_pane(); - if(edl->local_session->get_selectionstart(1) >= edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / - edl->session->sample_rate + - pane->canvas->time_visible() - || - edl->local_session->get_selectionstart(1) < edl->local_session->view_start[pane->number] * - edl->local_session->zoom_sample / - edl->session->sample_rate) - { - samplemovement((int64_t)(edl->local_session->get_selectionstart(1) * - edl->session->sample_rate / - edl->local_session->zoom_sample - - pane->canvas->get_w() / - 2), - pane->number); - cwindow->update(1, 0, 0, 0, 0); - } - else -// Don't scroll the display - { - gui->update_patchbay(); - gui->update_timebar(0); - gui->hide_cursor(0); - gui->draw_cursor(0); - gui->zoombar->update(); - gui->flash_canvas(1); - cwindow->update(1, 0, 0, 0, 1); + if( new_position < 0 ) + new_position = 0; + edl->local_session->set_selectionstart(new_position); + if( !shift_down ) + edl->local_session->set_selectionend(new_position); + return find_selection(new_position); +} + +int MWindow::nearest_plugin_keyframe(int shift_down, int dir) +{ + KeyFrame *keyframe = 0; + double start = edl->local_session->get_selectionstart(1); + double end = edl->local_session->get_selectionend(1); + double position = dir == PLAY_FORWARD ? end : start, new_position = 0; + for( Track *track=edl->tracks->first; track; track=track->next ) { + if( !track->record ) continue; + for( int i=0; iplugin_set.size(); ++i ) { + PluginSet *plugin_set = track->plugin_set[i]; + int64_t pos = track->to_units(position, 0); + KeyFrame *key = plugin_set->nearest_keyframe(pos, dir); + if( !key ) continue; + double key_position = track->from_units(key->position); + if( keyframe && (dir == PLAY_FORWARD ? + key_position >= new_position : + new_position >= key_position ) ) continue; + keyframe = key; new_position = key_position; } } - else - { - goto_start(); - } - return 0; -} - - + new_position = keyframe ? + keyframe->autos->track->from_units(keyframe->position) : + dir == PLAY_FORWARD ? edl->tracks->total_length() : 0; + if( !shift_down ) + start = end = new_position; + else if( dir == PLAY_FORWARD ) + end = new_position; + else + start = new_position; + edl->local_session->set_selectionstart(start); + edl->local_session->set_selectionend(end); + return find_selection(new_position); +} +int MWindow::find_selection(double position, int scroll_display) +{ + update_plugin_guis(); + TimelinePane *pane = gui->get_focused_pane(); + double pixel_zoom = (double)edl->session->sample_rate / edl->local_session->zoom_sample; + if( !scroll_display ) { + double timeline_start = edl->local_session->view_start[pane->number] / pixel_zoom; + double timeline_end = timeline_start + pane->canvas->time_visible(); + if( position >= timeline_end || position < timeline_start ) + scroll_display = 1; + } + if( scroll_display ) { + samplemovement((int64_t)(position * pixel_zoom - pane->canvas->get_w() / 2), pane->number); + cwindow->update(1, 0, 0, 0, 0); + } + else { + gui->update_patchbay(); + gui->update_timebar(0); + gui->hide_cursor(0); + gui->draw_cursor(0); + gui->zoombar->update(); + gui->flash_canvas(1); + cwindow->update(1, 0, 0, 0, 1); + } + return 0; +} int MWindow::expand_y() @@ -876,4 +801,3 @@ void MWindow::split_y() gui->resource_thread->start_draw(); } - diff --git a/cinelerra-5.1/cinelerra/pluginset.C b/cinelerra-5.1/cinelerra/pluginset.C index 2894aed3..8061289c 100644 --- a/cinelerra-5.1/cinelerra/pluginset.C +++ b/cinelerra-5.1/cinelerra/pluginset.C @@ -28,6 +28,7 @@ #include "pluginautos.h" #include "pluginset.h" #include "track.h" +#include "transportque.inc" #include @@ -171,6 +172,15 @@ Edit* PluginSet::insert_edit_after(Edit *previous_edit) return (Edit*)current; } +KeyFrame *PluginSet::nearest_keyframe(int64_t pos, int dir) +{ + Plugin *plugin = (Plugin*)editof(pos, dir, 0); + if( !plugin ) return 0; + KeyFrame *keyframe = (KeyFrame *)(dir == PLAY_FORWARD ? + plugin->keyframes->nearest_after(pos) : + plugin->keyframes->nearest_before(pos)); + return keyframe; +} int PluginSet::get_number() { diff --git a/cinelerra-5.1/cinelerra/pluginset.h b/cinelerra-5.1/cinelerra/pluginset.h index 8170db2e..f072e62b 100644 --- a/cinelerra-5.1/cinelerra/pluginset.h +++ b/cinelerra-5.1/cinelerra/pluginset.h @@ -61,6 +61,7 @@ public: int64_t plugin_change_duration(int64_t input_position, int64_t input_length, int reverse); + KeyFrame *nearest_keyframe(int64_t pos, int dir); void shift_effects(int64_t start, int64_t length, int edit_autos); Edit* insert_edit_after(Edit *previous_edit); Edit* create_edit(); diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.mkv new file mode 100644 index 00000000..9aa2d073 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 320x240 (24, 25 or 30 frames per second) +bitrate=150k +minrate=75k +maxrate=218k +tile-columns=0 +g=240 +threads=2 +quality=good +crf=37 +speed=1 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.webm new file mode 100644 index 00000000..6c9a38a6 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0320x240_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 320x240 (24, 25 or 30 frames per second) +bitrate=150k +minrate=75k +maxrate=218k +tile-columns=0 +g=240 +threads=2 +quality=good +crf=37 +speed=1 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.mkv new file mode 100644 index 00000000..f32ccc31 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x360 (24, 25 or 30 frames per second) +bitrate=276k +minrate=138k +maxrate=400k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=36 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.webm new file mode 100644 index 00000000..000fab34 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x360_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x360 (24, 25 or 30 frames per second) +bitrate=276k +minrate=138k +maxrate=400k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=36 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.mkv new file mode 100644 index 00000000..615a32b0 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x480 (Low Quality, 24, 25 or 30 frames per second) +bitrate=512k +minrate=256k +maxrate=742k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=34 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.webm new file mode 100644 index 00000000..57353c1a --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_lowQuality_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x480 (Low Quality, 24, 25 or 30 frames per second) +bitrate=512k +minrate=256k +maxrate=742k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=34 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.mkv new file mode 100644 index 00000000..46c806b3 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x480 (Medium Quality, 24, 25 or 30 frames per second) +bitrate=750k +minrate=375k +maxrate=1088k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=33 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.webm new file mode 100644 index 00000000..169c4aed --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_0640x480_mediumQuality_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 640x480 (Medium Quality, 24, 25 or 30 frames per second) +bitrate=750k +minrate=375k +maxrate=1088k +tile-columns=1 +g=240 +threads=4 +quality=good +crf=33 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.mkv new file mode 100644 index 00000000..41dab1c4 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1280x720 (24, 25 or 30 frames per second) +bitrate=1024k +minrate=512k +maxrate=1485k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=32 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.webm index d94f18a9..c05b7294 100644 --- a/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.webm +++ b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_24or25or30fps.webm @@ -1,13 +1,14 @@ webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1280x720 (24, 25 or 30 frames per second) bitrate=1024k minrate=512k maxrate=1485k -crf=32 tile-columns=2 -# gop can have an adverse affect on seeks g=240 threads=8 quality=good +crf=32 speed=4 -# Frederic Roenitz credited for opts and manual work -# for more information see Feature5.pdf section 3.4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.mkv new file mode 100644 index 00000000..08fd094e --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1280x720 (50 or 60 frames per second) +bitrate=1800k +minrate=900k +maxrate=2610k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=32 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.webm new file mode 100644 index 00000000..b32a2392 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1280x720_50or60fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1280x720 (50 or 60 frames per second) +bitrate=1800k +minrate=900k +maxrate=2610k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=32 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.mkv new file mode 100644 index 00000000..cc1fc628 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1920x1080 (24, 25 or 30 frames per second) +bitrate=1800k +minrate=900k +maxrate=2610k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=31 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.webm new file mode 100644 index 00000000..14c7453f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1920x1080 (24, 25 or 30 frames per second) +bitrate=1800k +minrate=900k +maxrate=2610k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=31 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.mkv new file mode 100644 index 00000000..2c8423ac --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1920x1080 (50 or 60 frames per second) +bitrate=3000k +minrate=1500k +maxrate=4350k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=31 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.webm new file mode 100644 index 00000000..bbbecc91 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_1920x1080_50or60fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 1920x1080 (50 or 60 frames per second) +bitrate=3000k +minrate=1500k +maxrate=4350k +tile-columns=2 +g=240 +threads=8 +quality=good +crf=31 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.mkv new file mode 100644 index 00000000..278df023 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 2560x1440 (24, 25 or 30 frames per second) +bitrate=6000k +minrate=3000k +maxrate=8700k +tile-columns=3 +g=240 +threads=16 +quality=good +crf=24 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.webm new file mode 100644 index 00000000..0372d702 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 2560x1440 (24, 25 or 30 frames per second) +bitrate=6000k +minrate=3000k +maxrate=8700k +tile-columns=3 +g=240 +threads=16 +quality=good +crf=24 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.mkv new file mode 100644 index 00000000..cb617eff --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 2560x1440 (50 or 60 frames per second) +bitrate=9000k +minrate=4500k +maxrate=13050k +tile-columns=3 +g=240 +threads=16 +quality=good +crf=24 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.webm new file mode 100644 index 00000000..4f97d4c1 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_2560x1440_50or60fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 2560x1440 (50 or 60 frames per second) +bitrate=9000k +minrate=4500k +maxrate=13050k +tile-columns=3 +g=240 +threads=16 +quality=good +crf=24 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.mkv new file mode 100644 index 00000000..1d8aba5b --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 3840x2160 (24, 25 or 30 frames per second) +bitrate=12000k +minrate=6000k +maxrate=17400k +tile-columns=4 +g=240 +threads=24 +quality=good +crf=15 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.webm new file mode 100644 index 00000000..8130e832 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_24or25or30fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 3840x2160 (24, 25 or 30 frames per second) +bitrate=12000k +minrate=6000k +maxrate=17400k +tile-columns=4 +g=240 +threads=24 +quality=good +crf=15 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.mkv b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.mkv new file mode 100644 index 00000000..8c996cbf --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.mkv @@ -0,0 +1,14 @@ +matroska libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 3840x2160 (50 or 60 frames per second) +bitrate=18000k +minrate=9000k +maxrate=26100k +tile-columns=4 +g=240 +threads=24 +quality=good +crf=15 +speed=4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.webm b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.webm new file mode 100644 index 00000000..8b903457 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9_3840x2160_50or60fps.webm @@ -0,0 +1,14 @@ +webm libvpx-vp9 +# 20171119-2100 +# based on https://developers.google.com/media/vp9/settings/vod/ +# for explanations see Feature5.pdf section 3 +# 3840x2160 (50 or 60 frames per second) +bitrate=18000k +minrate=9000k +maxrate=26100k +tile-columns=4 +g=240 +threads=24 +quality=good +crf=15 +speed=4 diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 212956b8..7ca7e4ab 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -683,9 +683,7 @@ int BC_FileBox::get_listbox_w() int BC_FileBox::get_listbox_h(int y) { - int result = get_h() - - y - - h_padding; + int result = get_h() - y - h_padding - 10; if(want_directory) result -= BC_WindowBase::get_resources()->dirbox_margin; else -- 2.26.2