VFrame frame(asset->width, asset->height, BC_RGB888);
file->set_layer(0);
file->set_video_position(images.size(),0);
- VFrame *vfrm0 = images[0];
- int ww = vfrm0->get_w(), hh = vfrm0->get_h();
- int cmdl = vfrm0->get_color_model();
+ int ww = picon->gui->vicon_thread->view_w;
+ int hh = picon->gui->vicon_thread->view_h;
while( seq_no >= images.size() ) {
file->read_frame(&frame);
- add_image(&frame, ww, hh, cmdl);
+ add_image(&frame, ww, hh, BC_RGB8);
}
mwindow->video_cache->check_in(asset);
}
int64_t vframes = asset->get_video_frames();
if( length > vframes ) length = vframes;
vicon = new AssetVIcon(this, pixmap_w, pixmap_h, framerate, length);
- int ww = gui->vicon_thread->view_w, hh = gui->vicon_thread->view_h;
- vicon->add_image(gui->temp_picon, ww, hh, BC_RGB8);
gui->vicon_thread->add_vicon(vicon);
if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
BC_ListBox::deactivate_selection();
return 1;
}
- else if(get_button_down() && get_buttonpress() == 1 && get_selection(0, 0)) {
- AssetPicon *picon = (AssetPicon*)get_selection(0, 0);
- gui->vicon_thread->set_view_popup(picon->vicon);
+ else if( get_button_down() && get_buttonpress() == 1 && get_selection(0, 0) ) {
+ VIcon *vicon = 0;
+ if( !gui->vicon_thread->viewing ) {
+ AssetPicon *picon = (AssetPicon*)get_selection(0, 0);
+ vicon = picon->vicon;
+ }
+ gui->vicon_thread->set_view_popup(vicon);
+
}
return 0;
}
{
this->wdw = wdw;
this->view_win = 0; this->vicon = 0;
- this->cur_view = 0; this->new_view = 0;
this->view_w = vw; this->view_h = vh;
this->viewing = 0; this->draw_flash = 0;
draw_lock = new Condition(0, "VIconThread::draw_lock", 1);
void VIconThread::
start_drawing()
{
- wdw->lock_window("VIconThread::stop_drawing");
+ wdw->lock_window("VIconThread::start_drawing");
if( interrupted )
draw_lock->unlock();
wdw->unlock_window();
int VIconThread::keypress_event(int key)
{
- if( !cur_view ) return 0;
if( key != ESC ) return 0;
set_view_popup(0);
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);
}
-int ViewPopup::button_press_event()
-{
- return vt->keypress_event(ESC);
-}
-
ViewPopup::ViewPopup(VIconThread *vt, VFrame *frame, int x, int y, int w, int h)
: BC_Popup(vt->wdw, x, y, w, h, BLACK)
{
int VIconThread::
update_view()
{
- if( viewing == vicon && cur_view == new_view ) return 0;
- wdw->lock_window("VIconThread::update_view");;
- if( viewing && !vicon ) new_view = 0;
- if( !viewing && vicon ) new_view = 1;
- if( cur_view != new_view && !new_view ) vicon = 0;
- viewing = vicon; cur_view = new_view;
delete view_win; view_win = 0;
- if( cur_view ) {
+ if( (viewing=vicon) != 0 ) {
VFrame *frame = viewing->frame();
view_win = new_view_window(frame);
view_win->show_window();
- }
- wdw->unlock_window();
+ }
return 1;
}
interrupted = 0;
drawing_started();
while( !interrupted ) {
- if( viewing != vicon || cur_view != new_view )
+ if( viewing != vicon )
update_view();
VIcon *next = low_vicon();
if( !next ) break;
ViewPopup *view_win;
VIcon *viewing, *vicon;
int view_w, view_h;
- int cur_view, new_view;
int img_dirty, win_dirty;
int64_t draw_flash;