From: Good Guy Date: Wed, 11 Oct 2017 02:20:09 +0000 (-0600) Subject: sams folder icons, snap drag, sort folders, in/out ptr bug, interp bg fix, filebox... X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=3ac72077bee819333ea9e8c3c3307b529ecf3647;p=goodguy%2Fhistory.git sams folder icons, snap drag, sort folders, in/out ptr bug, interp bg fix, filebox ext tweak --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index dcc9aed3..5bca38f3 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -136,9 +136,9 @@ int AssetVIcon::get_vy() return lbox->get_item_y(picon) + lbox->get_title_h(); } + AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, - Indexable *indexable) + AWindowGUI *gui, Indexable *indexable) : BC_ListBoxItem() { reset(); @@ -150,8 +150,7 @@ AssetPicon::AssetPicon(MWindow *mwindow, } AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, - EDL *edl) + AWindowGUI *gui, EDL *edl) : BC_ListBoxItem() { reset(); @@ -164,7 +163,9 @@ AssetPicon::AssetPicon(MWindow *mwindow, AssetPicon::AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder, int persist) - : BC_ListBoxItem(_(AWindowGUI::folder_names[folder]), gui->folder_icon) + : BC_ListBoxItem(_(AWindowGUI::folder_names[folder]), + folder>=0 && folderfolder_icons[folder]: gui->folder_icon) { reset(); foldernum = folder; @@ -174,18 +175,7 @@ AssetPicon::AssetPicon(MWindow *mwindow, } AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, const char *folder_name, int folder_num) - : BC_ListBoxItem(folder_name, gui->folder_icon) -{ - reset(); - foldernum = folder_num; - this->mwindow = mwindow; - this->gui = gui; -} - -AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, - PluginServer *plugin) + AWindowGUI *gui, PluginServer *plugin) : BC_ListBoxItem() { reset(); @@ -194,10 +184,8 @@ AssetPicon::AssetPicon(MWindow *mwindow, this->plugin = plugin; } - AssetPicon::AssetPicon(MWindow *mwindow, - AWindowGUI *gui, - Label *label) + AWindowGUI *gui, Label *label) : BC_ListBoxItem() { reset(); @@ -445,19 +433,19 @@ AWindowGUI::~AWindowGUI() displayed_assets[1].remove_all_objects(); delete vicon_thread; - delete file_icon; delete file_res; - delete audio_icon; delete audio_res; - delete video_icon; delete video_res; - delete folder_icon; delete folder_res; - delete clip_icon; delete clip_res; - delete label_icon; delete label_res; - delete atransition_icon; delete atrans_res; - delete vtransition_icon; delete vtrans_res; - delete aeffect_icon; delete aeffect_res; - delete veffect_icon; delete veffect_res; - delete ladspa_icon; delete ladspa_res; - delete ff_aud_icon; delete ff_aud_res; - delete ff_vid_icon; delete ff_vid_res; + delete file_icon; + delete audio_icon; + delete video_icon; + delete folder_icon; + delete clip_icon; + delete label_icon; + delete atransition_icon; + delete vtransition_icon; + delete aeffect_icon; + delete veffect_icon; + delete ladspa_icon; + delete ff_aud_icon; + delete ff_vid_icon; delete newfolder_thread; delete asset_menu; delete clip_menu; @@ -485,7 +473,15 @@ bool AWindowGUI::protected_pixmap(BC_Pixmap *icon) icon == aeffect_icon || icon == ladspa_icon || icon == ff_aud_icon || - icon == ff_vid_icon; + icon == ff_vid_icon || + icon == aeffect_folder_icon || + icon == veffect_folder_icon || + icon == atransition_folder_icon || + icon == vtransition_folder_icon || + icon == label_folder_icon || + icon == clip_folder_icon || + icon == media_folder_icon || + icon == proxy_folder_icon; } VFrame *AWindowGUI::get_picon(const char *name, const char *plugin_icons) @@ -504,26 +500,23 @@ VFrame *AWindowGUI::get_picon(const char *name) return vframe; } -VFrame *AWindowGUI::resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx) +void AWindowGUI::resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx) { - VFrame *ret = vfrm = get_picon(fn); - if( !ret ) vfrm = BC_WindowBase::get_resources()->type_to_icon[idx]; + vfrm = get_picon(fn); + if( !vfrm ) vfrm = BC_WindowBase::get_resources()->type_to_icon[idx]; icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); - return ret; } -VFrame *AWindowGUI::theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn) +void AWindowGUI::theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn) { - VFrame *ret = vfrm = get_picon(fn); - if( !ret ) vfrm = mwindow->theme->get_image(fn); + vfrm = get_picon(fn); + if( !vfrm ) vfrm = mwindow->theme->get_image(fn); icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); - return ret; } -VFrame *AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png) +void AWindowGUI::plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png) { - VFrame *ret = vfrm = get_picon(fn); - if( !ret ) vfrm = new VFramePng(png); + vfrm = get_picon(fn); + if( !vfrm ) vfrm = new VFramePng(png); icon = new BC_Pixmap(this, vfrm, PIXMAP_ALPHA); - return vfrm; } void AWindowGUI::create_objects() @@ -534,21 +527,39 @@ void AWindowGUI::create_objects() set_icon(mwindow->theme->get_image("awindow_icon")); - file_res = resource_icon(file_vframe, file_icon, "film_icon", ICON_UNKNOWN); - folder_res = resource_icon(folder_vframe, folder_icon, "folder_icon", ICON_FOLDER); - audio_res = resource_icon(audio_vframe, audio_icon, "audio_icon", ICON_SOUND); - video_res = resource_icon(video_vframe, video_icon, "video_icon", ICON_FILM); - label_res = resource_icon(label_vframe, label_icon, "label_icon", ICON_LABEL); - - clip_res = theme_icon(clip_vframe, clip_icon, "clip_icon"); - atrans_res = theme_icon(atransition_vframe, atransition_icon, "atransition_icon"); - vtrans_res = theme_icon(vtransition_vframe, vtransition_icon, "vtransition_icon"); - aeffect_res = theme_icon(aeffect_vframe, aeffect_icon, "aeffect_icon"); - veffect_res = theme_icon(veffect_vframe, veffect_icon, "veffect_icon"); - - ladspa_res = plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png); - ff_aud_res = plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png); - ff_vid_res = plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png); + resource_icon(file_vframe, file_icon, "film_icon", ICON_UNKNOWN); + resource_icon(folder_vframe, folder_icon, "folder_icon", ICON_FOLDER); + resource_icon(audio_vframe, audio_icon, "audio_icon", ICON_SOUND); + resource_icon(video_vframe, video_icon, "video_icon", ICON_FILM); + resource_icon(label_vframe, label_icon, "label_icon", ICON_LABEL); + + theme_icon(aeffect_folder_vframe, aeffect_folder_icon, "aeffect_folder"); + theme_icon(atransition_folder_vframe, atransition_folder_icon, "atransition_folder"); + theme_icon(clip_folder_vframe, clip_folder_icon, "clip_folder"); + theme_icon(label_folder_vframe, label_folder_icon, "label_folder"); + theme_icon(media_folder_vframe, media_folder_icon, "media_folder"); + theme_icon(proxy_folder_vframe, proxy_folder_icon, "proxy_folder"); + theme_icon(veffect_folder_vframe, veffect_folder_icon, "veffect_folder"); + theme_icon(vtransition_folder_vframe, vtransition_folder_icon, "vtransition_folder"); + + folder_icons[AW_AEFFECT_FOLDER] = aeffect_folder_icon; + folder_icons[AW_VEFFECT_FOLDER] = veffect_folder_icon; + folder_icons[AW_ATRANSITION_FOLDER] = atransition_folder_icon; + folder_icons[AW_VTRANSITION_FOLDER] = vtransition_folder_icon; + folder_icons[AW_LABEL_FOLDER] = label_folder_icon; + folder_icons[AW_CLIP_FOLDER] = clip_folder_icon; + folder_icons[AW_MEDIA_FOLDER] = media_folder_icon; + folder_icons[AW_PROXY_FOLDER] = proxy_folder_icon; + + theme_icon(clip_vframe, clip_icon, "clip_icon"); + theme_icon(atransition_vframe, atransition_icon, "atransition_icon"); + theme_icon(vtransition_vframe, vtransition_icon, "vtransition_icon"); + theme_icon(aeffect_vframe, aeffect_icon, "aeffect_icon"); + theme_icon(veffect_vframe, veffect_icon, "veffect_icon"); + + plugin_icon(ladspa_vframe, ladspa_icon, "lad_picon", lad_picon_png); + plugin_icon(ff_aud_vframe, ff_aud_icon, "ff_audio", ff_audio_png); + plugin_icon(ff_vid_vframe, ff_vid_icon, "ff_video", ff_video_png); // Mandatory folders folders.append(new AssetPicon(mwindow, this, AW_AEFFECT_FOLDER, 1)); @@ -894,7 +905,7 @@ void AWindowGUI::update_folder_list() stop_vicon_drawing(); for( int i = 0; i < folders.total; i++ ) { AssetPicon *picon = (AssetPicon*)folders.values[i]; - picon->in_use--; + picon->in_use = 0; } // Search assets for folders @@ -967,7 +978,7 @@ void AWindowGUI::update_asset_list() { for( int i = 0; i < assets.total; i++ ) { AssetPicon *picon = (AssetPicon*)assets.values[i]; - picon->in_use--; + picon->in_use = 0; } // Synchronize EDL clips @@ -1109,6 +1120,12 @@ void AWindowGUI::sort_assets() update_assets(); } +void AWindowGUI::sort_folders() +{ + sort_picons(&folders); + update_assets(); +} + void AWindowGUI::collect_assets() { int i = 0; diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 62e86597..e8bd76f5 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -51,7 +51,6 @@ public: AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin); AssetPicon(MWindow *mwindow, AWindowGUI *gui, Label *plugin); AssetPicon(MWindow *mwindow, AWindowGUI *gui, int folder, int persist); - AssetPicon(MWindow *mwindow, AWindowGUI *gui, const char *folder_name, int folder_num); virtual ~AssetPicon(); void create_objects(); @@ -140,6 +139,7 @@ public: void async_update_assets(); // Sends update asset event void update_effects(); void sort_assets(); + void sort_folders(); void reposition_objects(); static int folder_number(const char *name); // Call back for MWindow entry point @@ -169,9 +169,9 @@ public: VFrame *get_picon(const char *name, const char *plugin_icons); VFrame *get_picon(const char *name); - VFrame *resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx); - VFrame *theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn); - VFrame *plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png); + void resource_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, int idx); + void theme_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn); + void plugin_icon(VFrame *&vfrm, BC_Pixmap *&icon, const char *fn, unsigned char *png); MWindow *mwindow; AWindow *awindow; @@ -199,19 +199,30 @@ public: BC_Hash *defaults; // Persistent icons - BC_Pixmap *folder_icon; VFrame *folder_res, *folder_vframe; - BC_Pixmap *file_icon; VFrame *file_res, *file_vframe; - BC_Pixmap *audio_icon; VFrame *audio_res, *audio_vframe; - BC_Pixmap *video_icon; VFrame *video_res, *video_vframe; - BC_Pixmap *label_icon; VFrame *label_res, *label_vframe; - BC_Pixmap *clip_icon; VFrame *clip_res, *clip_vframe; - BC_Pixmap *atransition_icon; VFrame *atrans_res, *atransition_vframe; - BC_Pixmap *vtransition_icon; VFrame *vtrans_res, *vtransition_vframe; - BC_Pixmap *aeffect_icon; VFrame *aeffect_res, *aeffect_vframe; - BC_Pixmap *veffect_icon; VFrame *veffect_res, *veffect_vframe; - BC_Pixmap *ladspa_icon; VFrame *ladspa_res, *ladspa_vframe; - BC_Pixmap *ff_aud_icon; VFrame *ff_aud_res, *ff_aud_vframe; - BC_Pixmap *ff_vid_icon; VFrame *ff_vid_res, *ff_vid_vframe; + BC_Pixmap *aeffect_folder_icon; VFrame *aeffect_folder_vframe; + BC_Pixmap *atransition_folder_icon; VFrame *atransition_folder_vframe; + BC_Pixmap *clip_folder_icon; VFrame *clip_folder_vframe; + BC_Pixmap *label_folder_icon; VFrame *label_folder_vframe; + BC_Pixmap *media_folder_icon; VFrame *media_folder_vframe; + BC_Pixmap *proxy_folder_icon; VFrame *proxy_folder_vframe; + BC_Pixmap *veffect_folder_icon; VFrame *veffect_folder_vframe; + BC_Pixmap *vtransition_folder_icon; VFrame *vtransition_folder_vframe; + BC_Pixmap *folder_icons[AWINDOW_FOLDERS]; + + BC_Pixmap *folder_icon; VFrame *folder_vframe; + BC_Pixmap *file_icon; VFrame *file_vframe; + BC_Pixmap *audio_icon; VFrame *audio_vframe; + BC_Pixmap *video_icon; VFrame *video_vframe; + BC_Pixmap *label_icon; VFrame *label_vframe; + BC_Pixmap *clip_icon; VFrame *clip_vframe; + BC_Pixmap *atransition_icon; VFrame *atransition_vframe; + BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe; + BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe; + BC_Pixmap *veffect_icon; VFrame *veffect_vframe; + BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe; + BC_Pixmap *ff_aud_icon; VFrame *ff_aud_vframe; + BC_Pixmap *ff_vid_icon; VFrame *ff_vid_vframe; + NewFolderThread *newfolder_thread; // Popup menus diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 134aa8c9..d6810aa7 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -1552,7 +1552,7 @@ void EDL::append_vwindow_edl(EDL *edl, int increase_counter) double EDL::next_edit(double position) { Units::fix_double(&position); - double new_position = INFINITY; + double new_position = tracks->total_length(); double max_rate = get_frame_rate(); int sample_rate = get_sample_rate(); diff --git a/cinelerra-5.1/cinelerra/folderlistmenu.C b/cinelerra-5.1/cinelerra/folderlistmenu.C index 0eb39c2a..823c9f31 100644 --- a/cinelerra-5.1/cinelerra/folderlistmenu.C +++ b/cinelerra-5.1/cinelerra/folderlistmenu.C @@ -42,10 +42,10 @@ FolderListMenu::~FolderListMenu() void FolderListMenu::create_objects() { add_item(format = new FolderListFormat(mwindow, this)); + add_item(new FolderListSort(mwindow, this)); update_titles(); } - void FolderListMenu::update_titles() { format->set_text(mwindow->edl->session->folderlist_format == FOLDERS_TEXT ? @@ -53,7 +53,6 @@ void FolderListMenu::update_titles() } - FolderListFormat::FolderListFormat(MWindow *mwindow, FolderListMenu *menu) : BC_MenuItem("") { @@ -79,3 +78,17 @@ int FolderListFormat::handle_event() return 1; } + +FolderListSort::FolderListSort(MWindow *mwindow, FolderListMenu *menu) + : BC_MenuItem(_("Sort items")) +{ + this->mwindow = mwindow; + this->menu = menu; +} + +int FolderListSort::handle_event() +{ + mwindow->awindow->gui->sort_folders(); + return 1; +} + diff --git a/cinelerra-5.1/cinelerra/folderlistmenu.h b/cinelerra-5.1/cinelerra/folderlistmenu.h index 41f0860c..184e6092 100644 --- a/cinelerra-5.1/cinelerra/folderlistmenu.h +++ b/cinelerra-5.1/cinelerra/folderlistmenu.h @@ -37,6 +37,16 @@ public: FolderListMenu *menu; }; +class FolderListSort : public BC_MenuItem +{ +public: + FolderListSort(MWindow *mwindow, FolderListMenu *menu); + + int handle_event(); + MWindow *mwindow; + FolderListMenu *menu; +}; + class FolderListMenu : public BC_PopupMenu { public: diff --git a/cinelerra-5.1/cinelerra/interp.h b/cinelerra-5.1/cinelerra/interp.h index a68a83e5..ee183476 100644 --- a/cinelerra-5.1/cinelerra/interp.h +++ b/cinelerra-5.1/cinelerra/interp.h @@ -26,9 +26,9 @@ } */ -static inline float in_clip(float mx, float ofs, float v) +static inline float in_clip(float v, float mx) { - return (v+=ofs) < 0 ? 0 : v > mx ? mx : v; + return v < 0 ? 0 : v > mx ? mx : v; } static inline float interp_linear(float dx, float p1, float p2) @@ -55,10 +55,10 @@ static inline float interp_cubic(float dx, float p0, float p1, float p2, float p int c0 = itx+0, r0 = ity+0; \ typ *r0p = r0>=in_min_y && r0=in_min_x && c0=in_min_y && r0=in_min_y && r1=in_min_x && c0=in_min_x && c1=in_min_y && r1=in_min_y && r2=in_min_x && cp=in_min_x && c0=in_min_x && c1=in_min_x && c2local_session->get_selectionstart(); + double start_pos = edl->local_session->get_selectionstart(1); double position = edl->prev_edit(start_pos); if( position < start_pos ) cut(position, start_pos, position); @@ -552,7 +552,7 @@ void MWindow::snap_left_edit() void MWindow::snap_right_edit() { - double end_pos = edl->local_session->get_selectionend(); + double end_pos = edl->local_session->get_selectionend(1); double position = edl->next_edit(end_pos); if( end_pos < position ) cut(end_pos, position, end_pos); @@ -560,7 +560,7 @@ void MWindow::snap_right_edit() void MWindow::snap_left_label() { - double start_pos = edl->local_session->get_selectionstart(); + double start_pos = edl->local_session->get_selectionstart(1); Label *left_label = edl->labels->prev_label(start_pos); if( !left_label ) return; double position = left_label->position; @@ -570,7 +570,7 @@ void MWindow::snap_left_label() void MWindow::snap_right_label() { - double end_pos = edl->local_session->get_selectionend(); + double end_pos = edl->local_session->get_selectionend(1); Label *right_label = edl->labels->next_label(end_pos); if( !right_label ) return; double position = right_label->position; diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 47bc2f1a..06fb11cc 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -683,7 +683,7 @@ int MWindow::next_edit_handle(int shift_down) { double position = edl->local_session->get_selectionend(1); double new_position = edl->next_edit(position); - if(new_position != INFINITY) { + if( new_position < edl->tracks->total_length() ) { edl->local_session->set_selectionend(new_position); //printf("MWindow::next_edit_handle %d\n", shift_down); if(!shift_down) diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index a0ba9f27..740dea55 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -46,6 +46,7 @@ #include "keyframepopup.h" #include "keyframes.h" #include "keys.h" +#include "labels.h" #include "localsession.h" #include "mainclock.h" #include "maincursor.h" @@ -109,6 +110,7 @@ TrackCanvas::TrackCanvas(MWindow *mwindow, render_timer = new Timer; hourglass_enabled = 0; timebar_position = -1; + snapped = 0; } TrackCanvas::~TrackCanvas() @@ -1763,7 +1765,7 @@ void TrackCanvas::draw_drag_handle() mwindow->edl->local_session->zoom_sample - mwindow->edl->local_session->view_start[pane->number]); //printf("TrackCanvas::draw_drag_handle 2 %d %jd\n", pane->number, pixel1); - set_color(GREEN); + set_color(!snapped ? GREEN : (snapped=0, YELLOW)); set_inverse(); //printf("TrackCanvas::draw_drag_handle 3\n"); draw_line(pixel1, 0, pixel1, get_h()); @@ -3472,15 +3474,46 @@ int TrackCanvas::deactivate() void TrackCanvas::update_drag_handle() { double new_position; + int cursor_x = get_cursor_x(); new_position = - (double)(get_cursor_x() + + (double)(cursor_x + mwindow->edl->local_session->view_start[pane->number]) * mwindow->edl->local_session->zoom_sample / mwindow->edl->session->sample_rate; + new_position = mwindow->edl->align_to_frame(new_position, 0); + if( ctrl_down() && alt_down() ) { +#define snapper(v) do { \ + double pos = (v); \ + if( pos < 0 ) break; \ + double dist = fabs(new_position - pos); \ + if( dist >= snap_min ) break; \ + snap_position = pos; snap_min = dist; \ +} while(0) + double snap_position = new_position; + double snap_min = DBL_MAX; + if( mwindow->edl->local_session->inpoint_valid() ) + snapper(mwindow->edl->local_session->get_inpoint()); + if( mwindow->edl->local_session->outpoint_valid() ) + snapper(mwindow->edl->local_session->get_outpoint()); + snapper(mwindow->edl->prev_edit(new_position)); + snapper(mwindow->edl->next_edit(new_position)); + Label *prev_label = mwindow->edl->labels->prev_label(new_position); + if( prev_label ) snapper(prev_label->position); + Label *next_label = mwindow->edl->labels->next_label(new_position); + if( next_label ) snapper(next_label->position); + int snap_x = snap_position * mwindow->edl->session->sample_rate / + mwindow->edl->local_session->zoom_sample - + mwindow->edl->local_session->view_start[pane->number]; + if( abs(snap_x - cursor_x) < HANDLE_W ) { + snapped = 1; + new_position = snap_position; + } +#undef snapper + } if(new_position != mwindow->session->drag_position) { @@ -4658,7 +4691,6 @@ int TrackCanvas::button_press_event() int result = 0; int cursor_x, cursor_y; int new_cursor; - double start_position = mwindow->edl->local_session->get_selectionstart(1); cursor_x = get_cursor_x(); cursor_y = get_cursor_y(); @@ -4815,23 +4847,7 @@ int TrackCanvas::button_press_event() gui->flash_canvas(1); } } -// if snapping to selection point - if( gui->ctrl_down() && gui->alt_down() ) { - switch( mwindow->session->current_operation ) { - case DRAG_EDITHANDLE1: - mwindow->session->drag_position = start_position; - mwindow->session->current_operation = NO_OPERATION; - drag_scroll = 0; - end_edithandle_selection(); - break; - case DRAG_PLUGINHANDLE1: - mwindow->session->drag_position = start_position; - mwindow->session->current_operation = NO_OPERATION; - drag_scroll = 0; - end_pluginhandle_selection(); - break; - } - } + return result; } diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index ab82e160..a99ca143 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -413,7 +413,7 @@ public: // ====================================== cursor selection type double selection_midpoint; // division between current ends - + int snapped; // drag handle snapping }; #endif diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index 207084d7..021a87fc 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -883,25 +883,13 @@ int BC_FileBox::delete_tables() BC_Pixmap* BC_FileBox::get_icon(char *path, int is_dir) { - char *suffix = strrchr(path, '.'); + if( is_dir ) return icons[ICON_FOLDER]; int icon_type = ICON_UNKNOWN; - - if(is_dir) return icons[ICON_FOLDER]; - - if(suffix) - { - suffix++; - if(*suffix != 0) - { - for(int i = 0; i < TOTAL_SUFFIXES; i++) - { - if(!strcasecmp(suffix, BC_WindowBase::get_resources()->suffix_to_type[i].suffix)) - { - icon_type = BC_WindowBase::get_resources()->suffix_to_type[i].icon_type; - break; - } - } - } + char *suffix = strrchr(path, '.'); + if( suffix && *++suffix ) { + suffix_to_type_t *stp = &BC_WindowBase::get_resources()->suffix_to_type[0]; + while( stp->suffix && strcasecmp(stp->suffix, suffix) ) ++stp; + if( stp->icon_type ) icon_type = stp->icon_type; } return icons[icon_type]; diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index e3769675..d2f0b7a9 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -173,19 +173,63 @@ void BC_Resources::finit_font_defs() delete [] big_font_xft2; } + suffix_to_type_t BC_Resources::suffix_to_type[] = { - { "m2v", ICON_FILM }, - { "mov", ICON_FILM }, - { "mp2", ICON_SOUND }, - { "mp3", ICON_SOUND }, - { "ac3", ICON_SOUND }, - { "mpg", ICON_FILM }, - { "vob", ICON_FILM }, - { "ifo", ICON_FILM }, - { "ts", ICON_FILM }, - { "vts", ICON_FILM }, - { "wav", ICON_SOUND } + { "aac", ICON_SOUND }, + { "ac3", ICON_SOUND }, + { "dts", ICON_SOUND }, + { "flac", ICON_SOUND }, + { "mp2", ICON_SOUND }, + { "mp3", ICON_SOUND }, + { "wav", ICON_SOUND }, + { "wma", ICON_SOUND }, + { "wmv", ICON_SOUND }, + { "avi", ICON_FILM }, + { "bmp", ICON_FILM }, + { "cr2", ICON_FILM }, + { "dnxhd", ICON_FILM }, + { "dvd", ICON_FILM }, + { "dv", ICON_FILM }, + { "f4v", ICON_FILM }, + { "flv", ICON_FILM }, + { "gif", ICON_FILM }, + { "gxf", ICON_FILM }, + { "h264", ICON_FILM }, + { "h265", ICON_FILM }, + { "hevc", ICON_FILM }, + { "ifo", ICON_FILM }, + { "jpeg", ICON_FILM }, + { "jpg", ICON_FILM }, + { "m2ts", ICON_FILM }, + { "m2v", ICON_FILM }, + { "m4v", ICON_FILM }, + { "mkv", ICON_FILM }, + { "mov", ICON_FILM }, + { "mp4", ICON_FILM }, + { "mpeg", ICON_FILM }, + { "mpg", ICON_FILM }, + { "mts", ICON_FILM }, + { "mxf", ICON_FILM }, + { "ogg", ICON_FILM }, + { "ogv", ICON_FILM }, + { "pcm", ICON_FILM }, + { "pgm", ICON_FILM }, + { "png", ICON_FILM }, + { "ppm", ICON_FILM }, + { "qt", ICON_FILM }, + { "rm", ICON_FILM }, + { "swf", ICON_FILM }, + { "tiff", ICON_FILM }, + { "tif", ICON_FILM }, + { "ts", ICON_FILM }, + { "vob", ICON_FILM }, + { "vts", ICON_FILM }, + { "webm", ICON_FILM }, + { "webp", ICON_FILM }, + { "xml", ICON_FILM }, + { "y4m", ICON_FILM }, + { 0, 0 }, }; BC_Signals* BC_Resources::signal_handler = 0; diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index 1f2037bd..8ff04649 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -277,7 +277,7 @@ public: int drag_radius; // Filebox - static suffix_to_type_t suffix_to_type[TOTAL_SUFFIXES]; + static suffix_to_type_t suffix_to_type[]; VFrame **type_to_icon; // Display mode for fileboxes int filebox_mode; diff --git a/cinelerra-5.1/guicast/bcresources.inc b/cinelerra-5.1/guicast/bcresources.inc index 1f103082..39c6a119 100644 --- a/cinelerra-5.1/guicast/bcresources.inc +++ b/cinelerra-5.1/guicast/bcresources.inc @@ -26,7 +26,6 @@ class BC_Resources; #define TOTAL_ICONS 5 -#define TOTAL_SUFFIXES 11 #define TOTAL_7SEGMENT 20 // Length of language and region buffer diff --git a/cinelerra-5.1/picon_cinfinity/aeffect_folder.png b/cinelerra-5.1/picon_cinfinity/aeffect_folder.png new file mode 100644 index 00000000..0d5c8bc8 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/aeffect_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/atransition_folder.png b/cinelerra-5.1/picon_cinfinity/atransition_folder.png new file mode 100644 index 00000000..b36bb9c1 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/atransition_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/clip_folder.png b/cinelerra-5.1/picon_cinfinity/clip_folder.png new file mode 100644 index 00000000..c30d5dde Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/clip_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/label_folder.png b/cinelerra-5.1/picon_cinfinity/label_folder.png new file mode 100644 index 00000000..92bc563b Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/label_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/media_folder.png b/cinelerra-5.1/picon_cinfinity/media_folder.png new file mode 100644 index 00000000..59928ae9 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/media_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/proxy_folder.png b/cinelerra-5.1/picon_cinfinity/proxy_folder.png new file mode 100644 index 00000000..177a9ba1 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/proxy_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/proxy_icon.png b/cinelerra-5.1/picon_cinfinity/proxy_icon.png new file mode 100644 index 00000000..177a9ba1 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/proxy_icon.png differ diff --git a/cinelerra-5.1/picon_cinfinity/veffect_folder.png b/cinelerra-5.1/picon_cinfinity/veffect_folder.png new file mode 100644 index 00000000..92ec75e0 Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/veffect_folder.png differ diff --git a/cinelerra-5.1/picon_cinfinity/vtransition_folder.png b/cinelerra-5.1/picon_cinfinity/vtransition_folder.png new file mode 100644 index 00000000..cfd135bf Binary files /dev/null and b/cinelerra-5.1/picon_cinfinity/vtransition_folder.png differ