From: Good Guy Date: Sun, 9 Dec 2018 15:31:44 +0000 (-0700) Subject: full screen vicon view popup X-Git-Tag: 2019-08~157 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=c98ecabef4f08c66ad7dbd3004cf7995e012dc3e;p=goodguy%2Fcinelerra.git full screen vicon view popup --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 45954b76..13e94b95 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -328,17 +328,29 @@ int AssetViewPopup::button_press_event() AssetVIconThread *avt = (AssetVIconThread *)vt; if( !avt->vicon ) return 0; - int dir = 1, button = get_buttonpress(); - switch( button ) { - case WHEEL_DOWN: dir = -1; // fall thru - case WHEEL_UP: return avt->zoom_scale(dir); + switch( draw_mode ) { + case ASSET_VIEW_MEDIA_MAP: + case ASSET_VIEW_FULL: + break; + default: + return 0; + } + + int dir = 1; + switch( get_buttonpress() ) { case LEFT_BUTTON: break; + case WHEEL_DOWN: + dir = -1; + // fall thru + case WHEEL_UP: + if( draw_mode != ASSET_VIEW_FULL ) + return avt->zoom_scale(dir); + // fall thru default: return 0; } - if( draw_mode != ASSET_VIEW_MEDIA_MAP ) return 0; int x = get_cursor_x(), y = get_cursor_y(); AssetVIcon *vicon = (AssetVIcon *)avt->vicon; AssetPicon *picon = vicon->picon; @@ -472,6 +484,7 @@ void AssetViewPopup::draw_vframe(VFrame *vframe) default: return; case ASSET_VIEW_MEDIA_MAP: + case ASSET_VIEW_FULL: break; } set_color(BLACK); @@ -533,6 +546,27 @@ void AssetViewPopup::draw_vframe(VFrame *vframe) } } +int AssetViewPopup::keypress_event() +{ + AssetVIconThread *avt = (AssetVIconThread *)vt; + switch( avt->draw_mode ) { + case ASSET_VIEW_MEDIA_MAP: + switch( get_keypress() ) { + case 'f': + case 'F': + avt->draw_mode = ASSET_VIEW_FULL; + avt->viewing = 0; + return 1; + } + break; + case ASSET_VIEW_FULL: + avt->draw_mode = ASSET_VIEW_MEDIA_MAP; + avt->viewing = 0; + return 1; + } + return ViewPopup::keypress_event(); +} + AssetVIconThread::AssetVIconThread(AWindowGUI *gui, Preferences *preferences) : VIconThread(gui->asset_list, preferences->vicon_size * 16/9, preferences->vicon_size, @@ -579,22 +613,33 @@ void AssetVIconThread::set_view_popup(AssetVIcon *v, int draw_mode) ViewPopup *AssetVIconThread::new_view_window() { BC_WindowBase *parent = wdw->get_parent(); - XineramaScreenInfo *info = parent->get_xinerama_info(-1); - int cx = info ? info->x_org + info->width/2 : parent->get_root_w(0)/2; - int cy = info ? info->y_org + info->height/2 : parent->get_root_h(0)/2; - int vx = viewing->get_vx(), rx = 0; - int vy = viewing->get_vy(), ry = 0; - wdw->get_root_coordinates(vx, vy, &rx, &ry); - rx += (rx >= cx ? -view_w+viewing->w/4 : viewing->w-viewing->w/4); - ry += (ry >= cy ? -view_h+viewing->h/4 : viewing->h-viewing->h/4); - AssetViewPopup *popup = new AssetViewPopup(this, draw_mode, - rx, ry, view_w, view_h); - if( draw_mode == ASSET_VIEW_MEDIA_MAP ) + int rx = 0, ry = 0, rw = 0, rh = 0; + if( draw_mode != ASSET_VIEW_FULL ) { + XineramaScreenInfo *info = parent->get_xinerama_info(-1); + int cx = info ? info->x_org + info->width/2 : parent->get_root_w(0)/2; + int cy = info ? info->y_org + info->height/2 : parent->get_root_h(0)/2; + int vx = viewing->get_vx(), vy = viewing->get_vy(); + wdw->get_root_coordinates(vx, vy, &rx, &ry); + rx += (rx >= cx ? -view_w+viewing->w/4 : viewing->w-viewing->w/4); + ry += (ry >= cy ? -view_h+viewing->h/4 : viewing->h-viewing->h/4); + rw = view_w; rh = view_h; + } + else + parent->get_fullscreen_geometry(rx, ry, rw, rh); + AssetViewPopup *popup = new AssetViewPopup(this, draw_mode, rx, ry, rw, rh); + if( draw_mode == ASSET_VIEW_MEDIA_MAP || draw_mode == ASSET_VIEW_FULL ) vicon->playing_audio = -1; wdw->set_active_subwindow(popup); return popup; } +void AssetVIconThread::close_view_popup() +{ + stop_drawing(); + drawing_started(); // waits for draw lock + drawing_stopped(); +} + AWindowFolderItem::AWindowFolderItem() : BC_ListBoxItem() @@ -1565,6 +1610,11 @@ void AWindowGUI::stop_vicon_drawing() vicon_thread->stop_drawing(); } +void AWindowGUI::close_view_popup() +{ + vicon_thread->close_view_popup(); +} + VFrame *AssetPicon::get_vicon_frame() { if( !vicon ) return 0; diff --git a/cinelerra-5.1/cinelerra/awindowgui.h b/cinelerra-5.1/cinelerra/awindowgui.h index 13ccda90..dadc44bc 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.h +++ b/cinelerra-5.1/cinelerra/awindowgui.h @@ -62,6 +62,7 @@ #define ASSET_VIEW_ICON 1 #define ASSET_VIEW_MEDIA 2 #define ASSET_VIEW_MEDIA_MAP 3 +#define ASSET_VIEW_FULL 4 class AWindowFolderItem : public BC_ListBoxItem { @@ -178,6 +179,7 @@ public: int button_press_event(); int button_release_event(); int cursor_motion_event(); + int keypress_event(); void draw_vframe(VFrame *frame); @@ -196,6 +198,7 @@ public: ViewPopup *new_view_window(); void drawing_started(); void drawing_stopped(); + void close_view_popup(); AWindowGUI *gui; int draw_mode; @@ -274,6 +277,7 @@ public: int load_defaults(BC_Hash *defaults); void start_vicon_drawing(); void stop_vicon_drawing(); + void close_view_popup(); void update_picon(Indexable *indexable); int cycle_assetlist_format(); diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 5fde46cc..a84e11a1 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -4011,9 +4011,7 @@ void MWindow::remove_asset_from_caches(Asset *asset) void MWindow::remove_assets_from_project(int push_undo, int redraw, ArrayList *drag_assets, ArrayList *drag_clips) { - awindow->gui->vicon_thread->stop_drawing(); - awindow->gui->vicon_thread->drawing_started(); // waits for draw lock - awindow->gui->vicon_thread->drawing_stopped(); + awindow->gui->close_view_popup(); for(int i = 0; i < drag_assets->total; i++) { Indexable *indexable = drag_assets->get(i); @@ -4072,16 +4070,16 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, void MWindow::remove_assets_from_disk() { + remove_assets_from_project(1, + 1, + session->drag_assets, + session->drag_clips); + // Remove from disk for(int i = 0; i < session->drag_assets->total; i++) { remove(session->drag_assets->get(i)->path); } - - remove_assets_from_project(1, - 1, - session->drag_assets, - session->drag_clips); } void MWindow::dump_plugins(FILE *fp)