sams last ladspa icons, libopus/vp9, mixer fixer, plugin resets, fmt frmsz, shm fixes
authorGood Guy <good1.2guy@gmail.com>
Sun, 19 Nov 2017 21:08:33 +0000 (14:08 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sun, 19 Nov 2017 21:08:33 +0000 (14:08 -0700)
30 files changed:
cinelerra-5.1/cinelerra/assetpopup.C
cinelerra-5.1/cinelerra/automation.C
cinelerra-5.1/cinelerra/cwindow.C
cinelerra-5.1/cinelerra/cwindow.h
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/cwindowtool.C
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/mainmenu.C
cinelerra-5.1/cinelerra/mainmenu.h
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/mwindowmove.C
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/playbackengine.C
cinelerra-5.1/cinelerra/playbackengine.h
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/theme.C
cinelerra-5.1/cinelerra/vwindow.C
cinelerra-5.1/cinelerra/zwindow.C
cinelerra-5.1/cinelerra/zwindowgui.C
cinelerra-5.1/configure.ac
cinelerra-5.1/guicast/vframe.C
cinelerra-5.1/guicast/vframe.h
cinelerra-5.1/picon/cinfinity/sc3_1427.png
cinelerra-5.1/plugins/chromakey/chromakey.C
cinelerra-5.1/plugins/chromakey/chromakey.h
cinelerra-5.1/plugins/chromakeyhsv/chromakey.C
cinelerra-5.1/plugins/chromakeyhsv/chromakey.h
cinelerra-5.1/thirdparty/src/ffmpeg-3.3.4.patch1

index 175494b5a3535c0f9e94825a2f5b7d1531115af3..47cc7f2ada894d6fc01dc66307d3c29b7d631fdf 100644 (file)
@@ -271,6 +271,8 @@ AssetPopupMixer::~AssetPopupMixer()
 
 int AssetPopupMixer::handle_event()
 {
+       ArrayList<ZWindow *>new_mixers;
+
        mwindow->select_zwindow(0);
        for( int i=0; i<mwindow->session->drag_assets->total; ++i ) {
                Indexable *indexable = mwindow->session->drag_assets->values[i];
@@ -293,9 +295,14 @@ int AssetPopupMixer::handle_event()
                char *tp = strrchr(path, '/');
                if( !tp ) tp = path; else ++tp;
                zwindow->set_title(tp);
-               zwindow->start();
+               new_mixers.append(zwindow);
        }
-        mwindow->queue_mixers(mwindow->edl,CURRENT_FRAME,0,0,1,0);
+
+       mwindow->tile_mixers();
+       for( int i=0; i<new_mixers.size(); ++i )
+               new_mixers[i]->start();
+
+       mwindow->refresh_mixers();
        mwindow->resync_guis();
        return 1;
 }
index 2a21dd4d743c3e0e4a08d901f45bfcb705373b51..a407a4899eb22a430dfc62e187d53414c736672b 100644 (file)
@@ -41,6 +41,7 @@ int Automation::autogrouptypes_fixedrange[] =
        0,
        0,
        0,
+       0,
        1
 };
 
index c292d66db2650b55672fb1841d4d40424c3d8957..7152f5a671206b40820044c6afe77d521063ca59 100644 (file)
@@ -234,11 +234,7 @@ void CWindow::update(int position,
 
        if(position)
        {
-               mwindow->queue_mixers(mwindow->edl, CURRENT_FRAME,1,0,1,0);
-               playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE,
-                       mwindow->edl,
-                       1);
+               refresh_frame(CHANGE_NONE);
        }
 
        gui->lock_window("CWindow::update 2");
@@ -309,8 +305,16 @@ int CWindow::update_position(double position)
        return 1;
 }
 
+void CWindow::refresh_frame(int change_type, EDL *edl)
+{
+       mwindow->refresh_mixers();
+       playback_engine->refresh_frame(change_type, edl);
+}
 
-
+void CWindow::refresh_frame(int change_type)
+{
+       refresh_frame(change_type, mwindow->edl);
+}
 
 CWindowRemoteHandler::
 CWindowRemoteHandler(RemoteControl *remote_control)
index 33c43a1dae587d5fe34b9d6dc4c6242d950e47e0..04845095438130882669cdce0d70da8092725360 100644 (file)
@@ -27,6 +27,7 @@
 #include "cplayback.inc"
 #include "ctracking.inc"
 #include "cwindowgui.inc"
+#include "edl.inc"
 #include "floatauto.inc"
 #include "mwindow.inc"
 #include "remotecontrol.h"
@@ -70,6 +71,8 @@ public:
        void hide_window();
        int update_position(double position);
        void stop_playback(int wait);
+       void refresh_frame(int change_type);
+       void refresh_frame(int change_type, EDL *edl);
 
        int destination;
        MWindow *mwindow;
index cb2dbac9d02fb4dc1a2b0707688b185a21401eb8..21e8e90f76ce6d1e4cd80576abcd8e51480e3061 100644 (file)
@@ -3178,10 +3178,7 @@ int CWindowCanvas::cursor_motion_event()
                gui->unlock_window();
                mwindow->restart_brender();
                mwindow->sync_parameters(CHANGE_PARAMS);
-               gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE,
-                       mwindow->edl,
-                       1);
+               mwindow->cwindow->refresh_frame(CHANGE_NONE);
                if(!redraw) gui->update_tool();
                gui->lock_window("CWindowCanvas::cursor_motion_event 2");
        }
@@ -3270,10 +3267,7 @@ int CWindowCanvas::button_press_event()
 
                mwindow->restart_brender();
                mwindow->sync_parameters(CHANGE_PARAMS);
-               gui->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE,
-                       mwindow->edl,
-                       1);
+               mwindow->cwindow->refresh_frame(CHANGE_NONE);
                if(!redraw) gui->update_tool();
                gui->lock_window("CWindowCanvas::button_press_event 2");
        }
index f326635636e1240070d28c29711e564457e41a85..bfb7856018b76733d106af2a97a94c491752f964 100644 (file)
@@ -794,8 +794,7 @@ void CWindowCameraGUI::update_preview()
        mwindow->gui->draw_overlays(1);
        mwindow->sync_parameters(CHANGE_PARAMS);
        mwindow->gui->unlock_window();
-       mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE, mwindow->edl, 1);
+       mwindow->cwindow->refresh_frame(CHANGE_NONE);
        mwindow->cwindow->gui->lock_window("CWindowCameraGUI::update_preview");
        mwindow->cwindow->gui->canvas->draw_refresh();
        mwindow->cwindow->gui->unlock_window();
@@ -1239,8 +1238,7 @@ void CWindowProjectorGUI::update_preview()
        mwindow->sync_parameters(CHANGE_PARAMS);
        mwindow->gui->draw_overlays(1);
        mwindow->gui->unlock_window();
-       mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE, mwindow->edl, 1);
+       mwindow->cwindow->refresh_frame(CHANGE_NONE);
        mwindow->cwindow->gui->lock_window("CWindowProjectorGUI::update_preview");
        mwindow->cwindow->gui->canvas->draw_refresh();
        mwindow->cwindow->gui->unlock_window();
@@ -2263,8 +2261,7 @@ void CWindowMaskGUI::update_preview()
        mwindow->sync_parameters(CHANGE_PARAMS);
        mwindow->gui->draw_overlays(1);
        mwindow->gui->unlock_window();
-       mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_NONE, mwindow->edl, 1);
+       mwindow->cwindow->refresh_frame(CHANGE_NONE);
        mwindow->cwindow->gui->lock_window("CWindowMaskGUI::update_preview");
        mwindow->cwindow->gui->canvas->draw_refresh();
        mwindow->cwindow->gui->unlock_window();
index 1b4e100dfec252dc7295cedafa093a690bba07c5..c536a2652291595c3f2c7b12e3c4e00eac2a9ee2 100644 (file)
@@ -690,6 +690,7 @@ int FFAudioStream::decode_frame(AVFrame *frame)
 int FFAudioStream::encode_activate()
 {
        if( writing >= 0 ) return writing;
+       if( !avctx->codec ) return writing = 0;
        frame_sz = avctx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE ?
                10000 : avctx->frame_size;
        return FFStream::encode_activate();
index 0bf2973d6273f21afabb506091b95586a234acd2..d85ef6bad0045d236d318b57b3316e32df202f86 100644 (file)
@@ -257,6 +257,7 @@ void MainMenu::create_objects()
        windowmenu->add_item(split_x = new SplitX(mwindow));
        windowmenu->add_item(split_y = new SplitY(mwindow));
        windowmenu->add_item(mixer_viewer = new MixerViewer(mwindow));
+       windowmenu->add_item(new TileMixers(mwindow));
        windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl-P"),'p'));
        windowmenu->add_item(new TileWindows(mwindow,_("Tile left"),0));
        windowmenu->add_item(new TileWindows(mwindow,_("Tile right"),1));
@@ -1540,3 +1541,16 @@ int MixerViewer::handle_event()
        return 1;
 }
 
+TileMixers::TileMixers(MWindow *mwindow)
+ : BC_MenuItem(_("Tile mixers"), "Alt-t", 't')
+{
+       this->mwindow = mwindow;
+       set_alt();
+}
+
+int TileMixers::handle_event()
+{
+       mwindow->tile_mixers();
+       return 1;
+}
+
index 8300bcb4a901cac017c49295f0223f902287694f..9baf2a3b01ddf875d15980b95e8b8ee6f85a080d 100644 (file)
@@ -408,6 +408,14 @@ public:
        MWindow *mwindow;
 };
 
+class TileMixers : public BC_MenuItem
+{
+public:
+       TileMixers(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
 // ======================================== audio
 
 class AddAudioTrack : public BC_MenuItem
index ae471267a903a2c8801aadff8fa68feff2b893ec..426421c3bcc2571de9badb2c74ec1e27a1d340f4 100644 (file)
@@ -250,6 +250,7 @@ MWindow::~MWindow()
        delete render;          render = 0;
        commit_commercial();
        if( commercials && !commercials->remove_user() ) commercials = 0;
+       close_mixers();
 
 // Save defaults for open plugins
        plugin_gui_lock->lock("MWindow::~MWindow");
@@ -1129,7 +1130,7 @@ ZWindow *MWindow::get_mixer(Mixer *&mixer)
        if( !mixer ) mixer = edl->mixers.new_mixer();
        ZWindow *zwindow = 0;
        for( int i=0; !zwindow && i<zwindows.size(); ++i )
-               if( !zwindows[i]->is_running() ) zwindow = zwindows[i];
+               if( zwindows[i]->idx < 0 ) zwindow = zwindows[i];
        if( !zwindow )
                zwindows.append(zwindow = new ZWindow(this));
        zwindow->idx = mixer->idx;
@@ -1175,7 +1176,7 @@ void MWindow::start_mixer()
 
        zwindow->set_title(title);
        zwindow->start();
-       queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
+       refresh_mixers();
 }
 
 int MWindow::mixer_track_active(Track *track)
@@ -1206,7 +1207,7 @@ void MWindow::queue_mixers(EDL *edl, int command, int wait_tracking,
        zwindows_lock->lock("MWindow::queue_mixers");
        for( int vidx=0; vidx<zwindows.size(); ++vidx ) {
                ZWindow *zwindow = zwindows[vidx];
-               if( !zwindow->running() ) continue;
+               if( zwindow->idx < 0 ) continue;
                Mixer *mixer = edl->mixers.get_mixer(zwindow->idx);
                if( !mixer || !mixer->mixer_ids.size() ) continue;
                int k = -1;
@@ -1238,15 +1239,39 @@ void MWindow::queue_mixers(EDL *edl, int command, int wait_tracking,
        zwindows_lock->unlock();
 }
 
+void MWindow::refresh_mixers()
+{
+       queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
+}
+
 void MWindow::stop_mixers()
 {
        for( int vidx=0; vidx<zwindows.size(); ++vidx ) {
                ZWindow *zwindow = zwindows[vidx];
-               if( !zwindow->running() ) continue;
+               if( zwindow->idx < 0 ) continue;
                zwindow->issue_command(STOP, 0, 0, 0, 0);
        }
 }
 
+void MWindow::close_mixers()
+{
+       zwindows_lock->lock("MWindow::close_mixers");
+       for( int i=0; i<zwindows.size(); ++i ) {
+               ZWindow *zwindow = zwindows[i];
+               if( zwindow->idx < 0 ) continue;
+               ZWindowGUI *zgui = zwindow->zgui;
+               zgui->lock_window("MWindow::select_zwindow 0");
+               zgui->set_done(0);
+               zgui->unlock_window();
+       }
+       zwindows_lock->unlock();
+       for( int i=0; i<zwindows.size(); ++i ) {
+               ZWindow *zwindow = zwindows[i];
+               if( zwindow->idx < 0 ) continue;
+               zwindow->close_window();
+       }
+}
+
 int MWindow::select_zwindow(ZWindow *zwindow)
 {
        int ret = 0, n = zwindows.number_of(zwindow);
@@ -1254,7 +1279,7 @@ int MWindow::select_zwindow(ZWindow *zwindow)
                session->selected_zwindow = n;
                for( int i=0; i<zwindows.size(); ++i ) {
                        ZWindow *zwindow = zwindows[i];
-                       if( !zwindow->running() ) continue;
+                       if( zwindow->idx < 0 ) continue;
                        ZWindowGUI *zgui = zwindow->zgui;
                        zgui->lock_window("MWindow::select_zwindow 0");
                        zwindow->highlighted = i == n ? 1 : 0;
@@ -1270,6 +1295,61 @@ int MWindow::select_zwindow(ZWindow *zwindow)
        return ret;
 }
 
+void MWindow::tile_mixers()
+{
+       int nz = 0;
+       for( int i=0; i<zwindows.size(); ++i ) {
+               ZWindow *zwindow = zwindows[i];
+               if( zwindow->idx < 0 ) continue;
+               ++nz;
+       }
+       if( !nz ) return;
+       int zn = ceil(sqrt(nz));
+       int x1 = 1 + gui->get_x(), x2 = cwindow->gui->get_x();
+       int y1 = 1, y2 = gui->get_y();
+       int rw = gui->get_root_w(0), rh = gui->get_root_h(0);
+       if( x1 < 0 ) x1 = 0;
+       if( y1 < 0 ) y1 = 0;
+       if( x2 > rw ) x2 = rw;
+       if( y2 > rh ) y2 = rh;
+       int dx = x2 - x1, dy = y2 - y1;
+       int zw = dx / zn;
+       int lt = BC_DisplayInfo::get_left_border();
+       int top = BC_DisplayInfo::get_top_border();
+       int bw = lt + BC_DisplayInfo::get_right_border();  // borders
+       int bh = top + BC_DisplayInfo::get_bottom_border();
+       int zx = 0, zy = 0;  // window origins
+       int mw = 10+10, mh = 10+10; // canvas margins
+       int rsz = 0, n = 0, dz = 0;
+       int ow = edl->session->output_w, oh = edl->session->output_h;
+       for( int i=0; i<zwindows.size(); ++i ) {
+               ZWindow *zwindow = zwindows[i];
+               if( zwindow->idx < 0 ) continue;
+               int ww = zw - bw, hh = (ww - mw) * oh / ow + mh, zh = hh + bh;
+               if( rsz < hh ) rsz = hh;
+               int xx = zx + x1, yy = zy + y1;
+               int mx = x2 - zw, my = y2 - zh;
+               if( xx > mx ) xx = mx;
+               if( yy > my ) yy = my;
+               xx += lt + dz;  yy += top + dz;
+               zwindow->reposition(xx,yy, ww,hh);
+               if( zwindow->running() ) {
+                       ZWindowGUI *gui = (ZWindowGUI *)zwindow->get_gui();
+                       gui->lock_window("MWindow::tile_mixers");
+                       gui->BC_WindowBase::reposition_window(xx,yy, ww,hh);
+                       gui->unlock_window();
+               }
+               if( ++n >= zn ) {
+                       n = 0;  rsz += bh;
+                       if( (zy += rsz) > (dy - rsz) ) dz += 10;
+                       rsz = 0;
+                       zx = 0;
+               }
+               else
+                       zx += zw;
+       }
+}
+
 
 void MWindow::init_cache()
 {
@@ -1572,7 +1652,7 @@ void MWindow::stop_playback(int wait)
        }
        for(int i = 0; i < zwindows.size(); i++) {
                ZWindow *zwindow = zwindows[i];
-               if( !zwindow->is_running() ) continue;
+               if( zwindow->idx < 0 ) continue;
                zwindow->stop_playback(wait);
        }
 }
@@ -2662,11 +2742,7 @@ void MWindow::sync_parameters(int change_type)
        }
        else
        {
-               queue_mixers(edl,CURRENT_FRAME,0,0,1,0);
-               cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                                                       change_type,
-                                                       edl,
-                                                       1);
+               cwindow->refresh_frame(change_type);
        }
 }
 
@@ -3201,11 +3277,7 @@ void MWindow::update_project(int load_mode)
                }
                if(debug) PRINT_TRACE
                select_zwindow(0);
-               for( int i=0; i<zwindows.size(); ++i ) {
-                       ZWindow *zwindow = zwindows[i];
-                       if( !zwindow->is_running() ) continue;
-                       zwindow->close_window();
-               }
+               close_mixers();
 
                for( int i=0; i<edl->mixers.size(); ++i ) {
                        Mixer *mixer = edl->mixers[i];
@@ -3231,10 +3303,7 @@ void MWindow::update_project(int load_mode)
        cwindow->gui->unlock_window();
 
        if(debug) PRINT_TRACE
-       cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-               CHANGE_ALL,
-               edl,
-               1);
+       cwindow->refresh_frame(CHANGE_ALL);
 
        awindow->gui->async_update_assets();
        if(debug) PRINT_TRACE
index f15081b63b6adc296bbda43bd641198fed6420a8..271a4f89e5be0e87dc98247fca30bef618db35ef 100644 (file)
@@ -206,13 +206,16 @@ public:
 
        void queue_mixers(EDL *edl, int command, int wait_tracking,
                int use_inout, int update_refresh, int toggle_audio);
+       void refresh_mixers();
        void stop_mixers();
+       void close_mixers();
        ZWindow *get_mixer(Mixer *&mixer);
        void del_mixer(ZWindow *zwindow);
        int mixer_track_active(Track *track);
        void update_mixer_tracks();
        void start_mixer();
        int select_zwindow(ZWindow *zwindow);
+       void tile_mixers();
 
        int load_filenames(ArrayList<char*> *filenames,
                int load_mode = LOADMODE_REPLACE,
index e128a19bfdd68767466fd22ecaf1706fae82c107..84232955d9aa2bd44bc37325f03884e7177d2bba 100644 (file)
@@ -96,8 +96,7 @@ void MWindow::add_audio_track_entry(int above, Track *dst)
 //     gui->cursor->draw(1);
 //     gui->canvas->flash();
 //     gui->canvas->activate();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::add_video_track_entry(Track *dst)
@@ -116,8 +115,7 @@ void MWindow::add_video_track_entry(Track *dst)
 //     gui->cursor->draw(1);
 //     gui->canvas->flash();
 //     gui->canvas->activate();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
        save_backup();
 }
 
@@ -137,8 +135,7 @@ void MWindow::add_subttl_track_entry(Track *dst)
 //     gui->cursor->draw(1);
 //     gui->canvas->flash();
 //     gui->canvas->activate();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
        save_backup();
 }
 
@@ -311,8 +308,7 @@ void MWindow::clear_entry()
        update_plugin_guis();
        gui->update(1, 2, 1, 1, 1, 1, 0);
        cwindow->update(1, 0, 0, 0, 1);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::clear(int clear_handle)
@@ -408,8 +404,7 @@ void MWindow::concatenate_tracks()
 
        restart_brender();
        gui->update(1, 1, 0, 0, 1, 0, 0);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 
@@ -505,8 +500,7 @@ void MWindow::crop_video()
        undo->update_undo_after(_("crop"), LOAD_ALL);
 
        restart_brender();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+       cwindow->refresh_frame(CHANGE_ALL);
        save_backup();
 }
 
@@ -532,8 +526,7 @@ void MWindow::blade(double position)
        gui->update(1, 2, 1, 1, 1, 1, 0);
        cwindow->update(1, 0, 0, 0, 1);
        awindow->gui->async_update_assets();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::cut(double start, double end, double new_position)
@@ -557,8 +550,7 @@ void MWindow::cut(double start, double end, double new_position)
        gui->update(1, 2, 1, 1, 1, 1, 0);
        cwindow->update(1, 0, 0, 0, 1);
        awindow->gui->async_update_assets();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::snap_left_edit()
@@ -668,8 +660,7 @@ void MWindow::delete_tracks()
        update_plugin_states();
 
        gui->update(1, 1, 1, 0, 1, 0, 0);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::delete_track(Track *track)
@@ -682,8 +673,7 @@ void MWindow::delete_track(Track *track)
        update_plugin_states();
 
        gui->update(1, 1, 1, 0, 1, 0, 0);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
        save_backup();
 }
 
@@ -941,8 +931,7 @@ void MWindow::move_edits(ArrayList<Edit*> *edits,
        undo->update_undo_after(_("move edit"), LOAD_ALL);
 
        restart_brender();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 
        update_plugin_guis();
        gui->update(1, 1,      // 1 for incremental drawing.  2 for full refresh
@@ -957,8 +946,7 @@ void MWindow::move_effect(Plugin *plugin, Track *track, int64_t position)
        undo->update_undo_after(_("paste effect"), LOAD_ALL);
 
        restart_brender();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1); 
+       cwindow->refresh_frame(CHANGE_EDL);
        update_plugin_guis();
        gui->update(1, 1,      // 1 for incremental drawing.  2 for full refresh
                0, 0, 0, 0, 0);
@@ -972,8 +960,7 @@ void MWindow::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t positio
        undo->update_undo_after(_("move effect"), LOAD_ALL);
 
        restart_brender();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
        update_plugin_guis();
        gui->update(1, 1,      // 1 for incremental drawing.  2 for full refresh
                0, 0, 0, 0, 0);
@@ -1078,8 +1065,7 @@ void MWindow::mute_selection()
                restart_brender();
                update_plugin_guis();
                gui->update(1, 2, 1, 1, 1, 1, 0);
-               cwindow->playback_engine->que->
-                       send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+               cwindow->refresh_frame(CHANGE_EDL);
        }
 }
 
@@ -1643,8 +1629,7 @@ void MWindow::paste_silence()
        restart_brender();
        gui->update(1, 2, 1, 1, 1, 1, 0);
        cwindow->update(1, 0, 0, 0, 1);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 void MWindow::detach_transition(Transition *transition)
@@ -1924,8 +1909,7 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui)
                }
        }
 
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+       cwindow->refresh_frame(CHANGE_ALL);
 }
 
 
@@ -2168,8 +2152,7 @@ void MWindow::trim_selection()
        cwindow->update(1, 0, 0, 0, 1);
        awindow->gui->async_update_assets();
        restart_brender();
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 
@@ -2213,8 +2196,7 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui)
 
        awindow->gui->async_update_assets();
 
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+       cwindow->refresh_frame(CHANGE_ALL);
        calling_window_gui->lock_window("MWindow::undo_entry 4");
 }
 
@@ -2426,8 +2408,7 @@ void MWindow::cut_commercials()
        update_plugin_guis();
        gui->update(1, 2, 1, 1, 1, 1, 0);
        cwindow->update(1, 0, 0, 0, 1);
-       cwindow->playback_engine->que->
-               send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
+       cwindow->refresh_frame(CHANGE_EDL);
 }
 
 
index 06fb11cc463c4c76d4204b51baac1c002f92ab3a..0cd6e455d6778dc11389dcd7206f8776cbe90194 100644 (file)
@@ -178,10 +178,17 @@ void MWindow::fit_autos(int doall)
                switch (i)
                {
                case AUTOGROUPTYPE_AUDIO_FADE:
+                       if (range < 1) {
+                               min = MIN(min, edl->local_session->automation_mins[i]);
+                               max = MAX(max, edl->local_session->automation_maxs[i]);
+                               if( min >= max-0.1 ) { min = -80.0; min = 6.0; }
+                       }
+                       break;
                case AUTOGROUPTYPE_VIDEO_FADE:
-                       if (range < 0.1) {
+                       if (range < 1) {
                                min = MIN(min, edl->local_session->automation_mins[i]);
                                max = MAX(max, edl->local_session->automation_maxs[i]);
+                               if( min >= max-0.1 ) { min = 0.0; min = 100.0; }
                        }
                        break;
                case AUTOGROUPTYPE_ZOOM:
@@ -198,9 +205,10 @@ void MWindow::fit_autos(int doall)
                        break;
                case AUTOGROUPTYPE_X:
                case AUTOGROUPTYPE_Y:
-                       if (range < 5) {
-                               min = floor((min+max)/2) - 50;
-                               max = floor((min+max)/2) + 50;
+                       if (range < 1) {
+                               float scale = bmin(edl->session->output_w, edl->session->output_h);
+                               min = floor((min+max)/2) - 0.5*scale;
+                               max = floor((min+max)/2) + 0.5*scale;
                        }
                        break;
                }
index d157d58a4f34a7a4a9abaecf77d8c139e2a72dcd..9d7dea8e69222f70e4c4e951d34aa34ff8f57683 100644 (file)
@@ -601,7 +601,7 @@ int FrameRatePulldown::handle_event()
 
 FrameSizePulldown::FrameSizePulldown(Theme *theme,
                BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
- : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT,
+ : BC_ListBox(x, y, 180, 250, LISTBOX_TEXT,
        &theme->frame_sizes, 0, 0, 1, 0, 1)
 {
        this->theme = theme;
index 2842377a4f567bebca237e326308e227a8c8a1c0..1d3a4115cef058b279ff5f1790b6d30d2ed64064 100644 (file)
@@ -490,3 +490,8 @@ void PlaybackEngine::issue_command(EDL *edl, int command, int wait_tracking,
        }
 }
 
+void PlaybackEngine::refresh_frame(int change_type, EDL *edl)
+{
+       que->send_command(CURRENT_FRAME, change_type, edl, 1);
+}
+
index 5d915877eece836e0345e683c100cb2934167263..2fd071677bb52b19157781f6c1c04b459c4429df 100644 (file)
@@ -84,6 +84,7 @@ public:
        void stop_playback(int wait);
        void issue_command(EDL *edl, int command, int wait_tracking,
                int use_inout, int update_refresh, int toggle_audio);
+       void refresh_frame(int change_type, EDL *edl);
 
 // Maintain caches through console changes
        CICache *audio_cache, *video_cache;
index 3e4ac56fb2617970d324142d6b7fe469ee65286c..9cca7fa56ec73eb89895ab442c671152fb4b4fd5 100644 (file)
@@ -317,10 +317,7 @@ int PreferencesThread::apply_settings()
 //printf("PreferencesThread::apply_settings 1\n");
 // This doesn't stop and restart, only reloads the assets before
 // the next play command.
-               mwindow->cwindow->playback_engine->que->send_command(CURRENT_FRAME,
-                       CHANGE_ALL,
-                       mwindow->edl,
-                       1);
+               mwindow->cwindow->refresh_frame(CHANGE_ALL, mwindow->edl);
 //printf("PreferencesThread::apply_settings 10\n");
        }
 
index a04d01fef4d68da521cda261ff6478f7034b5f8d..9ed3195991fb09a96043696ffe6067ae683d9b3f 100644 (file)
@@ -265,22 +265,44 @@ void Theme::build_menus()
        aspect_ratios.append(new BC_ListBoxItem("2.35:1"));
        aspect_ratios.append(new BC_ListBoxItem("2.66:1"));
 
-       frame_sizes.append(new BC_ListBoxItem("128x96"));
-       frame_sizes.append(new BC_ListBoxItem("160x120"));
-       frame_sizes.append(new BC_ListBoxItem("320x240"));
-       frame_sizes.append(new BC_ListBoxItem("360x240"));
-       frame_sizes.append(new BC_ListBoxItem("400x300"));
-       frame_sizes.append(new BC_ListBoxItem("640x400"));
-       frame_sizes.append(new BC_ListBoxItem("640x480"));
-       frame_sizes.append(new BC_ListBoxItem("720x480"));
-       frame_sizes.append(new BC_ListBoxItem("800x600"));
-       frame_sizes.append(new BC_ListBoxItem("1024x768"));
-       frame_sizes.append(new BC_ListBoxItem("1280x720"));
-       frame_sizes.append(new BC_ListBoxItem("1280x1024"));
-       frame_sizes.append(new BC_ListBoxItem("1600x1200"));
-       frame_sizes.append(new BC_ListBoxItem("1920x1080"));
-       frame_sizes.append(new BC_ListBoxItem("3840x2160"));
-       frame_sizes.append(new BC_ListBoxItem("4096x1720"));
+       frame_sizes.append(new BC_ListBoxItem("128x96     "));
+       frame_sizes.append(new BC_ListBoxItem("160x120    "));
+       frame_sizes.append(new BC_ListBoxItem("320x240    "));
+       frame_sizes.append(new BC_ListBoxItem("360x240    "));
+       frame_sizes.append(new BC_ListBoxItem("400x300    "));
+       frame_sizes.append(new BC_ListBoxItem("640x360    nHD"));
+       frame_sizes.append(new BC_ListBoxItem("640x400    "));
+       frame_sizes.append(new BC_ListBoxItem("640x480    VGA"));
+       frame_sizes.append(new BC_ListBoxItem("720x480    NTSC"));
+       frame_sizes.append(new BC_ListBoxItem("720x576    PAL"));
+       frame_sizes.append(new BC_ListBoxItem("768x432    "));
+       frame_sizes.append(new BC_ListBoxItem("800x450    "));
+       frame_sizes.append(new BC_ListBoxItem("800x600    SVGA"));
+       frame_sizes.append(new BC_ListBoxItem("896x504    "));
+       frame_sizes.append(new BC_ListBoxItem("960x540    qHD"));
+       frame_sizes.append(new BC_ListBoxItem("1024x576   "));
+       frame_sizes.append(new BC_ListBoxItem("1024x768   XGA"));
+       frame_sizes.append(new BC_ListBoxItem("1152x648   "));
+       frame_sizes.append(new BC_ListBoxItem("1280x720   HD"));
+       frame_sizes.append(new BC_ListBoxItem("1280x1024  SXGA"));
+       frame_sizes.append(new BC_ListBoxItem("1366x768   WXGA"));
+       frame_sizes.append(new BC_ListBoxItem("1600x900   HD+"));
+       frame_sizes.append(new BC_ListBoxItem("1600x1200  UXGA"));
+       frame_sizes.append(new BC_ListBoxItem("1920x1080  Full HD"));
+       frame_sizes.append(new BC_ListBoxItem("2048x1152  "));
+       frame_sizes.append(new BC_ListBoxItem("2304x1296  "));
+       frame_sizes.append(new BC_ListBoxItem("2560x1440  QHD"));
+       frame_sizes.append(new BC_ListBoxItem("2880x1620  "));
+       frame_sizes.append(new BC_ListBoxItem("3200x1800  QHD+"));
+       frame_sizes.append(new BC_ListBoxItem("3520x1980  "));
+       frame_sizes.append(new BC_ListBoxItem("3840x2160  4K UHD"));
+       frame_sizes.append(new BC_ListBoxItem("4096x2304  Full 4K UHD"));
+       frame_sizes.append(new BC_ListBoxItem("4480x2520  "));
+       frame_sizes.append(new BC_ListBoxItem("5120x2880  5K UHD"));
+       frame_sizes.append(new BC_ListBoxItem("5760x3240  "));
+       frame_sizes.append(new BC_ListBoxItem("6400x3600  "));
+       frame_sizes.append(new BC_ListBoxItem("7040x3960  "));
+       frame_sizes.append(new BC_ListBoxItem("7680x4320  8K UHD"));
 
        sample_rates.append(new BC_ListBoxItem("8000"));
        sample_rates.append(new BC_ListBoxItem("16000"));
index 717972a1e663a15554cca1c1cd011f4535e113c4..897f21ec8c7e77a946984ac9634b0f78a1c978fe 100644 (file)
@@ -328,10 +328,7 @@ void VWindow::update_position(int change_type,
        {
 //printf("VWindow::update_position %d\n", __LINE__);
 //edl->dump();
-               playback_engine->que->send_command(CURRENT_FRAME,
-                       change_type,
-                       edl,
-                       1);
+               playback_engine->refresh_frame(change_type, edl);
 
                double position = edl->local_session->get_selectionstart(1);
                if(lock_window) gui->lock_window("VWindow::update_position");
index 46e00a91336f16338f7dba8326132b824f0b6109..c970f22f7ce4c69b9ae442e949fcc9558fbd1c2a 100644 (file)
@@ -206,6 +206,7 @@ BC_Window* ZWindow::new_gui()
 
 void ZWindow::handle_done_event(int result)
 {
+       mwindow->del_mixer(this);
 }
 void ZWindow::handle_close_event(int result)
 {
@@ -218,7 +219,7 @@ void ZWindow::change_source(EDL *edl)
                this->edl->remove_user();
        this->edl = edl;
        if( edl != 0 ) {
-               zgui->playback_engine->que->send_command(CURRENT_FRAME, CHANGE_ALL, edl, 1);
+               zgui->playback_engine->refresh_frame(CHANGE_ALL, edl);
        }
 }
 
@@ -252,17 +253,18 @@ void ZWindow::update_mixer_ids()
 
 void ZWindow::set_title(const char *tp)
 {
+       Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
+       if( mixer ) mixer->set_title(tp);
        char *cp = title, *ep = cp + sizeof(title)-1;
        cp += snprintf(title, ep-cp, _("Mixer %d"), idx);
        if( tp ) cp += snprintf(cp, ep-cp, ": %s", tp);
-       else tp = title;
-       Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
-       if( mixer ) mixer->set_title(title);
+       *cp = 0;
 }
 
 void ZWindow::reposition(int x, int y, int w, int h)
 {
        Mixer *mixer = mwindow->edl->mixers.get_mixer(idx);
-       if( mixer ) mixer->reposition(x, y, w, h);
+       if( !mixer ) return;
+       mixer->reposition(x, y, w, h);
 }
 
index b374c2deec73c39106585f2d0c88a8658814df01..d28e3e9e1c098a83e4b780400bb25476b287fe8f 100644 (file)
@@ -38,8 +38,8 @@
 #include "zwindowgui.h"
 
 ZWindowGUI::ZWindowGUI(MWindow *mwindow, ZWindow *zwindow, Mixer *mixer)
- : BC_Window(mixer->title, mixer->x, mixer->y, mixer->w, mixer->h,
-       100, 100, 1, 1, 0)
+ : BC_Window(zwindow->title, mixer->x, mixer->y, mixer->w, mixer->h,
+       100, 75, 1, 1, 0)
 {
        this->mwindow = mwindow;
        this->zwindow = zwindow;
@@ -76,16 +76,13 @@ int ZWindowGUI::resize_event(int w, int h)
        BC_WindowBase::resize_event(w, h);
        return 1;
 }
-
 int ZWindowGUI::translation_event()
 {
-       zwindow->reposition(get_x(), get_y(), get_w(), get_h());
-       return 0;
+       return resize_event(get_w(),get_h());
 }
 
 int ZWindowGUI::close_event()
 {
-       mwindow->del_mixer(zwindow);
        set_done(0);
        return 1;
 }
index 3ec19dfd5a05879e00e1c2002f6f8dea5fd93b07..4fe5c0f00c12ae664999e0f20b97fba8d556056c 100644 (file)
@@ -453,6 +453,8 @@ CHECK_LIB([fdk], [fdk-aac], [faacDecInit])
 CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
 CHECK_LIB([jbig], [jbig], [jbg_dec_init])
 CHECK_LIB([vdpau], [vdpau], [vdp_device_create_x11])
+CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
+CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
 
 #if test "x$HAVE_mjpegtools" = "xyes"; then
 #CFG_CFLAGS+=" -I/usr/include/mjpegtools"
@@ -710,6 +712,12 @@ if test "x$HAVE_DL" = "xyes"; then
   EXTRA_LIBS+=' -ldl'
   FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
 fi
+if test "x$HAVE_opus" = "xyes"; then
+  EXTRA_LIBS+=' -lopus'
+  CFG_CFLAGS+=' -I/usr/include/opus'
+  FFMPEG_EXTRA_CFG+=' --enable-libopus'
+fi
+
 AC_SUBST(EXTRA_LIBS)
 AC_SUBST(FFMPEG_EXTRA_CFG)
 AC_SUBST(WANT_X264_HIDEPTH)
@@ -836,3 +844,6 @@ fi
 if test "x$WANT_GIT_FFMPEG" != "xno"; then
 echo "ffmpeg.git := $WANT_GIT_FFMPEG"
 fi
+if test "x$HAVE_opus" = "xyes"; then
+echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
+fi
index 1cfeb58b8c988b8daae95244f259f09618dd6088..eaa1f078cb826c063f27880296de0b507d4dfb90 100644 (file)
@@ -131,6 +131,7 @@ VFrame::VFrame(VFrame &frame)
 {
        reset_parameters(1);
        params = new BC_Hash;
+       use_shm = frame.use_shm;
        allocate_data(0, -1, 0, 0, 0, frame.w, frame.h,
                frame.color_model, frame.bytes_per_line);
        copy_from(&frame);
@@ -504,7 +505,8 @@ int VFrame::allocate_data(unsigned char *data, int shmid,
                this->data = 0;
                int size = calculate_data_size(this->w, this->h,
                        this->bytes_per_line, this->color_model);
-               if(BC_WindowBase::get_resources()->use_vframe_shm() && use_shm) {
+               if( use_shm && size >= SHM_MIN_SIZE &&
+                   BC_WindowBase::get_resources()->use_vframe_shm() ) {
                        this->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
                        if( this->shmid >= 0 ) {
                                this->data = (unsigned char*)shmat(this->shmid, NULL, 0);
@@ -520,7 +522,7 @@ int VFrame::allocate_data(unsigned char *data, int shmid,
                        }
                }
 // Have to use malloc for libpng
-               if( !data ) {
+               if( !this->data ) {
                        this->data = (unsigned char *)malloc(size);
                        this->shmid = -1;
                }
index 951e0364b92869a55df2da2f957dbdb1fcdc323b..45dbe11f5c2594a07c88352d1db4c19c95e321c0 100644 (file)
@@ -34,7 +34,7 @@
 
 // Maximum number of prev or next effects to be pushed onto the stacks.
 #define MAX_STACK_ELEMENTS 255
-
+#define SHM_MIN_SIZE 2048
 
 // Scene graph for 3D models
 // Defined by the subclass
index 4f31af97659f28e631c9bef3cf7c236a577bbba8..2866c7065a3411f76c1e62a101ed71461584d33b 100644 (file)
Binary files a/cinelerra-5.1/picon/cinfinity/sc3_1427.png and b/cinelerra-5.1/picon/cinfinity/sc3_1427.png differ
index 90934f3e9b27807a2990c2c7d06c0642f0f2834b..4eb39787aca1d997ac80c208f511c7393e39769f 100644 (file)
 
 
 
+ChromaKeyConfig::ChromaKeyConfig()
+{
+       reset();
+}
 
+void ChromaKeyConfig::reset()
 
-ChromaKeyConfig::ChromaKeyConfig()
 {
        red = 0.0;
        green = 0.0;
@@ -147,6 +151,9 @@ void ChromaKeyWindow::create_objects()
        y += 30;
        add_subwindow(use_colorpicker = new ChromaKeyUseColorPicker(plugin, this, x1, y));
 
+       y += use_colorpicker->get_h() + 10;
+       add_subwindow(new ChromaKeyReset(plugin, this, x, y));
+
        color_thread = new ChromaKeyColorThread(plugin, this);
 
        update_sample();
@@ -246,7 +253,6 @@ int ChromaKeySlope::handle_event()
        return 1;
 }
 
-
 ChromaKeyUseValue::ChromaKeyUseValue(ChromaKey *plugin, int x, int y)
  : BC_CheckBox(x, y, plugin->config.use_value, _("Use value"))
 {
@@ -259,6 +265,20 @@ int ChromaKeyUseValue::handle_event()
        return 1;
 }
 
+ChromaKeyReset::ChromaKeyReset(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y)
+ : BC_GenericButton(x, y, _("Reset"))
+{
+       this->plugin = plugin;
+       this->gui = gui;
+}
+
+int ChromaKeyReset::handle_event()
+{
+       plugin->config.reset();
+       gui->update_gui();
+       plugin->send_configure_change();
+       return 1;
+}
 
 ChromaKeyUseColorPicker::ChromaKeyUseColorPicker(ChromaKey *plugin,
        ChromaKeyWindow *gui,
@@ -630,15 +650,20 @@ void ChromaKey::update_gui()
        {
                load_configuration();
                thread->window->lock_window();
-               ((ChromaKeyWindow*)thread->window)->threshold->update(config.threshold);
-               ((ChromaKeyWindow*)thread->window)->slope->update(config.slope);
-               ((ChromaKeyWindow*)thread->window)->use_value->update(config.use_value);
-               ((ChromaKeyWindow*)thread->window)->update_sample();
-
+               ((ChromaKeyWindow *)(thread->window))->update_gui();
                thread->window->unlock_window();
        }
 }
 
+void ChromaKeyWindow::update_gui()
+{
+       ChromaKeyConfig &config = plugin->config;
+       threshold->update(config.threshold);
+       slope->update(config.slope);
+       use_value->update(config.use_value);
+       update_sample();
+}
+
 int ChromaKey::handle_opengl()
 {
 #ifdef HAVE_GL
index 8e1a1aafada53e5bb08dba57560de047c04f31e8..f282554fec9df80c558dedaa5b29802ec0276a69 100644 (file)
@@ -39,7 +39,7 @@ class ChromaKeyConfig
 {
 public:
        ChromaKeyConfig();
-
+       void reset();
        void copy_from(ChromaKeyConfig &src);
        int equivalent(ChromaKeyConfig &src);
        void interpolate(ChromaKeyConfig &prev,
@@ -93,6 +93,15 @@ public:
        ChromaKey *plugin;
 };
 
+class ChromaKeyReset : public BC_GenericButton
+{
+public:
+       ChromaKeyReset(ChromaKey *plugin, ChromaKeyWindow *gui, int x, int y);
+       int handle_event();
+       ChromaKey *plugin;
+       ChromaKeyWindow *gui;
+};
+
 class ChromaKeyUseColorPicker : public BC_GenericButton
 {
 public:
@@ -120,6 +129,7 @@ public:
        ~ChromaKeyWindow();
 
        void create_objects();
+       void update_gui();
        void update_sample();
        void done_event(int result);
 
@@ -128,6 +138,7 @@ public:
        ChromaKeyUseValue *use_value;
        ChromaKeyUseColorPicker *use_colorpicker;
        ChromaKeySlope *slope;
+       ChromaKeyReset *reset;
        BC_SubWindow *sample;
        ChromaKey *plugin;
        ChromaKeyColorThread *color_thread;
index 5558606b34953619fba1bb568ff7dd13bd24814c..b0a09757891033a0f96476aedc2b26accc8ff602 100644 (file)
 
 
 ChromaKeyConfig::ChromaKeyConfig ()
+{
+       reset();
+}
+
+void ChromaKeyConfig::reset()
+
 {
   red = 0.0;
   green = 1.0;
@@ -187,6 +193,8 @@ ChromaKeyWindow::create_objects ()
   add_subwindow (use_colorpicker =
                 new ChromaKeyUseColorPicker (plugin, this, x, y));
   y += use_colorpicker->get_h() + 10;
+
+  add_subwindow (new ChromaKeyReset (plugin, this, x2+240, y));
   add_subwindow (show_mask = new ChromaKeyShowMask (plugin, x2, y));
        y += show_mask->get_h() + 5;
 
@@ -465,6 +473,21 @@ ChromaKeyShowMask::handle_event ()
   return 1;
 }
 
+ChromaKeyReset::ChromaKeyReset (ChromaKeyHSV *plugin, ChromaKeyWindow *gui, int x, int y)
+ :BC_GenericButton(x, y, _("Reset"))
+{
+  this->plugin = plugin;
+  this->gui = gui;
+}
+
+int ChromaKeyReset::handle_event ()
+{
+  plugin->config.reset();
+  gui->update_gui();
+  plugin->send_configure_change();
+  return 1;
+}
+
 ChromaKeyUseColorPicker::ChromaKeyUseColorPicker (ChromaKeyHSV * plugin, ChromaKeyWindow * gui, int x, int y)
  : BC_GenericButton (x, y,
                  _
@@ -1003,22 +1026,27 @@ void ChromaKeyHSV::update_gui()
                load_configuration();
                ChromaKeyWindow *window = (ChromaKeyWindow*)thread->window;
                window->lock_window();
-               window->min_brightness->update(config.min_brightness);
-               window->max_brightness->update(config.max_brightness);
-               window->saturation->update(config.saturation);
-               window->min_saturation->update(config.min_saturation);
-               window->tolerance->update(config.tolerance);
-               window->in_slope->update(config.in_slope);
-               window->out_slope->update(config.out_slope);
-               window->alpha_offset->update(config.alpha_offset);
-               window->spill_threshold->update(config.spill_threshold);
-               window->spill_amount->update(config.spill_amount);
-               window->show_mask->update(config.show_mask);
-               window->update_sample();
+               window->update_gui();
                window->unlock_window();
        }
 }
 
+void ChromaKeyWindow::update_gui()
+{
+       ChromaKeyConfig &config = plugin->config;
+       min_brightness->update(config.min_brightness);
+       max_brightness->update(config.max_brightness);
+       saturation->update(config.saturation);
+       min_saturation->update(config.min_saturation);
+       tolerance->update(config.tolerance);
+       in_slope->update(config.in_slope);
+       out_slope->update(config.out_slope);
+       alpha_offset->update(config.alpha_offset);
+       spill_threshold->update(config.spill_threshold);
+       spill_amount->update(config.spill_amount);
+       show_mask->update(config.show_mask);
+       update_sample();
+}
 
 
 
index 68fd8b3b2f2df146860d857a320e4929e4476da1..51bcbcf75ab52997fb0580494f06d3d59da4befb 100644 (file)
@@ -45,7 +45,7 @@ class ChromaKeyConfig
 {
 public:
        ChromaKeyConfig();
-
+       void reset();
        void copy_from(ChromaKeyConfig &src);
        int equivalent(ChromaKeyConfig &src);
        void interpolate(ChromaKeyConfig &prev,
@@ -90,6 +90,16 @@ public:
        ChromaKeyWindow *gui;
 };
 
+class ChromaKeyReset : public BC_GenericButton
+{
+public:
+       ChromaKeyReset(ChromaKeyHSV *plugin, ChromaKeyWindow *gui, int x, int y);
+       int handle_event();
+       ChromaKeyHSV *plugin;
+       ChromaKeyWindow *gui;
+};
+
+
 
 class ChromaKeyMinBrightness : public BC_FSlider
 {
@@ -209,6 +219,7 @@ public:
 
        void create_objects();
        void update_sample();
+       void update_gui();
        void done_event(int result);
 
        ChromaKeyColor *color;
@@ -224,6 +235,7 @@ public:
        ChromaKeySpillThreshold *spill_threshold;
        ChromaKeySpillAmount *spill_amount;
        ChromaKeyShowMask *show_mask;
+       ChromaKeyReset *reset;
        BC_SubWindow *sample;
        ChromaKeyHSV *plugin;
        ChromaKeyColorThread *color_thread;
index 295779d2475717a00552a65d968e53215dfa82cb..40d7eddc27a9a46c8e295cfff8f72000ff0a00bb 100644 (file)
@@ -1,6 +1,15 @@
 diff -urN a/configure b/configure
 --- a/configure        2017-04-12 19:55:54.000000000 -0600
 +++ b/configure        2017-04-16 16:12:23.518837543 -0600
+@@ -5812,7 +5812,7 @@
+                                { check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+                                die "ERROR: libopenjpeg not found"; }
+ enabled libopenmpt        && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
+-enabled libopus           && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
++enabled libopus           && use_pkg_config opus opus_multistream.h opus_multistream_decoder_create
+ enabled libpulse          && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
+ enabled librtmp           && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
+ enabled librubberband     && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
 @@ -5871,7 +5871,9 @@
                                 die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
                               { check_cpp_condition x264.h "X264_MPEG2" &&