drag edit contraints relaxed for ripples, cwdw gui/tool deadlock fix, vpatchgui fader...
authorGood Guy <good1.2guy@gmail.com>
Sat, 13 Apr 2019 00:45:28 +0000 (18:45 -0600)
committerGood Guy <good1.2guy@gmail.com>
Sat, 13 Apr 2019 00:45:28 +0000 (18:45 -0600)
13 files changed:
cinelerra-5.1/cinelerra/apatchgui.C
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/awindowgui.h
cinelerra-5.1/cinelerra/colorpicker.C
cinelerra-5.1/cinelerra/cwindowtool.C
cinelerra-5.1/cinelerra/edit.C
cinelerra-5.1/cinelerra/plugindialog.C
cinelerra-5.1/cinelerra/plugindialog.h
cinelerra-5.1/cinelerra/vpatchgui.C
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/plugins/histogram/histogram.C
cinelerra-5.1/plugins/titler/titler.C
cinelerra-5.1/plugins/titler/titlerwindow.C

index f46e4ab7390d6426e0f7d7c007e373abd6292784..8743268dbf93b5bd720ba0b901296f9ddc00d794 100644 (file)
@@ -104,9 +104,9 @@ int APatchGUI::update(int x, int y)
                        FloatAuto *previous = 0, *next = 0;
                        double unit_position = mwindow->edl->local_session->get_selectionstart(1);
                        unit_position = mwindow->edl->align_to_frame(unit_position, 0);
-                       unit_position = atrack->to_units(unit_position, 0);
+                       int64_t unit_pos = atrack->to_units(unit_position, 0);
                        FloatAutos *ptr = (FloatAutos*)atrack->automation->autos[AUTOMATION_FADE];
-                       float value = ptr->get_value((long)unit_position, PLAY_FORWARD, previous, next);
+                       float value = ptr->get_value(unit_pos, PLAY_FORWARD, previous, next);
                        fade->update(fade->get_w(), value,
                                     mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_AUDIO_FADE],
                                     mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_AUDIO_FADE]);
index 8b1fda8c2fa24b4de91199fbb14368cfc6293386..0caedce4747cdfceaa72ad26e3f403f7626e4e3c 100644 (file)
@@ -870,6 +870,9 @@ void AssetPicon::reset()
        vicon_frame = 0;
        in_use = 1;
        comments_time = 0;
+       comments_rate = -1;
+       comments_ffmt = ' ';
+       comments_type = "";
        id = 0;
        persistent = 0;
 }
@@ -1060,6 +1063,10 @@ void AssetPicon::create_objects()
                }
                struct stat st;
                comments_time = !stat(asset->path, &st) ? st.st_mtime : 0;
+               comments_rate = asset->get_frame_rate();
+               comments_ffmt = asset->format == FILE_FFMPEG ? '=' : '-';
+               comments_type = asset->format == FILE_FFMPEG ?
+                               asset->vcodec : File::formattostr(asset->format);
        }
        else
        if( indexable && !indexable->is_asset ) {
@@ -2083,9 +2090,13 @@ void AWindowGUI::update_asset_list()
                        continue;
                }
                if( picon->indexable && picon->indexable->is_asset ) {
+                       Asset *asset = (Asset *)picon->indexable;
                        struct stat st;
-                       picon->comments_time = !stat(picon->indexable->path, &st) ?
-                               st.st_mtime : 0;
+                       picon->comments_time = !stat(asset->path, &st) ? st.st_mtime : 0;
+                       picon->comments_rate = asset->get_frame_rate();
+                       picon->comments_ffmt = asset->format == FILE_FFMPEG ? '=' : '-';
+                       picon->comments_type = asset->format == FILE_FFMPEG ?
+                               asset->vcodec : File::formattostr(asset->format);
                }
        }
 }
@@ -2271,9 +2282,11 @@ void AWindowGUI::copy_picons(AssetPicon *picon, ArrayList<BC_ListBoxItem*> *src)
                        else if( picon->comments_time ) {
                                char date_time[BCSTRLEN];
                                struct tm stm;  localtime_r(&picon->comments_time, &stm);
-                               sprintf(date_time,"%04d.%02d.%02d %02d:%02d:%02d",
+                               sprintf(date_time,"%04d.%02d.%02d %02d:%02d:%02d @%0.2f %c%s",
                                         stm.tm_year+1900, stm.tm_mon+1, stm.tm_mday,
-                                        stm.tm_hour, stm.tm_min, stm.tm_sec);
+                                        stm.tm_hour, stm.tm_min, stm.tm_sec,
+                                       picon->comments_rate, picon->comments_ffmt,
+                                       picon->comments_type);
                                dst[1].append(item2 = new BC_ListBoxItem(date_time));
                        }
                        else
index fc92007026e64f619bb5781b3f09d6eaecbd8b75..a378c798f23a9426494e7391e4e48db3b97533c4 100644 (file)
@@ -131,6 +131,9 @@ public:
        int in_use;
        int persistent;
        time_t comments_time;
+       int comments_ffmt;
+       double comments_rate;
+       const char *comments_type;
        double sort_key;
        PluginServer *plugin;
        Label *label;
index f40a95f8250616ffd43568ffc3df531171a95090..f36374669e8185d503ed1065693739e67586e2f0 100644 (file)
@@ -96,7 +96,7 @@ void ColorPicker::update_gui(int output, int alpha)
 {
        ColorWindow *gui = (ColorWindow *)get_gui();
        if( !gui ) return;
-       gui->lock_window();
+       gui->lock_window("ColorPicker::update_gui");
        this->output = output;
        this->alpha = alpha;
        gui->change_values();
index e0e27e4d12d1dedb72c4d58531bd665862745b98..efa4cdb1683b0ac6886aa6c7d491fccec1c1b65b 100644 (file)
@@ -2193,10 +2193,12 @@ void CWindowMaskGUI::handle_event()
 
 void CWindowMaskGUI::update_preview()
 {
+       unlock_window();
        CWindowGUI *cgui = mwindow->cwindow->gui;
        cgui->lock_window("CWindowMaskGUI::update_preview");
        cgui->sync_parameters(CHANGE_PARAMS, 0, 1);
        cgui->unlock_window();
+       lock_window("CWindowMaskGUI::update_preview");
 }
 
 
index bd82f45130cbe9f1fb88bdb74cac39ffb162a7a8..e9e9f1b467e1e337ebd6f8b8535c10d17558f636 100644 (file)
@@ -443,6 +443,7 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
        int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits)
 {
        int64_t cut_length = newposition - oldposition;
+       int rest_moved = edit_mode == MOVE_RIPPLE || edit_mode == MOVE_EDGE ? 1 : 0;
        if( cut_length > length )
                cut_length = length;
        else if( cut_length < -length )
@@ -450,11 +451,11 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
 
        int64_t start = startproject, end = start + length;
        Edit *prev = this->previous, *next = this->next;
-       int edits_moved = 0, rest_moved = 0;
+       int edits_moved = 0;
 
        switch( edit_mode ) {
        case MOVE_RIPPLE:
-               edits_moved = rest_moved = 1;
+               edits_moved = 1;
                startsource += cut_length;
                cut_length = -cut_length;
                length += cut_length;
@@ -488,7 +489,7 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition,
                }
                break;
        case MOVE_EDGE:
-               edits_moved = rest_moved = 1;
+               edits_moved = 1;
                startsource -= cut_length;
                length += cut_length;
                for( Edit *edit=next; edit; edit=edit->next )
@@ -504,18 +505,19 @@ int Edit::shift_end(int edit_mode, int64_t newposition, int64_t oldposition,
        int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits)
 {
        int64_t cut_length = newposition - oldposition;
-       if( cut_length > length )
-               cut_length = length;
+       int rest_moved = edit_mode == MOVE_RIPPLE || edit_mode == MOVE_EDGE ? 1 : 0;
+       if( cut_length > length ) {
+                if( !rest_moved ) cut_length = length;
+       }
        else if( cut_length < -length )
                cut_length = -length;
        int64_t start = startproject, end = start + length;
        Edit *prev = this->previous, *next = this->next;
-       int edits_moved = 0, rest_moved = 0;
+       int edits_moved = 0;
 
        switch( edit_mode ) {
        case MOVE_RIPPLE:
        case MOVE_EDGE:
-               rest_moved = 1;
                length += cut_length;
                for( Edit *edit=next; edit; edit=edit->next )
                        edit->startproject += cut_length;
index d9e73d39aa5e30cfaadf65d3b82a52437f2924c3..006cf40e2ce1dc82e845ce68c48871e73b179447 100644 (file)
@@ -44,7 +44,8 @@ PluginDialogThread::PluginDialogThread(MWindow *mwindow)
  : BC_DialogThread()
 {
        this->mwindow = mwindow;
-       plugin = 0;
+       this->plugin = 0;
+       this->plugin_type = PLUGIN_NONE;
 }
 
 PluginDialogThread::~PluginDialogThread()
@@ -94,7 +95,7 @@ BC_Window* PluginDialogThread::new_gui()
                mwindow->session->plugindialog_w / 2;
        int y = mwindow->gui->get_abs_cursor_y(0) -
                mwindow->session->plugindialog_h / 2;
-       plugin_type = 0;
+       plugin_type = PLUGIN_NONE;
        PluginDialog *window = new PluginDialog(mwindow,
                this,
                window_title,
@@ -412,6 +413,21 @@ void PluginDialog::save_settings()
 }
 
 
+void PluginDialog::clear_selection()
+{
+       standalone_list->set_all_selected(&standalone_data, 0);
+       standalone_list->draw_items(1);
+       shared_list->set_all_selected(&shared_data, 0);
+       shared_list->draw_items(1);
+       module_list->set_all_selected(&module_data, 0);
+       module_list->draw_items(1);
+       selected_available = -1;
+       selected_shared = -1;
+       selected_modules = -1;
+       thread->plugin = 0;
+       thread->plugin_type = PLUGIN_NONE;
+}
+
 void PluginDialog::apply()
 {
        if( selected_available >= 0 ) {
@@ -473,6 +489,7 @@ PluginDialogApply::PluginDialogApply(PluginDialog *dialog, int x, int y)
 int PluginDialogApply::handle_event()
 {
        dialog->apply();
+       dialog->clear_selection();
        return 1;
 }
 
index 0559d9e75748116e164c7305ebf96a892c51a021..3511c76e13d22008f68bb1d37931d703b1847c5f 100644 (file)
@@ -102,6 +102,7 @@ public:
        void save_settings();
        int resize_event(int w, int h);
        void load_plugin_list(int redraw);
+       void clear_selection();
        void apply();
 
        BC_Title *standalone_title;
index f5c572d81b55263789c0987ad0550a500fff4396..774ac86bf33ca4c2cc41f1c2e8b49dc50cc27ee6 100644 (file)
@@ -96,7 +96,12 @@ int VPatchGUI::update(int x, int y)
                        delete fade;  fade = 0;
                }
                else {
-                       fade->update(fade->get_w(), mwindow->get_float_auto(this, AUTOMATION_FADE)->get_value(),
+                       FloatAuto *previous = 0, *next = 0;
+                       double unit_position = mwindow->edl->local_session->get_selectionstart(1);
+                       int64_t unit_pos = vtrack->to_units(unit_position, 0);
+                       FloatAutos *ptr = (FloatAutos*)track->automation->autos[AUTOMATION_FADE];
+                       float value = ptr->get_value(unit_pos, PLAY_FORWARD, previous, next);
+                       fade->update(fade->get_w(), value,
                                     mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_VIDEO_FADE],
                                     mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE]);
                }
index 43a713e7a47ac80d49929fdebdca4bb09e83f8db..d44c435abe37fd74500b0867f87f9afb6eaf6734 100644 (file)
@@ -1774,33 +1774,7 @@ int utf8conv::
 wnext()
 {
   int v = 0, n = 0, ch = next();
-  if( ch == '\\' ) {
-    switch( (ch=next()) ) {
-    case 'n': return '\n';
-    case 't': return '\t';
-    case 'r': return '\r';
-    case 'b': return '\b';
-    case 'f': return '\f';
-    case 'v': return '\v';
-    case 'a': return '\a';
-    case '0': case '1': case '2': case '3':
-    case '4': case '5': case '6': case '7':
-      v = ch - '0';
-      for( int i=3; --i>0; v=v*8+ch, next() )
-        if( (ch=cur()-'0') < 0 || ch >= 8 ) break;
-      return v;
-    case 'x':  n = 2;  break;
-    case 'u':  n = 4;  break;
-    case 'U':  n = 8;  break;
-    default: return ch;
-    }
-    for( int i=n; --i>=0; v=v*16+ch, next() ) {
-      if( (ch=cur()-'0')>=0 && ch<10 ) continue;
-      if( (ch-='A'-'0'-10)>=10 && ch<16 ) continue;
-      if( (ch-='a'-'A')<10 || ch>=16 ) break;
-    }
-  }
-  else if( ch >= 0x80 ) {
+  if( ch >= 0x80 ) {
     static const unsigned char byts[] = {
       1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5,
     };
index 1d24200135994d351b7620d087c85760f0b58b0e..523c863f3e0bc142c8b372dbde030f44c147a737 100644 (file)
@@ -458,8 +458,8 @@ int HistogramMain::process_buffer(VFrame *frame,
                if( cpus > smps ) cpus = smps;
                engine = new HistogramEngine(this, cpus, cpus);
        }
-// Always plot to set the curves if automatic
-       if(config.plot || config.automatic) send_render_gui(frame);
+// if to plot histogram
+       if(config.plot) send_render_gui(frame);
 
 // Generate tables here.  The same table is used by many packages to render
 // each horizontal stripe.  Need to cover the entire output range in  each
index 79b90a7ab2d797d26af60901288d61fe9ab72cd9..4bd0b69b3f5c63ce454e5cd8355f91316b644208 100644 (file)
@@ -1339,7 +1339,8 @@ int TitleParser::wget(wchar_t &wch)
        int ich;
        while( (ich=wnext()) >= 0 ) {
                if( ich == '\\' ) {
-                       if( (ich=wnext()) == '\n' ) continue;
+                       if( (ich=wnext()) < 0 ) break;
+                       if( !ich || ich == '\n' ) continue;
                        wch = ich;
                        return 0;
                }
index a0c7882630a2d197af121ec077dfc2db267bbd6a..c556968aec3aa31ec0b54d398bb1b3598824178e 100644 (file)
@@ -780,7 +780,9 @@ void TitleColorButton::handle_done_event(int result)
 {
        if( result ) {
                handle_new_color(orig_color, orig_alpha);
+               window->lock_window("TitleColorButton::handle_done_event");
                update_gui(orig_color);
+               window->unlock_window();
        }
 }