lock trace bug, missed optimize in dvd_create, cin_quality=-1, motion plugin gui...
authorGood Guy <[email protected]>
Sun, 5 Feb 2017 00:02:34 +0000 (17:02 -0700)
committerGood Guy <[email protected]>
Sun, 5 Feb 2017 00:02:34 +0000 (17:02 -0700)
18 files changed:
cinelerra-5.1/cinelerra/dvdcreate.C
cinelerra-5.1/cinelerra/fileffmpeg.C
cinelerra-5.1/cinelerra/fileffmpeg.h
cinelerra-5.1/cinelerra/mbuttons.C
cinelerra-5.1/cinelerra/mwindowgui.C
cinelerra-5.1/cinelerra/zoombar.C
cinelerra-5.1/ffmpeg/video/h265-12bit.mp4
cinelerra-5.1/ffmpeg/video/h265-hi.mp4
cinelerra-5.1/ffmpeg/video/h265-lo.mp4
cinelerra-5.1/ffmpeg/video/h265-med.mp4
cinelerra-5.1/ffmpeg/video/h265.mp4
cinelerra-5.1/guicast/bctextbox.C
cinelerra-5.1/guicast/bctextbox.h
cinelerra-5.1/guicast/bctrace.C
cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C
cinelerra-5.1/plugins/motion-hv/motionwindow-hv.C
cinelerra-5.1/plugins/motion/motionwindow.C
cinelerra-5.1/plugins/motion2point/motionwindow.C

index 155f17fbd1d2d5d8184cc241c3ea397c2301bb20..9fbee552f0fa25f13957fe0ec085edc7b17fa5a5 100644 (file)
@@ -407,6 +407,7 @@ void CreateDVD_Thread::handle_close_event(int result)
                                        edit->startproject, edit->length,
                                        PLUGIN_STANDALONE, 0, &keyframe, 0);
                        }
+                       vtrk->optimize();
                }
        }
 
@@ -898,6 +899,7 @@ insert_video_plugin(const char *title, KeyFrame *default_keyframe)
                                edit->startproject, edit->length,
                                PLUGIN_STANDALONE, 0, default_keyframe, 0);
                }
+               vtrk->optimize();
        }
        return 0;
 }
index e99732b3f1be351a3f37e6b170cff236d87f5f55..6c360da35bd2e8bd0ba50852c96660c24ede04a9 100644 (file)
@@ -59,10 +59,18 @@ void FFMpegConfigNum::create_objects()
        BC_TumbleTextBox::create_objects();
 }
 
-int FFMpegConfigNum::update_text(const char *text)
+int FFMpegConfigNum::update_param(const char *param, const char *opts)
 {
-       BC_TumbleTextBox::update(text);
-       return handle_event();
+       char value[BCTEXTLEN];
+       if( !FileFFMPEG::get_ff_option(param, opts, value) ) {
+               if( (*output = atol(value)) < 0 ) {
+                       disable(1);
+                       return 0;
+               }
+               BC_TumbleTextBox::update(value);
+       }
+       enable();
+       return 1;
 }
 
 int FFMpegConfigNum::handle_event()
@@ -464,9 +472,7 @@ void FFMPEGConfigAudio::create_objects()
        add_subwindow(new BC_OKButton(this));
        add_subwindow(new BC_CancelButton(this));
 
-       char value[BCTEXTLEN];
-       if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_audio_options, value) )
-               bitrate->update_text(value);
+       bitrate->update_param("cin_bitrate", asset->ff_audio_options);
 
        show_window(1);
        bitrate->handle_event();
@@ -504,9 +510,7 @@ int FFMPEGConfigAudioPopup::handle_event()
        popup->audio_options->update(asset->ff_audio_options);
        popup->audio_options->set_text_row(0);
 
-       char value[BCTEXTLEN];
-       if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_audio_options, value) )
-               popup->bitrate->update_text(value);
+       popup->bitrate->update_param("cin_bitrate", asset->ff_audio_options);
        return 1;
 }
 
@@ -621,11 +625,8 @@ void FFMPEGConfigVideo::create_objects()
        add_subwindow(new BC_OKButton(this));
        add_subwindow(new BC_CancelButton(this));
 
-       char value[BCTEXTLEN];
-       if( !FileFFMPEG::get_ff_option("cin_quality", asset->ff_video_options, value) )
-               quality->update_text(value);
-       if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_video_options, value) )
-               bitrate->update_text(value);
+       bitrate->update_param("cin_bitrate", asset->ff_video_options);
+       quality->update_param("cin_quality", asset->ff_video_options);
 
        show_window(1);
        if( asset->ff_video_bitrate )
@@ -666,12 +667,8 @@ int FFMPEGConfigVideoPopup::handle_event()
        popup->video_options->update(asset->ff_video_options);
        popup->video_options->set_text_row(0);
 
-       char value[BCTEXTLEN];
-       if( !FileFFMPEG::get_ff_option("cin_quality", asset->ff_video_options, value) ) {
-               popup->quality->update_text(value);
-       }
-       if( !FileFFMPEG::get_ff_option("cin_bitrate", asset->ff_video_options, value) )
-               popup->bitrate->update_text(value);
+       popup->bitrate->update_param("cin_bitrate", asset->ff_video_options);
+       popup->quality->update_param("cin_quality", asset->ff_video_options);
        return 1;
 }
 
index 63de93c7a3b2867770fa3070a72f69eac84b4136..edbe437f0e24f4727757c3b8cefdefa6645354a5 100644 (file)
@@ -62,7 +62,7 @@ public:
         ~FFMpegConfigNum();
 
         void create_objects();
-        int update_text(const char *text);
+       int update_param(const char *param, const char *opts);
         int handle_event();
         int *output;
         BC_Window *window;
index b5d567ac2d36b123d1b837defd1b8d77961cd7f8..a91c0cbcddead31ccf4c0d6819a415124df16708 100644 (file)
@@ -102,20 +102,6 @@ void MButtons::update()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 MainTransport::MainTransport(MWindow *mwindow, MButtons *mbuttons, int x, int y)
  : PlayTransport(mwindow, mbuttons, x, y)
 {
@@ -139,28 +125,9 @@ void MainTransport::goto_end()
 }
 
 MainEditing::MainEditing(MWindow *mwindow, MButtons *mbuttons, int x, int y)
- : EditPanel(mwindow,
-               mbuttons,
-               x,
-               y,
-               mwindow->edl->session->editing_mode,
-               1,
-               1,
-               0,
-               0,
-               1,
-               1,
-               1,
-               1,
-               1,
-               1,
-               1, // locklabels
-               1,
-               1,
-               0,
-               1,
-               1,
-               mwindow->has_commercials())
+ : EditPanel(mwindow, mbuttons, x, y, mwindow->edl->session->editing_mode,
+               1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, // locklabels
+               1, 1, 0, 1, 1, mwindow->has_commercials())
 {
        this->mwindow = mwindow;
        this->mbuttons = mbuttons;
index 7c3b8575b72b25fd3210da539370e6ab37d226fd..9724470dc31d927b695eaa452aa0b1531979858b 100644 (file)
@@ -405,10 +405,10 @@ int MWindowGUI::resize_event(int w, int h)
        int x = w - MainShBtns::calculate_w(0);
        mainmenu->resize_event(x, mainmenu->get_h());
        mainshbtns->reposition_window(x, -1);
+       ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2);
        mwindow->theme->get_mwindow_sizes(this, w, h);
        mwindow->theme->draw_mwindow_bg(this);
        mbuttons->resize_event();
-       ffmpeg_toggle->reposition_window(menu_w(), menu_h()+2);
        statusbar->resize_event();
        zoombar->resize_event();
 
@@ -535,6 +535,7 @@ int MWindowGUI::resize_event(int w, int h)
                mwindow->theme->mzoom_y + 1 - mwindow->theme->get_image_set("pane")[0]->get_h());
        resource_thread->start_draw();
 
+       flash(1);
        return 0;
 }
 
index 8c9c8a4964aaa699aa7bc749582048803093cb31..8dca9e10232fe81c6f7b7115c3142ca299c09b4e 100644 (file)
@@ -129,6 +129,7 @@ void ZoomBar::resize_event()
 {
        reposition_window(mwindow->theme->mzoom_x, mwindow->theme->mzoom_y,
                mwindow->theme->mzoom_w, mwindow->theme->mzoom_h);
+       draw_top_background(get_parent(), 0, 0, get_w(), get_h());
 }
 
 void ZoomBar::redraw_time_dependancies()
index 3d42dbb82ea0689c06c55241be31366d8f848023..93c8965c161f4d7401c6e6894bda5b8425eac022 100644 (file)
@@ -6,4 +6,4 @@ color_primaries=bt2020
 color_trc=bt2020_12bit
 pixel_format=yuv422p12
 x265-params=output-depth=12
-
+cin_quality=-1
index 8e2a09d661f32bc06f0814e57f8c5da4873963e2..d73b1a5ed4429dffad3719743976d169f209b177 100644 (file)
@@ -1,2 +1,3 @@
 mp4 libx265
 crf=5
+cin_quality=-1
index 1bbf933d7a37dccfbda673a09b36f574d9944230..c3d5428867ea0c0938d0cac5d34b18e077d6718a 100644 (file)
@@ -1,3 +1,4 @@
 mp4 libx265
 # lossy but faster
 crf=25
+cin_quality=-1
index b8b93753652be4061239baff411ad47e43bc3d4e..0408dcb1d58dc72a10a73289f66040325bb97ef6 100644 (file)
@@ -1,3 +1,4 @@
 mp4 libx265
 # visually lossless
 crf=18
+cin_quality=-1
index d045e2339663c0871dd8e5e54aeb0355af693c10..8174ea34d2192fded16bed5de1bb0084dee3092e 100644 (file)
@@ -1 +1,2 @@
 mp4 libx265
+cin_quality=-1
index 52aa85d3e28f54c77cdb0abc6763f6e73e24ccb5..cac049a27807845676cf276a30267424b3b5477a 100644 (file)
@@ -990,6 +990,7 @@ int BC_TextBox::deactivate()
 {
        if( active ) {
                active = 0;
+               text_selected = word_selected = line_selected = 0;
                top_level->set_active_subwindow(0);
                top_level->unset_repeat(top_level->get_resources()->blink_rate);
        }
@@ -2781,17 +2782,23 @@ int BC_TumbleTextBox::get_h()
        return textbox->get_h();
 }
 
-void BC_TumbleTextBox::disable()
+void BC_TumbleTextBox::disable(int hide_text)
 {
+       if( hide_text && !textbox->is_hidden() )
+               textbox->hide_window(0);
+       if( !tumbler->is_hidden() )
+               tumbler->hide_window(0);
        if( !get_enabled() ) return;
-       tumbler->hide_window(0);
        return textbox->disable();
 }
 
 void BC_TumbleTextBox::enable()
 {
+       if( textbox->is_hidden() )
+               textbox->show_window(0);
+       if( tumbler->is_hidden() )
+               tumbler->show_window(0);
        if( get_enabled() ) return;
-       tumbler->show_window(0);
        return textbox->enable();
 }
 
index f7d38094e0ffa583fc1c1e7990c90f02e4969de3..7b07ded12e1ebbabca9eaffcb4fb63e64ffbbc4a 100644 (file)
@@ -394,7 +394,7 @@ public:
        int get_y();
        int get_w();
        int get_h();
-       void disable();
+       void disable(int hide_text=0);
        void enable();
        int get_enabled();
        void reposition_window(int x, int y);
index 47638fe9a6955f21b473016aa958b1035959bd13..b15cfea17fba633b6f087dfdabefc537318a2c39 100644 (file)
@@ -114,12 +114,12 @@ int BC_Trace::set_lock(const char *title, const char *loc, trace_info *info)
        last_lock_title = title;
        last_lock_location = loc;
        lock_item *it;
-       if( lock_table.size >= TOTAL_LOCKS ) {
+       if( (it=(lock_item*)lock_free.first) != 0 )
+               lock_free.remove_pointer(it);
+       else if( lock_table.size >= TOTAL_LOCKS ) {
                it = (lock_item*)lock_table.first;
                lock_table.remove_pointer(it);
        }
-       else if( (it=(lock_item*)lock_free.first) != 0 )
-               lock_free.remove_pointer(it);
        else
                it = new lock_item();
        it->set(info, title, loc);
index ffe0b9112f987976bfd1fae0e404def20e53b9b9..eeadec0c2bef68d8602db432f978cc59b9bb0eb2 100644 (file)
@@ -150,6 +150,9 @@ void MotionCVWindow::create_objects()
                new BC_Title(x1=x2, y1=y, _("Frame number:")));
        add_subwindow(track_frame_number =
                new TrackFrameNumber(plugin, this, x1 += title->get_w(), y1));
+       if( plugin->config.mode3 != MotionCVConfig::TRACK_SINGLE )
+               track_frame_number->disable();
+
        add_subwindow(addtrackedframeoffset =
                new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h()));
        int pef = client->server->mwindow->edl->session->video_every_frame;
@@ -484,8 +487,6 @@ TrackFrameNumber::TrackFrameNumber(MotionCVMain *plugin,
 {
        this->plugin = plugin;
        this->gui = gui;
-       if( plugin->config.mode3 != MotionCVConfig::TRACK_SINGLE )
-               disable();
 }
 
 int TrackFrameNumber::handle_event()
index ad536ba5752aad8181168bb96f3e65802575a60b..d61080b9a985e68887431b0e1174d49700e446eb 100644 (file)
@@ -209,6 +209,8 @@ void MotionHVWindow::create_objects()
                this,
                x + track_single->get_w() + title->get_w() + 20,
                y));
+       if(plugin->config.tracking_object != MotionHVScan::TRACK_SINGLE)
+               track_frame_number->disable();
 
        y += 20;
        add_subwindow(track_previous = new TrackPreviousFrame(plugin,
@@ -779,7 +781,6 @@ TrackFrameNumber::TrackFrameNumber(MotionHVMain *plugin,
 {
        this->plugin = plugin;
        this->gui = gui;
-       if(plugin->config.tracking_object != MotionHVScan::TRACK_SINGLE) disable();
 }
 
 int TrackFrameNumber::handle_event()
index 8f3a244a87625b915aea3cd9e808bebef94a69af..b8930e206f813f612a4292e9244c3cea9dfb1db5 100644 (file)
@@ -172,6 +172,9 @@ void MotionWindow::create_objects()
                new BC_Title(x1=x2, y1, _("Frame number:")));
        add_subwindow(track_frame_number =
                new TrackFrameNumber(plugin, this, x1 += title->get_w(), y1));
+       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE)
+               track_frame_number->disable();
+
        add_subwindow(addtrackedframeoffset =
                new AddTrackedFrameOffset(plugin, this, x1=x2, y1+=track_frame_number->get_h()));
        int pef = client->server->mwindow->edl->session->video_every_frame;
@@ -605,7 +608,6 @@ TrackFrameNumber::TrackFrameNumber(MotionMain *plugin,
 {
        this->plugin = plugin;
        this->gui = gui;
-       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) disable();
 }
 
 int TrackFrameNumber::handle_event()
index f10a7f3959c9c29bc56ee0e247379ae297b715ba..8b3307247f23927964feea39687c96c1bd462afe 100644 (file)
@@ -200,6 +200,8 @@ void MotionWindow::create_objects()
                this,
                x + track_single->get_w() + title->get_w() + 20,
                y));
+       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE)
+               track_frame_number->disable();
 
        y += 20;
        add_subwindow(track_previous = new TrackPreviousFrame(plugin,
@@ -614,7 +616,6 @@ TrackFrameNumber::TrackFrameNumber(MotionMain2 *plugin,
 {
        this->plugin = plugin;
        this->gui = gui;
-       if(plugin->config.tracking_object != MotionScan::TRACK_SINGLE) disable();
 }
 
 int TrackFrameNumber::handle_event()