X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fawindowgui.C;h=505f32f16cd2c191e3b8d6d19c01dbaedf76fcf1;hb=7cec2a82e63b4cbd8ce58fd98bd66eb4e7f2e826;hp=7ea4759f49fdc36d402fc243b9a5529096a12a10;hpb=b9f98da8f1cd8b7b31ead02fa41f299b56cac3da;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 7ea4759f..505f32f1 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -134,6 +134,15 @@ VFrame *AssetVIcon::frame() temp->draw_line(x,0, x,vh); return temp; } + int ww = picon->gui->vicon_thread->view_w; + int hh = picon->gui->vicon_thread->view_h; + if( !asset->video_data ) { + if( !temp ) { + temp = new VFrame(0, -1, ww, hh, BC_RGB888, -1); + temp->clear_frame(); + } + return temp; + } if( seq_no >= images.size() ) { MWindow *mwindow = picon->mwindow; File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1); @@ -143,8 +152,6 @@ VFrame *AssetVIcon::frame() } if( !temp ) temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1); - int ww = picon->gui->vicon_thread->view_w; - int hh = picon->gui->vicon_thread->view_h; while( seq_no >= images.size() ) { file->set_layer(0); int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate; @@ -171,7 +178,7 @@ int AssetVIcon::get_vx() int AssetVIcon::get_vy() { BC_ListBox *lbox = picon->gui->asset_list; - return lbox->get_item_y(picon) + lbox->get_title_h(); + return lbox->get_item_y(picon); } void AssetVIcon::load_audio() @@ -1026,6 +1033,8 @@ void AWindowGUI::create_objects() add_subwindow(asset_list = new AWindowAssets(mwindow, this, x1, y1, w1, h1)); vicon_thread = new VIconThread(asset_list); + int x0 = 0, y0 = asset_list->get_title_h(); + vicon_thread->set_drawing_area(x0,y0, get_w(),get_h()); vicon_thread->start(); vicon_audio = new AssetVIconAudio(this); @@ -1177,8 +1186,15 @@ void AWindowGUI::start_vicon_drawing() { if( !vicon_drawing ) return; if( mwindow->edl->session->awindow_folder != AW_MEDIA_FOLDER ) return; - if( mwindow->edl->session->assetlist_format != ASSETS_ICONS ) return; - vicon_thread->start_drawing(); + switch( mwindow->edl->session->assetlist_format ) { + case ASSETS_ICONS: + case ASSETS_ICONS_PACKED: + case ASSETS_ICON_LIST: + vicon_thread->start_drawing(); + break; + default: + break; + } } void AWindowGUI::stop_vicon_drawing() @@ -1783,6 +1799,11 @@ void AWindowGUI::update_assets() if( mwindow->edl->session->assetlist_format != asset_list->get_format() ) { asset_list->update_format(mwindow->edl->session->assetlist_format, 0); + int x0 = 0; + int x1 = asset_list->get_w(); + int y0 = asset_list->get_title_h(); + int y1 = asset_list->get_h(); + vicon_thread->set_drawing_area(x0,y0, x1,y1); } int asset_xposition = asset_list->get_xposition(); int asset_yposition = asset_list->get_yposition(); @@ -1910,7 +1931,7 @@ int AWindowDivider::button_release_event() AWindowFolders::AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h) : BC_ListBox(x, y, w, h, - mwindow->edl->session->folderlist_format == ASSETS_ICONS ? + mwindow->edl->session->folderlist_format == FOLDERS_ICONS ? LISTBOX_ICONS : LISTBOX_TEXT, &gui->folders, // Each column has an ArrayList of BC_ListBoxItems. 0, // Titles for columns. Set to 0 for no titles @@ -1976,9 +1997,11 @@ int AWindowFolders::button_press_event() AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h) - : BC_ListBox(x, y, w, h, - (mwindow->edl->session->assetlist_format == ASSETS_ICONS && gui->allow_iconlisting ) ? - LISTBOX_ICONS : LISTBOX_TEXT, + : BC_ListBox(x, y, w, h, !gui->allow_iconlisting ? LISTBOX_TEXT : + mwindow->edl->session->assetlist_format == ASSETS_ICONS ? LISTBOX_ICONS : + mwindow->edl->session->assetlist_format == ASSETS_ICONS_PACKED ? LISTBOX_ICONS_PACKED : + mwindow->edl->session->assetlist_format == ASSETS_ICON_LIST ? LISTBOX_ICON_LIST : + LISTBOX_TEXT, &gui->assets, // Each column has an ArrayList of BC_ListBoxItems. gui->asset_titles,// Titles for columns. Set to 0 for no titles mwindow->edl->session->asset_columns, // width of each column @@ -2600,28 +2623,55 @@ int AWindowListFormat::handle_event() gui->stop_vicon_drawing(); EDLSession *session = mwindow->edl->session; - switch( session->assetlist_format ) { - case ASSETS_TEXT: - session->assetlist_format = ASSETS_ICONS; - break; - case ASSETS_ICONS: - session->assetlist_format = ASSETS_TEXT; - break; + if( mwindow->awindow->gui->allow_iconlisting ) { + switch( session->assetlist_format ) { + case ASSETS_TEXT: + session->assetlist_format = ASSETS_ICONS; + break; + case ASSETS_ICONS: + session->assetlist_format = ASSETS_ICONS_PACKED; + break; + case ASSETS_ICONS_PACKED: + session->assetlist_format = ASSETS_ICON_LIST; + break; + case ASSETS_ICON_LIST: + session->assetlist_format = ASSETS_TEXT; + break; + } } - - gui->asset_list->update_format(session->assetlist_format, 1); - if( !mwindow->awindow->gui->allow_iconlisting ) { + else mwindow->edl->session->assetlist_format = ASSETS_TEXT; - } + gui->asset_list->update_format(session->assetlist_format, 0); + int x0 = 0; + int x1 = gui->asset_list->get_w(); + int y0 = gui->asset_list->get_title_h(); + int y1 = gui->asset_list->get_h(); + gui->vicon_thread->set_drawing_area(x0,y0, x1,y1); + gui->async_update_assets(); gui->start_vicon_drawing(); return 1; } void AWindowListFormat::update() { - set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ? - (char*)_("Display icons") : (char*)_("Display text")); + EDLSession *session = mwindow->edl->session; + const char *text = 0; + switch( session->assetlist_format ) { + case ASSETS_TEXT: + text = _("Display icons"); + break; + case ASSETS_ICONS: + text = _("Display icons packed"); + break; + case ASSETS_ICONS_PACKED: + text = _("Display icon list"); + break; + case ASSETS_ICON_LIST: + text = _("Display text"); + break; + } + set_text(text); } AWindowListSort::AWindowListSort(MWindow *mwindow, AWindowGUI *gui)