assetedit/resize track fixes, dangling popup threads
authorGood Guy <good1.2guy@gmail.com>
Fri, 24 Mar 2017 17:48:43 +0000 (11:48 -0600)
committerGood Guy <good1.2guy@gmail.com>
Fri, 24 Mar 2017 17:48:43 +0000 (11:48 -0600)
cinelerra-5.1/cinelerra/asset.C
cinelerra-5.1/cinelerra/assetedit.C
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/awindowgui.h
cinelerra-5.1/cinelerra/editpopup.C
cinelerra-5.1/cinelerra/resizetrackthread.C
cinelerra-5.1/guicast/bcpopupmenu.C
cinelerra-5.1/guicast/vicon.h

index d8db797b916d868632f89290e8e7b0ca7ae91108..5a17fde869250aea8744a5cf82f218fdfba289f3 100644 (file)
@@ -341,14 +341,14 @@ int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
                                delete [] cp;
                        }
                }
-               if( strcmp(apath, tpath) ) result = 1;
+               if( strcmp(apath, tpath) ) result = 0;
                delete [] apath;
                delete [] tpath;
                delete [] out_path;
        }
 
-       if(result && format == FILE_FFMPEG)
-               result = !strcmp(fformat, asset.fformat);
+       if(result && format == FILE_FFMPEG && strcmp(fformat, asset.fformat) )
+               result = 0;
 
        if(test_audio && result)
        {
index 267597482af0b23a77530453a80e99027d5207fd..5b753657f0f1325445597962173fbda4cbdac9b7 100644 (file)
@@ -128,7 +128,7 @@ void AssetEdit::handle_close_event(int result)
 
                if(indexable->is_asset) {
                        asset = (Asset*)indexable;
-                       if( changed_params->equivalent(*asset, 1, 1, mwindow->edl) )
+                       if( !changed_params->equivalent(*asset, 1, 1, mwindow->edl) )
                                changed = 1;
                }
                else {
@@ -177,6 +177,7 @@ void AssetEdit::handle_close_event(int result)
                        }
                        mwindow->gui->unlock_window();
 //printf("AssetEdit::handle_close_event %d\n", __LINE__);
+                       mwindow->awindow->gui->update_picon(indexable);
                        mwindow->awindow->gui->async_update_assets();
 
                        mwindow->restart_brender();
index 1dcacb945b982f20bbebddc650ab9111d08d2242..a0ffb857e16caba8c56cb53b485f3dd5076e598e 100644 (file)
@@ -1143,6 +1143,30 @@ void AWindowGUI::update_asset_list()
 //printf("AWindowGUI::update_asset_list 7 %d\n", assets.total);
 }
 
+void AWindowGUI::update_picon(Indexable *indexable)
+{
+//printf("AWindowGUI::update_asset_list 1\n");
+       VIcon *vicon = 0;
+       for(int i = 0; i < assets.total; i++) {
+               AssetPicon *picon = (AssetPicon*)assets.values[i];
+               if( picon->indexable == indexable ||
+                   picon->edl == (EDL *)indexable ) {
+                       char name[BCTEXTLEN];
+                       FileSystem fs;
+                       fs.extract_name(name, indexable->path);
+                       picon->set_text(name);
+                       vicon = picon->vicon;
+                       break;
+               }
+       }
+       if( vicon ) {
+               stop_vicon_drawing();
+               vicon->clear_images();
+               vicon->reset(indexable->get_frame_rate());
+               start_vicon_drawing();
+       }
+}
+
 void AWindowGUI::sort_assets()
 {
 //printf("AWindowGUI::sort_assets 1 %s\n", mwindow->edl->session->current_folder);
index 8d9414e049ac129ffcc6c3b6d6794ed7e3a4bb0b..04fac7046df98e6f5171bc8e05e337da60e217a4 100644 (file)
@@ -184,6 +184,7 @@ public:
        int load_defaults(BC_Hash *defaults);
        void start_vicon_drawing();
        void stop_vicon_drawing();
+       void update_picon(Indexable *indexable);
 
        MWindow *mwindow;
        AWindow *awindow;
index 9dccdd06a85c70df923ea29b5029ac8e5401f578..4670dafdae000e7d435aff43e3e73a0fea8da3ef 100644 (file)
 #include <string.h>
 
 EditPopup::EditPopup(MWindow *mwindow, MWindowGUI *gui)
- : BC_PopupMenu(0,
-               0,
-               0,
-               "",
-               0)
+ : BC_PopupMenu(0, 0, 0, "", 0)
 {
        this->mwindow = mwindow;
        this->gui = gui;
@@ -58,6 +54,7 @@ void EditPopup::create_objects()
        add_item(new EditPopupAddTrack(mwindow, this));
 //     add_item(new EditPopupTitle(mwindow, this));
        resize_option = 0;
+       matchsize_option = 0;
 }
 
 int EditPopup::update(Track *track, Edit *edit)
index 4af7eb75bab7c47f698d4c65c2f228adac02be0f..a9548455b2c86b28297ebb546a41668db7bf5d70 100644 (file)
@@ -299,7 +299,8 @@ void ResizeTrackThread::start_window(Track *track)
 
 void ResizeTrackThread::update()
 {
-       mwindow->resize_track(track, w, h);
+       if( mwindow->edl->tracks->track_exists(track) )
+               mwindow->resize_track(track, w, h);
 }
 
 
@@ -350,7 +351,8 @@ ResizeAssetButton::~ResizeAssetButton()
 
 int ResizeAssetButton::handle_event()
 {
-       resize_asset_thread = new ResizeAssetThread(fwindow);
+       if( !resize_asset_thread )
+               resize_asset_thread = new ResizeAssetThread(fwindow);
        resize_asset_thread->start_window(fwindow->asset_edit->changed_params);
         return 1;
 }
index 6a8c63e2f9daaafa61089100eaf36798d685e89c..9d8e2c223132310ebc93c8a306a0a3eff8296952 100644 (file)
@@ -96,6 +96,7 @@ BC_PopupMenu::~BC_PopupMenu()
 {
        use_title = 0;
        deactivate();
+       delete menu_popup;
        for(int i = 0; i < TOTAL_IMAGES; i++)
        {
                if(images[i]) delete images[i];
index 6ae0119e547c7718866f4428fee479ee6b5a866e..6af17b2a4e109d43fee144231d14d0840e6302fb 100644 (file)
@@ -44,6 +44,7 @@ public:
 
        int64_t vframes() { return images.size(); }
        void reset() { seq_no = 0; cycle_start = 0; age = 0; }
+       void reset(double rate) { reset(); frame_rate = rate; }
        void clear_images() { images.remove_all_objects(); }
 
        virtual int64_t set_seq_no(int64_t no) { return seq_no = no; }