mwindow->gui->lock_window("AssetPopup::paste_assets");
mwindow->cwindow->gui->lock_window("AssetPopup::paste_assets");
- gui->collect_assets();
+ int proxy = mwindow->edl->session->awindow_folder == AW_PROXY_FOLDER ? 1 : 0;
+ gui->collect_assets(proxy);
mwindow->paste_assets(mwindow->edl->local_session->get_selectionstart(1),
mwindow->edl->tracks->first, 0); // do not overwrite
int AssetPopup::update()
{
format->update();
- gui->collect_assets();
+ int proxy = mwindow->edl->session->awindow_folder == AW_PROXY_FOLDER ? 1 : 0;
+ gui->collect_assets(proxy);
return 0;
}
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
while( seq_no >= images.size() ) {
+ mwindow->video_cache->check_in(asset);
+ Thread::yield();
+ file = mwindow->video_cache->check_out(asset, mwindow->edl, 0);
+ if( !file ) { usleep(1000); continue; }
file->set_layer(0);
int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
file->set_video_position(pos,0);
}
-void AWindowGUI::collect_assets()
+void AWindowGUI::collect_assets(int proxy)
{
mwindow->session->drag_assets->remove_all();
mwindow->session->drag_clips->remove_all();
int i = 0; AssetPicon *result;
while( (result = (AssetPicon*)asset_list->get_selection(0, i++)) != 0 ) {
Indexable *indexable = result->indexable;
- if( indexable && indexable->is_asset &&
+ if( proxy && indexable && indexable->is_asset &&
indexable->awindow_folder == AW_PROXY_FOLDER ) {
EDL *drag_edl = collect_proxy(indexable);
if( drag_edl ) mwindow->session->drag_clips->append(drag_edl);
+ continue;
}
if( indexable ) {
mwindow->session->drag_assets->append(indexable);
AssetPicon *picon = (AssetPicon*)src->values[i];
picon->sort_key = -1;
if( !visible && bin_folder ) {
- Indexable *idxbl = bin_folder->is_clips ? picon->edl : picon->indexable;
+ Indexable *idxbl = bin_folder->is_clips ? (Indexable *)picon->edl :
+ picon->indexable ? picon->indexable :
+ picon->edl ? picon->edl->get_proxy_asset() : 0;
if( idxbl ) {
picon->sort_key = mwindow->edl->folders.matches_indexable(folder, idxbl);
- if( picon->sort_key >= 0 ) visible = 1;
+ if( picon->sort_key < 0 ) continue;
+ visible = 1;
}
}
if( !visible && picon->indexable && picon->indexable->awindow_folder == folder )
break;
}
- BC_ListBox::deactivate_selection();
+ deactivate_selection();
}
- else if( gui->vicon_drawing &&
- get_button_down() && get_buttonpress() == 1 &&
- (item = (AssetPicon*)get_selection(0, 0)) ) {
+ else if( gui->vicon_drawing && get_button_down() && get_buttonpress() == 1 &&
+ ( mwindow->edl->session->awindow_folder == AW_MEDIA_FOLDER ||
+ mwindow->edl->session->awindow_folder >= AWINDOW_USER_FOLDERS ) &&
+ (item = (AssetPicon*)get_selection(0, 0)) != 0 ) {
VIcon *vicon = 0;
- if( !gui->vicon_thread->viewing ) {
+ if( !gui->vicon_thread->vicon ) {
vicon = item->vicon;
+ deactivate_selection();
}
gui->vicon_thread->set_view_popup(vicon);
-
}
return 1;
}
int AWindowAssets::drag_start_event()
{
int collect_pluginservers = 0;
- int collect_assets = 0;
+ int collect_assets = 0, proxy = 0;
if( BC_ListBox::drag_start_event() ) {
switch( mwindow->edl->session->awindow_folder ) {
case AW_LABEL_FOLDER:
// do nothing!
break;
+ case AW_PROXY_FOLDER:
+ proxy = 1; // fall thru
case AW_MEDIA_FOLDER:
default:
mwindow->session->current_operation = DRAG_ASSET;
}
if( collect_assets ) {
- gui->collect_assets();
+ gui->collect_assets(proxy);
}
return 1;
int AWindowAssets::focus_in_event()
{
+ int ret = BC_ListBox::focus_in_event();
gui->start_vicon_drawing();
- return 0;
+ return ret;
}
int AWindowAssets::focus_out_event()
return BC_ListBox::focus_out_event();
}
+int AWindowAssets::cursor_enter_event()
+{
+ int ret = BC_ListBox::cursor_enter_event();
+ gui->start_vicon_drawing();
+ return ret;
+}
+
+int AWindowAssets::cursor_leave_event()
+{
+ gui->stop_vicon_drawing();
+ return BC_ListBox::cursor_leave_event();
+}
+
void AWindowAssets::update_vicon_area()
{
int x0 = 0, x1 = get_w();
gui->vicon_thread->set_drawing_area(x0,y0, x1,y1);
}
+int AWindowAssets::mouse_over_event(int no)
+{
+ if( gui->vicon_thread->viewing &&
+ no >= 0 && no < gui->displayed_assets[0].size() ) {
+ AssetPicon *picon = (AssetPicon *)gui->displayed_assets[0][no];
+ VIcon *vicon = picon->vicon;
+ picon->gui->vicon_thread->set_view_popup(vicon);
+ }
+ return 0;
+}
+
+
AWindowSearchTextBox::AWindowSearchTextBox(AWindowSearchText *search_text, int x, int y, int w)
: BC_TextBox(x, y, w, 1, "")
{
int drag_motion();
int drag_stop();
// Collect items into the drag vectors of MainSession
- void collect_assets();
+ void collect_assets(int proxy=0);
EDL *collect_proxy(Indexable *indexable);
void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
int do_audio,
int column_resize_event();
int focus_in_event();
int focus_out_event();
+ int cursor_enter_event();
+ int cursor_leave_event();
void update_vicon_area();
+ int mouse_over_event(int no);
MWindow *mwindow;
AWindowGUI *gui;
struct tm ttm; memset(&ttm, 0, sizeof(ttm));
ttm.tm_year = year-1900; ttm.tm_mon = mon-1; ttm.tm_mday = day;
ttm.tm_hour = hour; ttm.tm_min = min; ttm.tm_sec = secs;
- ttm.tm_wday = ttm.tm_yday = 0; ttm.tm_isdst = daylight; /* tzset in main */
time_t t = mktime(&ttm);
return (int64_t)t;
}
double BinFolderOp::around(double v, double a)
{
- if( type != FOLDER_OP_AROUND || a <= 0 ) return v;
- if( (v=fabs(v)) > a ) return -1;
- return v / a;
+ if( type != FOLDER_OP_AROUND ) return v;
+ v = fabs(v);
+ return a>0 ? v/a : v;
}
// string theory: Feynman, Einstein and Schrodinger string compare
if(mwindow->session->drag_assets->total ||
mwindow->session->drag_clips->total)
{
- mwindow->gui->lock_window("CWindowGUI::drag_stop 5");
+ mwindow->gui->lock_window("CWindowGUI::drag_stop 1");
mwindow->undo->update_undo_before(_("insert assets"), 0);
- mwindow->gui->unlock_window();
}
if(mwindow->session->drag_assets->total)
{
- mwindow->gui->lock_window("CWindowGUI::drag_stop 1");
mwindow->clear(0);
mwindow->load_assets(mwindow->session->drag_assets,
mwindow->edl->local_session->get_selectionstart(),
if(mwindow->session->drag_clips->total)
{
- mwindow->gui->lock_window("CWindowGUI::drag_stop 2");
mwindow->clear(0);
mwindow->paste_edls(mwindow->session->drag_clips,
LOADMODE_PASTE,
mwindow->gui->update(1, 1, 1, 1, 0, 1, 0);
mwindow->undo->update_undo_after(_("insert assets"), LOAD_ALL);
mwindow->gui->unlock_window();
- mwindow->sync_parameters(LOAD_ALL);
+ mwindow->sync_parameters(CHANGE_ALL);
}
}
}
}
+Asset *EDL::get_proxy_asset()
+{
+ return awindow_folder == AW_PROXY_FOLDER ?
+ tracks->first->edits->first->asset : 0;
+}
+
double EDL::get_cursor_position(int cursor_x, int pane_no)
{
return (double)cursor_x * local_session->zoom_sample / session->sample_rate +
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
void add_proxy(int use_scaler,
ArrayList<Indexable*> *orig_assets, ArrayList<Indexable*> *proxy_assets);
+ Asset *get_proxy_asset();
// Titles of all subfolders
BinFolders folders;
mwindow->gui->lock_window("ProxyPopup::paste_assets");
mwindow->cwindow->gui->lock_window("ProxyPopup::paste_assets");
- gui->collect_assets();
+ gui->collect_assets(1);
mwindow->paste_assets(mwindow->edl->local_session->get_selectionstart(1),
mwindow->edl->tracks->first, 0); // do not overwrite
int ProxyPopup::update()
{
format->update();
- gui->collect_assets();
+ gui->collect_assets(1);
return 0;
}
if( output ) {
output->lock_canvas("VDeviceX11::close_all 1");
output->get_canvas()->lock_window("VDeviceX11::close_all 1");
+ int video_on = output->get_canvas()->get_video_on();
// Update the status bug
if( !device->single_frame ) {
output->stop_video();
else {
output->stop_single();
}
- }
-
- if( output && output_frame ) {
- output->update_refresh(device, output_frame);
+ if( output_frame ) {
+ output->update_refresh(device, output_frame);
// if the last frame is good, don't draw over it
- if( output->need_overlays() )
- output->draw_refresh(1);
+ if( !video_on || output->need_overlays() )
+ output->draw_refresh(1);
+ }
}
delete bitmap; bitmap = 0;
output->get_canvas()->lock_window("VDeviceX11::write_buffer 2");
}
}
- else
- if( bitmap->hardware_scaling() ) {
- output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
- (int)canvas_x1, (int)canvas_y1,
- (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
- (int)output_x1, (int)output_y1,
- (int)(output_x2 - output_x1), (int)(output_y2 - output_y1),
- 0);
- }
else {
+ if( bitmap->hardware_scaling() ) {
+ output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
+ (int)canvas_x1, (int)canvas_y1,
+ (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
+ (int)output_x1, (int)output_y1,
+ (int)(output_x2 - output_x1), (int)(output_y2 - output_y1),
+ 0);
+ }
+ else {
//printf("VDeviceX11::write_buffer %d x=%d y=%d w=%d h=%d\n",
// __LINE__, (int)canvas_x1, (int)canvas_y1,
// output->get_canvas()->get_w(), output->get_canvas()->get_h());
-
- output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
- (int)canvas_x1, (int)canvas_y1,
- (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
- 0, 0,
- (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
- 0);
+ output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
+ (int)canvas_x1, (int)canvas_y1,
+ (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
+ 0, 0,
+ (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
+ 0);
//printf("VDeviceX11::write_buffer %d bitmap=%p\n", __LINE__, bitmap);
+ }
+ if( !output->get_canvas()->get_video_on() )
+ output->get_canvas()->flash(0);
}
output->get_canvas()->unlock_window();
unlock_window();
Indexable *indexable =
- mwindow->session->drag_clips->size() > 0 ?
- (Indexable *)mwindow->session->drag_clips->get(0) :
mwindow->session->drag_assets->size() > 0 ?
- (Indexable *)mwindow->session->drag_assets->get(0) : 0;
+ (Indexable *)mwindow->session->drag_assets->get(0) :
+ mwindow->session->drag_clips->size() > 0 ?
+ (Indexable *)mwindow->session->drag_clips->get(0) : 0;
if( indexable )
vwindow->change_source(indexable);
}
}
+int VWindowCanvas::need_overlays()
+{
+ if( gui->highlighted ) return 1;
+ return 0;
+}
+
void VWindowCanvas::draw_overlays()
{
if( gui->highlighted )
void zoom_resize_window(float percentage);
void draw_refresh(int flush = 1);
+ int need_overlays();
void draw_overlays();
void close_source();
int get_fullscreen();
// Moved out of item area
if( old_highlighted_item != highlighted_item ) {
- redraw_items = 1;
+ if( !mouse_over_event(highlighted_item) )
+ redraw_items = 1;
}
//printf("BC_ListBox::cursor_motion_event 1 %d\n", highlighted_item);
virtual int sort_order_event() { return 0; };
// Column moved
virtual int move_column_event() { return 0; };
+// item highlight changed
+ virtual int mouse_over_event(int no) { return 0; }
int enable();
int disable();
break;
case LeaveNotify:
+ if( event->xcrossing.mode != NotifyNormal ) break;
if( cursor_entered && event->xcrossing.window == win ) {
cursor_entered = 0;
}
break;
case EnterNotify:
+ if( event->xcrossing.mode != NotifyNormal ) break;
if( !cursor_entered && event->xcrossing.window == win ) {
if( !event->xcrossing.focus && get_resources()->grab_input_focus ) {
XSetInputFocus(display, win, RevertToParent, CurrentTime);
return 1;
}
-int ViewPopup::button_press_event()
-{
- vt->set_view_popup(0);
- return 1;
-}
-
bool VIconThread::
visible(VIcon *vicon, int x, int y)
{
int key = get_keypress();
return vt->keypress_event(key);
}
+
ViewPopup::ViewPopup(VIconThread *vt, VFrame *frame, int x, int y, int w, int h)
: BC_Popup(vt->wdw, x, y, w, h, BLACK)
{
void VIconThread::set_view_popup(VIcon *vicon)
{
- if( !vicon && this->vicon )
- this->vicon->stop_audio();
this->vicon = vicon;
}
int VIconThread::
update_view()
{
+ if( viewing ) viewing->stop_audio();
delete view_win; view_win = 0;
if( (viewing=vicon) != 0 ) {
VFrame *frame = viewing->frame();
public:
VIconThread *vt;
int keypress_event();
- int button_press_event();
void draw_vframe(VFrame *frame);
ViewPopup(VIconThread *vt, VFrame *frame, int x, int y, int w, int h);