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;
default:
return;
case ASSET_VIEW_MEDIA_MAP:
+ case ASSET_VIEW_FULL:
break;
}
set_color(BLACK);
}
}
+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,
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()
vicon_thread->stop_drawing();
}
+void AWindowGUI::close_view_popup()
+{
+ vicon_thread->close_view_popup();
+}
+
VFrame *AssetPicon::get_vicon_frame()
{
if( !vicon ) return 0;
#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
{
int button_press_event();
int button_release_event();
int cursor_motion_event();
+ int keypress_event();
void draw_vframe(VFrame *frame);
ViewPopup *new_view_window();
void drawing_started();
void drawing_stopped();
+ void close_view_popup();
AWindowGUI *gui;
int draw_mode;
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();
void MWindow::remove_assets_from_project(int push_undo, int redraw,
ArrayList<Indexable*> *drag_assets, ArrayList<EDL*> *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);
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)