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 f46e4ab..8743268 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 8b1fda8..0caedce 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 fc92007..a378c79 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 f40a95f..f363746 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 e0e27e4..efa4cdb 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 bd82f45..e9e9f1b 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 d9e73d3..006cf40 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 0559d9e..3511c76 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 f5c572d..774ac86 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 43a713e..d44c435 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 1d24200..523c863 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 79b90a7..4bd0b69 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 a0c7882..c556968 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();
        }
 }