add resource wdw folder expanders, fix plugin close deadlock detect
[goodguy/history.git] / cinelerra-5.1 / cinelerra / edl.C
index 4411bf4bd0c652d0a065bb72f85e32ffbb7648f8..a756e6e576bae9999d136b7d27ffe2ef6666c318 100644 (file)
@@ -410,7 +410,7 @@ void EDL::copy_session(EDL *edl, int session_only)
                session->copy(edl->session);
        }
 
-       if( !session_only ) {
+       if( session_only <= 0 ) {
                local_session->copy_from(edl->local_session);
        }
 }
@@ -1226,7 +1226,7 @@ const char *EDL::get_folder_name(int no)
        return !fp ? "" : fp->title;
 }
 
-int EDL::new_folder(const char *title)
+int EDL::new_folder(const char *title, int is_clips)
 {
        if( !title[0] ) return 1;
        int ret = get_folder_number(title);
@@ -1237,7 +1237,7 @@ int EDL::new_folder(const char *title)
                int no = fp->awindow_folder;
                if( no >= idx ) idx = no+1;
        }
-       folders.append(new BinFolder(idx, title));
+       folders.append(new BinFolder(idx, is_clips, title));
        return 0;
 }
 
@@ -1402,7 +1402,6 @@ int64_t EDL::get_video_frames()
                session->frame_rate);
 }
 
-
 void EDL::remove_vwindow_edls()
 {
        for( int i=0; i<total_vwindow_edls(); ++i ) {
@@ -1547,6 +1546,10 @@ void EDL::set_proxy(int new_scale, int use_scaler,
                Indexable *proxy_idxbl = proxy_assets->get(i);
                proxy_idxbl->awindow_folder = awindow_folder;
                Asset *proxy_asset = proxy_idxbl->is_asset ? assets->update((Asset *)proxy_idxbl) : 0;
+               if( proxy_asset && proxy_idxbl ) {
+                       proxy_asset->width = proxy_idxbl->get_w();
+                       proxy_asset->height = proxy_idxbl->get_h();
+               }
                EDL *proxy_edl = !proxy_idxbl->is_asset ? (EDL *)proxy_idxbl : 0;
 // replace track contents
                for( Track *track=tracks->first; track; track=track->next ) {
@@ -1609,6 +1612,12 @@ void EDL::add_proxy(int use_scaler,
        }
 }
 
+Asset *EDL::get_proxy_asset()
+{
+       return awindow_folder == AW_PROXY_FOLDER ?
+               tracks->first->edits->first->asset : 0;
+}
+
 double EDL::get_cursor_position(int cursor_x, int pane_no)
 {
        return (double)cursor_x * local_session->zoom_sample / session->sample_rate +