From: Good Guy Date: Mon, 22 Oct 2018 22:55:55 +0000 (-0600) Subject: clip folder bug on reload, expander user folder drag/drop segv, remove libfdk src... X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=0d3917a4eda0344055badf0bd6e235c15c3b6cb8;p=goodguy%2Fhistory.git clip folder bug on reload, expander user folder drag/drop segv, remove libfdk src, tweak bluebanana --- diff --git a/cinelerra-5.1/blds/cfg-cv.sh b/cinelerra-5.1/blds/cfg-cv.sh index 153a526b..dd9f3574 100755 --- a/cinelerra-5.1/blds/cfg-cv.sh +++ b/cinelerra-5.1/blds/cfg-cv.sh @@ -22,7 +22,7 @@ mkdir -p libzmpeg3 db db/utils mpeg2enc mplexlo --enable-libogg=auto --enable-libtheora=auto --enable-libvorbis=auto \ --enable-openexr=auto --enable-libsndfile=auto --enable-libdv=auto \ --enable-libjpeg=auto --enable-tiff=auto --enable-x264=auto \ - --disable-audiofile --disable-encore --disable-esound --disable-fdk \ + --enable-audiofile --disable-encore --disable-esound --disable-fdk \ --disable-ffmpeg --disable-fftw --disable-flac --disable-giflib --disable-ilmbase \ --disable-libavc1394 --disable-libraw1394 --disable-libiec61883 --disable-libvpx \ --disable-openjpeg --disable-twolame --disable-x265 diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index ec82d0e9..4f911e98 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -190,7 +190,7 @@ void Asset::copy_from(Asset *asset, int do_index) void Asset::copy_location(Asset *asset) { strcpy(path, asset->path); - awindow_folder = asset->awindow_folder; + folder_no = asset->folder_no; } void Asset::copy_format(Asset *asset, int do_index) @@ -459,7 +459,7 @@ int Asset::read(FileXML *file, else if(file->tag.title_is("FOLDER")) { - awindow_folder = file->tag.get_property("NUMBER", AW_MEDIA_FOLDER); + folder_no = file->tag.get_property("NUMBER", AW_MEDIA_FOLDER); } else if(file->tag.title_is("VIDEO")) @@ -577,7 +577,7 @@ int Asset::write(FileXML *file, file->append_newline(); file->tag.set_title("FOLDER"); - file->tag.set_property("NUMBER", awindow_folder); + file->tag.set_property("NUMBER", folder_no); file->append_tag(); file->tag.set_title("/FOLDER"); file->append_tag(); diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index fe52bbd6..c9bac6fd 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -823,7 +823,7 @@ int SnapshotMenuItem::handle_event() file.close_file(); } if( !ret ) { - asset->awindow_folder = AW_MEDIA_FOLDER; + asset->folder_no = AW_MEDIA_FOLDER; mwindow->edl->assets->append(asset); mwindow->awindow->gui->async_update_assets(); } @@ -1044,7 +1044,7 @@ int GrabshotPopup::grab_event(XEvent *event) file.close_file(); } if( !ret ) { - asset->awindow_folder = AW_MEDIA_FOLDER; + asset->folder_no = AW_MEDIA_FOLDER; mwindow->edl->assets->append(asset); mwindow->awindow->gui->async_update_assets(); } diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 3f9f9b2f..009647b3 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -579,7 +579,7 @@ void AssetPicon::create_objects() icon_vframe = new VFrame(0, -1, pixmap_w, pixmap_h, BC_RGB888, -1); icon_vframe->transfer_from(gui->temp_picon); - if( asset->awindow_folder == AW_MEDIA_FOLDER ) { + if( asset->folder_no == AW_MEDIA_FOLDER ) { // vicon images double framerate = asset->get_frame_rate(); if( !framerate ) framerate = VICON_RATE; @@ -645,7 +645,7 @@ void AssetPicon::create_objects() base_colors[i], line_colors[i]); } mwindow->audio_cache->check_in(asset); - if( asset->awindow_folder == AW_MEDIA_FOLDER ) { + if( asset->folder_no == AW_MEDIA_FOLDER ) { double secs = duration; if( secs > 5 ) secs = 5; double refresh_rate = gui->vicon_thread->refresh_rate; @@ -1642,6 +1642,10 @@ void AWindowGUI::update_asset_list() for( int i=0; icreate_objects(); + if( picon->indexable ) + picon->foldernum = AW_MEDIA_FOLDER; + else if( picon->edl ) + picon->foldernum = AW_CLIP_FOLDER; assets.append(picon); } @@ -1763,7 +1767,7 @@ EDL *AWindowGUI::collect_proxy(Indexable *indexable) if( current->data_type != TRACK_AUDIO ) continue; current->insert_asset(unproxy_asset, 0, length, 0, atrack++); } - proxy_edl->awindow_folder = AW_PROXY_FOLDER; + proxy_edl->folder_no = AW_PROXY_FOLDER; return proxy_edl; } @@ -1776,7 +1780,7 @@ void AWindowGUI::collect_assets(int proxy) while( (result = (AssetPicon*)asset_list->get_selection(0, i++)) != 0 ) { Indexable *indexable = result->indexable; if( proxy && indexable && indexable->is_asset && - indexable->awindow_folder == AW_PROXY_FOLDER ) { + indexable->folder_no == AW_PROXY_FOLDER ) { EDL *drag_edl = collect_proxy(indexable); if( drag_edl ) mwindow->session->drag_clips->append(drag_edl); continue; @@ -1792,30 +1796,22 @@ void AWindowGUI::collect_assets(int proxy) } } -void AWindowGUI::copy_picons(ArrayList *dst, - ArrayList *src, int folder) +void AWindowGUI::copy_picons(AssetPicon *picon, ArrayList *src) { // Remove current pointers + ArrayList *dst = displayed_assets; dst[0].remove_all(); dst[1].remove_all_objects(); - AWindowFolderSubItems *sub_items = 0; - if( folder >= 0 && folder < AW_LABEL_FOLDER ) { - AssetPicon *picon = 0; - for( int k=folders.size(); --k>=0; ) { - picon = (AssetPicon*)folders[k]; - if( picon->foldernum == folder ) break; - } - if( picon ) - sub_items = picon->sub_items; - folder = AW_NO_FOLDER; - } + + AWindowFolderSubItems *sub_items = picon ? picon->sub_items : 0; + int folder = mwindow->edl->session->awindow_folder; BinFolder *bin_folder = folder < AWINDOW_USER_FOLDERS ? 0 : mwindow->edl->get_folder(folder); // Create new pointers for( int i = 0; i < src->total; i++ ) { - int visible = folder < 0 ? 1 : 0; - AssetPicon *picon = (AssetPicon*)src->values[i]; + int visible = folder >= AW_CLIP_FOLDER ? 0 : 1; + picon = (AssetPicon*)src->values[i]; picon->sort_key = -1; if( !visible && bin_folder ) { Indexable *idxbl = bin_folder->is_clips ? (Indexable *)picon->edl : @@ -1827,9 +1823,9 @@ void AWindowGUI::copy_picons(ArrayList *dst, visible = 1; } } - if( !visible && picon->indexable && picon->indexable->awindow_folder == folder ) + if( !visible && picon->indexable && picon->indexable->folder_no == folder ) visible = 1; - if( !visible && picon->edl && picon->edl->local_session->folder == folder ) + if( !visible && picon->edl && picon->edl->folder_no == folder ) visible = 1; if( visible && sub_items ) { if( !sub_items->matches(picon->get_text()) ) @@ -1904,39 +1900,29 @@ void AWindowGUI::filter_displayed_assets() //allow_iconlisting = 1; asset_titles[0] = C_("Title"); asset_titles[1] = _("Comments"); - int folder = mwindow->edl->session->awindow_folder; - - switch( folder ) { - case AW_AEFFECT_FOLDER: - copy_picons(displayed_assets, &aeffects, folder); - break; - case AW_VEFFECT_FOLDER: - copy_picons(displayed_assets, &veffects, folder); - break; - case AW_ATRANSITION_FOLDER: - copy_picons(displayed_assets, &atransitions, folder); - break; - case AW_VTRANSITION_FOLDER: - copy_picons(displayed_assets, &vtransitions, folder); - break; - case AW_LABEL_FOLDER: - copy_picons(displayed_assets, &labellist, AW_NO_FOLDER); - asset_titles[0] = _("Time Stamps"); - asset_titles[1] = C_("Title"); - //allow_iconlisting = 0; - break; - default: - copy_picons(displayed_assets, &assets, mwindow->edl->session->awindow_folder); - break; - } - - // Ensure the current folder icon is highlighted + AssetPicon *picon = 0; int selected_folder = mwindow->edl->session->awindow_folder; + // Ensure the current folder icon is highlighted for( int i = 0; i < folders.total; i++ ) { AssetPicon *folder_item = (AssetPicon *)folders.values[i]; int selected = folder_item->foldernum == selected_folder ? 1 : 0; folder_item->set_selected(selected); + if( selected ) picon = folder_item; + } + + ArrayList *src = &assets; + switch( selected_folder ) { + case AW_AEFFECT_FOLDER: src = &aeffects; break; + case AW_VEFFECT_FOLDER: src = &veffects; break; + case AW_ATRANSITION_FOLDER: src = &atransitions; break; + case AW_VTRANSITION_FOLDER: src = &vtransitions; break; + case AW_LABEL_FOLDER: src = &labellist; + asset_titles[0] = _("Time Stamps"); + asset_titles[1] = C_("Title"); + //allow_iconlisting = 0; + break; } + copy_picons(picon, src); } @@ -2163,7 +2149,7 @@ int AWindowFolders::drag_stop() if( get_hidden() ) return 0; if( mwindow->session->current_operation == DRAG_ASSET && gui->folder_list->cursor_above() ) { // check user folder - int item_no = gui->folder_list->get_cursor_item(); + int item_no = gui->folder_list->get_cursor_data_item_no(); AssetPicon *picon = (AssetPicon *)(item_no < 0 ? 0 : gui->folders[item_no]); if( picon && picon->foldernum >= AWINDOW_USER_FOLDERS ) { BinFolder *folder = mwindow->edl->get_folder(picon->foldernum); @@ -2488,11 +2474,14 @@ int AWindowAssets::drag_motion_event() lock_window("AWindowAssets::drag_motion_event"); if( mwindow->session->current_operation == DRAG_ASSET && gui->folder_list->cursor_above() ) { // highlight user folder - int item_no = gui->folder_list->get_cursor_item(); + BC_ListBoxItem *item = 0; + int item_no = gui->folder_list->get_cursor_data_item_no(&item); if( item_no >= 0 ) { AssetPicon *folder = (AssetPicon *)gui->folders[item_no]; if( folder->foldernum < AWINDOW_USER_FOLDERS ) item_no = -1; } + if( item_no >= 0 ) + item_no = gui->folder_list->item_to_index(&gui->folders, item); int folder_xposition = gui->folder_list->get_xposition(); int folder_yposition = gui->folder_list->get_yposition(); gui->folder_list->update(&gui->folders, 0, 0, 1, diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 6cab2a6d..d1351455 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -207,8 +207,7 @@ public: int is_realtime, int is_transition); void create_label_folder(); - void copy_picons(ArrayList *dst, - ArrayList *src, int folder); + void copy_picons(AssetPicon *picon, ArrayList *src); void sort_picons(ArrayList *src); // Return the selected asset in asset_list Indexable* selected_asset(); diff --git a/cinelerra-5.1/cinelerra/binfolder.C b/cinelerra-5.1/cinelerra/binfolder.C index dfe101cd..e8a8411d 100644 --- a/cinelerra-5.1/cinelerra/binfolder.C +++ b/cinelerra-5.1/cinelerra/binfolder.C @@ -347,7 +347,7 @@ int BinFolder::add_patterns(ArrayList *drag_idxbls, int use_basename for( int i=0; iget(i); if( !idxbl->is_asset && - idxbl->awindow_folder == AW_PROXY_FOLDER ) + idxbl->folder_no == AW_PROXY_FOLDER ) continue; const char *tp = idxbl->get_title(); @@ -363,7 +363,7 @@ int BinFolder::add_patterns(ArrayList *drag_idxbls, int use_basename for( int i=0; iget(i); if( !idxbl->is_asset && - idxbl->awindow_folder == AW_PROXY_FOLDER ) + idxbl->folder_no == AW_PROXY_FOLDER ) continue; if( i > 0 ) *bp++ = '\n'; const char *tp = idxbl->get_title(); diff --git a/cinelerra-5.1/cinelerra/clipedit.C b/cinelerra-5.1/cinelerra/clipedit.C index a3f633aa..29ebd9f6 100644 --- a/cinelerra-5.1/cinelerra/clipedit.C +++ b/cinelerra-5.1/cinelerra/clipedit.C @@ -85,9 +85,7 @@ void ClipEdit::handle_close_event(int result) if( vwindow && create_it ) { // vwindow->change_source(new_edl); } - } - else { - mwindow->session->clip_number--; + mwindow->session->update_clip_number(); } // always a copy from new_gui diff --git a/cinelerra-5.1/cinelerra/clipedls.C b/cinelerra-5.1/cinelerra/clipedls.C index 6f384fe8..83c23ee0 100644 --- a/cinelerra-5.1/cinelerra/clipedls.C +++ b/cinelerra-5.1/cinelerra/clipedls.C @@ -22,6 +22,7 @@ void ClipEDLs::clear() void ClipEDLs::add_clip(EDL *edl) { + edl->folder_no = AW_CLIP_FOLDER; append(edl); edl->add_user(); } diff --git a/cinelerra-5.1/cinelerra/clippopup.C b/cinelerra-5.1/cinelerra/clippopup.C index 68068481..4027b819 100644 --- a/cinelerra-5.1/cinelerra/clippopup.C +++ b/cinelerra-5.1/cinelerra/clippopup.C @@ -444,7 +444,7 @@ int ClipPopupNest::handle_event() EDL *clip = mwindow->session->drag_clips->values[0]; EDL *nested = edl->new_nested(clip, path); EDL *new_clip = edl->create_nested_clip(nested); - new_clip->awindow_folder = AW_CLIP_FOLDER; + new_clip->folder_no = AW_CLIP_FOLDER; sprintf(new_clip->local_session->clip_icon, "clip_%02d%02d%02d-%02d%02d%02d.png", dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday, @@ -502,7 +502,7 @@ int ClipPopupUnNest::handle_event() EDL *new_clip = new EDL(edl); new_clip->create_objects(); new_clip->copy_all(nested_edl); - new_clip->awindow_folder = AW_CLIP_FOLDER; + new_clip->folder_no = AW_CLIP_FOLDER; int idx = edl->clips.number_of(clip); if( idx >= 0 ) { edl->clips[idx] = new_clip; diff --git a/cinelerra-5.1/cinelerra/editpopup.C b/cinelerra-5.1/cinelerra/editpopup.C index f20f9b95..25931b5d 100644 --- a/cinelerra-5.1/cinelerra/editpopup.C +++ b/cinelerra-5.1/cinelerra/editpopup.C @@ -241,7 +241,7 @@ int EditPopupFindAsset::handle_event() ap->set_selected(found); } if( picon ) { - int selected_folder = picon->indexable->awindow_folder; + int selected_folder = picon->indexable->folder_no; mwindow->edl->session->awindow_folder = selected_folder; for( int i=0,n=agui->folders.size(); ifolders[i]; diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index a756e6e5..21abfd7b 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -342,6 +342,7 @@ int EDL::save_xml(FileXML *file, const char *output_path) int EDL::copy_all(EDL *edl) { if( this == edl ) return 0; + folder_no = edl->folder_no; update_index(edl); copy_session(edl); copy_assets(edl); @@ -402,7 +403,6 @@ void EDL::copy_session(EDL *edl, int session_only) if( !session_only ) { strcpy(this->path, edl->path); - awindow_folder = edl->awindow_folder; folders.copy_from(&edl->folders); } @@ -1029,6 +1029,7 @@ EDL* EDL::add_clip(EDL *edl) EDL *new_edl = new EDL(this); new_edl->create_objects(); new_edl->copy_all(edl); + new_edl->folder_no = AW_CLIP_FOLDER; clips.append(new_edl); return new_edl; } @@ -1540,11 +1541,11 @@ void EDL::set_proxy(int new_scale, int use_scaler, rescale_proxy(orig_scale, new_scale); // change original assets to proxy assets - int awindow_folder = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER; + int folder_no = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER; for( int i=0,n=proxy_assets->size(); iget(i)->path; Indexable *proxy_idxbl = proxy_assets->get(i); - proxy_idxbl->awindow_folder = awindow_folder; + proxy_idxbl->folder_no = folder_no; 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(); @@ -1598,7 +1599,7 @@ void EDL::add_proxy(int use_scaler, // change original assets to proxy assets for( int i=0,n=proxy_assets->size(); iupdate((Asset *)proxy_assets->get(i)); - proxy_asset->awindow_folder = AW_PROXY_FOLDER; + proxy_asset->folder_no = AW_PROXY_FOLDER; // replace track contents for( Track *track=tracks->first; track; track=track->next ) { if( track->data_type != TRACK_VIDEO ) continue; @@ -1614,7 +1615,7 @@ void EDL::add_proxy(int use_scaler, Asset *EDL::get_proxy_asset() { - return awindow_folder == AW_PROXY_FOLDER ? + return folder_no == AW_PROXY_FOLDER ? tracks->first->edits->first->asset : 0; } diff --git a/cinelerra-5.1/cinelerra/indexable.C b/cinelerra-5.1/cinelerra/indexable.C index 2d32e194..30553a79 100644 --- a/cinelerra-5.1/cinelerra/indexable.C +++ b/cinelerra-5.1/cinelerra/indexable.C @@ -31,7 +31,7 @@ Indexable::Indexable(int is_asset) : Garbage(is_asset ? "Asset" : "EDL") { index_state = new IndexState; this->is_asset = is_asset; - this->awindow_folder = AW_MEDIA_FOLDER; + this->folder_no = AW_MEDIA_FOLDER; } @@ -74,7 +74,7 @@ void Indexable::update_index(Indexable *src) void Indexable::copy_indexable(Indexable *src) { if( this == src ) return; - awindow_folder = src->awindow_folder; + folder_no = src->folder_no; update_path(src->path); update_index(src); } @@ -118,7 +118,7 @@ const char *Indexable::get_title() { if( is_asset ) return path; EDL *edl = (EDL*)this; - if( !edl->parent_edl || awindow_folder == AW_PROXY_FOLDER ) return path; + if( !edl->parent_edl || folder_no == AW_PROXY_FOLDER ) return path; return edl->local_session->clip_title; } diff --git a/cinelerra-5.1/cinelerra/indexable.h b/cinelerra-5.1/cinelerra/indexable.h index ab07731c..7f9009e1 100644 --- a/cinelerra-5.1/cinelerra/indexable.h +++ b/cinelerra-5.1/cinelerra/indexable.h @@ -64,7 +64,7 @@ public: // to the backup file, not the project file. char path[BCTEXTLEN]; // Folder in resource manager - int awindow_folder; + int folder_no; int is_asset; // unique ID of this object for comparison diff --git a/cinelerra-5.1/cinelerra/localsession.C b/cinelerra-5.1/cinelerra/localsession.C index 0ce537e2..9556dce3 100644 --- a/cinelerra-5.1/cinelerra/localsession.C +++ b/cinelerra-5.1/cinelerra/localsession.C @@ -60,7 +60,6 @@ LocalSession::LocalSession(EDL *edl) selectionstart = selectionend = 0; in_point = out_point = -1; - folder = AW_CLIP_FOLDER; sprintf(clip_title, _("Program")); strcpy(clip_notes, _("Hello world")); strcpy(clip_icon, ""); @@ -119,7 +118,6 @@ void LocalSession::copy_from(LocalSession *that) strcpy(clip_title, that->clip_title); strcpy(clip_notes, that->clip_notes); strcpy(clip_icon, that->clip_icon); - folder = that->folder; in_point = that->in_point; loop_playback = that->loop_playback; loop_start = that->loop_start; @@ -169,7 +167,6 @@ void LocalSession::save_xml(FileXML *file, double start) file->tag.set_property("SELECTION_END", selectionend - start); file->tag.set_property("CLIP_TITLE", clip_title); file->tag.set_property("CLIP_ICON", clip_icon); - file->tag.set_property("FOLDER", folder); file->tag.set_property("X_PANE", x_pane); file->tag.set_property("Y_PANE", y_pane); @@ -265,10 +262,6 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags) year, mon, mday, hour, min, sec); } } - int awindow_folder = file->tag.get_property("AWINDOW_FOLDER", -1); - folder = awindow_folder >= 0 ? awindow_folder : - file->tag.get_property("FOLDER", - edl->parent_edl ? AW_CLIP_FOLDER : AW_MEDIA_FOLDER); loop_playback = file->tag.get_property("LOOP_PLAYBACK", 0); loop_start = file->tag.get_property("LOOP_START", (double)0); loop_end = file->tag.get_property("LOOP_END", (double)0); diff --git a/cinelerra-5.1/cinelerra/localsession.h b/cinelerra-5.1/cinelerra/localsession.h index 5261be1f..ecf48b62 100644 --- a/cinelerra-5.1/cinelerra/localsession.h +++ b/cinelerra-5.1/cinelerra/localsession.h @@ -78,8 +78,6 @@ public: char clip_title[BCTEXTLEN]; char clip_notes[BCTEXTLEN]; char clip_icon[BCSTRLEN]; -// awindow folder id - int folder; int loop_playback; double loop_start, loop_end; diff --git a/cinelerra-5.1/cinelerra/mainsession.C b/cinelerra-5.1/cinelerra/mainsession.C index 4bfda7b0..86e5b36d 100644 --- a/cinelerra-5.1/cinelerra/mainsession.C +++ b/cinelerra-5.1/cinelerra/mainsession.C @@ -29,6 +29,8 @@ #include "edlsession.h" #include "guicast.h" #include "indexable.h" +#include "language.h" +#include "localsession.h" #include "mainsession.h" #include "meterpanel.h" #include "mwindow.h" @@ -589,3 +591,15 @@ Track *MainSession::drag_handle_track() return track; } +void MainSession::update_clip_number() +{ + int clip_no = 0; + for( int i=mwindow->edl->clips.size(); --i>=0; ) { + EDL *clip_edl = mwindow->edl->clips[i]; + int no = 0; + if( sscanf(clip_edl->local_session->clip_title,_("Clip %d"),&no) == 1 ) + if( no > clip_no ) clip_no = no; + } + clip_number = clip_no+1; +} + diff --git a/cinelerra-5.1/cinelerra/mainsession.h b/cinelerra-5.1/cinelerra/mainsession.h index a6206395..06bd12c0 100644 --- a/cinelerra-5.1/cinelerra/mainsession.h +++ b/cinelerra-5.1/cinelerra/mainsession.h @@ -54,6 +54,7 @@ public: void default_window_positions(int window_config=0); void boundaries(); Track *drag_handle_track(); + void update_clip_number(); // For drag and drop events // The entire track where the dropped asset is going to go diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 7d871c96..25013b43 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -3470,6 +3470,7 @@ void MWindow::update_project(int load_mode) if(debug) PRINT_TRACE edl->tracks->update_y_pixels(theme); + session->update_clip_number(); if(debug) PRINT_TRACE diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 24763f75..f74bfa0c 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -2074,7 +2074,7 @@ void MWindow::save_clip(EDL *new_edl, const char *txt) "clip_%02d%02d%02d-%02d%02d%02d.png", dtm.tm_year+1900, dtm.tm_mon+1, dtm.tm_mday, dtm.tm_hour, dtm.tm_min, dtm.tm_sec); - new_edl->awindow_folder = AW_CLIP_FOLDER; + new_edl->folder_no = AW_CLIP_FOLDER; edl->update_assets(new_edl); int cur_x, cur_y; gui->get_abs_cursor(cur_x, cur_y, 0); diff --git a/cinelerra-5.1/cinelerra/presets.C b/cinelerra-5.1/cinelerra/presets.C index 237bedd6..2dabe6ad 100644 --- a/cinelerra-5.1/cinelerra/presets.C +++ b/cinelerra-5.1/cinelerra/presets.C @@ -48,7 +48,7 @@ void PresetsDB::load_from_file(char *path, int is_factory, int clear_it) if( clear_it ) clear(); FileXML file; - file.read_from_file(path); + file.read_from_file(path, 1); load_common(&file, is_factory); } diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index 420592ea..4394120d 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -276,7 +276,7 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale) proxy->copy_format(format_asset, 0); proxy->video_length = video_frames; } - proxy->awindow_folder = AW_PROXY_FOLDER; + proxy->folder_no = AW_PROXY_FOLDER; proxy->audio_data = 0; proxy->video_data = 1; proxy->layers = 1; diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 2c61e826..131116b5 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -732,10 +732,10 @@ fi AC_DEFUN([PKG_PROVIDE],[ if test "x$BUILD_$1" = "x" ; then - if test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then - PKG_DISABLED([$1]) - elif test "x$PKG_$1" = "xyes"; then + if test "x$PKG_$1" = "xyes"; then PKG_FORCED([$1]) + elif test "x$2" = "xno" -o "x$PKG_$1" = "xno"; then + PKG_DISABLED([$1]) elif test "x$WANT_STATIC_BUILD" = "xyes"; then PKG_STATIC([$1],[static]) elif test "x$HAVE_$1" = "xyes"; then diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index 31bcb141..2dd4283c 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -2117,6 +2117,7 @@ int BC_ListBox::get_cursor_item(ArrayList *data, int cursor_x, cursor_y < get_item_y(item) + get_item_h(item) ) { //printf("BC_ListBox::get_cursor_item %d %d %p\n", master_column, i, item); if( item_return ) (*item_return) = item; + if( expanded < 0 ) (*counter) = i; return (*counter); } @@ -2124,8 +2125,10 @@ int BC_ListBox::get_cursor_item(ArrayList *data, int cursor_x, if( item->sublist_active() ) { if( get_cursor_item(item->get_sublist(), cursor_x, cursor_y, item_return, counter, - item->get_expand()) >= 0 ) + item->get_expand()) >= 0 ) { + if( expanded < 0 ) (*counter) = i; return (*counter); + } } } } @@ -2136,13 +2139,20 @@ int BC_ListBox::get_cursor_item(ArrayList *data, int cursor_x, } // short version -int BC_ListBox::get_cursor_item() +int BC_ListBox::get_cursor_item_no() { int rx, ry; gui->get_relative_cursor(rx, ry); return get_cursor_item(data, rx, ry, 0, 0); } +int BC_ListBox::get_cursor_data_item_no(BC_ListBoxItem **item_return) +{ + int rx, ry; + gui->get_relative_cursor(rx, ry); + return get_cursor_item(data, rx, ry, item_return, 0, -1); +} + int BC_ListBox::repeat_event(int64_t duration) { switch( current_operation ) { @@ -2725,7 +2735,7 @@ int BC_ListBox::button_release_event() //printf("BC_ListBox::button_release_event 10\n"); current_operation = NO_OPERATION; if( gui ) { - selection_number1 = selection_number = get_cursor_item(); + selection_number1 = selection_number = get_cursor_item_no(); //printf("BC_ListBox::button_release_event %d %d\n", selection_number2, selection_number1); } diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h index ba3819ae..6bdd2c04 100644 --- a/cinelerra-5.1/guicast/bclistbox.h +++ b/cinelerra-5.1/guicast/bclistbox.h @@ -193,6 +193,11 @@ public: int is_active(); int expander_active(); +// get item no at current cursor position + int get_cursor_item_no(); +// get top data item no, and item at current cursor position + int get_cursor_data_item_no(BC_ListBoxItem **item_return=0); + int translation_event(); int repeat_event(int64_t duration); BC_DragWindow* get_drag_popup(); @@ -333,7 +338,6 @@ public: // Draw the list items int draw_items(int flash, int bg_draw=0); int is_highlighted(); - int get_cursor_item(); private: void delete_columns(); @@ -441,7 +445,8 @@ private: // Points *item_return to the first item in the row or 0 if no item was found. // if it's nonzero. Returns -1 if no item was found. Clamps the y coordinate // only if the current operation is not SELECT, so scrolling is possible. -// expanded - 1 if items in this table should be tested for cursor coverage +// expanded = 1 if items in this table should be tested for cursor coverage +// expanded = -1 returns only the top level master column index/item int get_cursor_item(ArrayList *data, int cursor_x, int cursor_y, diff --git a/cinelerra-5.1/plugins/bluebanana/bluebananaslider.C b/cinelerra-5.1/plugins/bluebanana/bluebananaslider.C index cdaf76de..9acf66b6 100644 --- a/cinelerra-5.1/plugins/bluebanana/bluebananaslider.C +++ b/cinelerra-5.1/plugins/bluebanana/bluebananaslider.C @@ -1528,15 +1528,17 @@ void BluebananaSliderChannel::update(){ if(!histval){ - for(i=0;i