void VIcon::
draw_vframe(VIconThread *vt, BC_WindowBase *wdw, int x, int y)
{
+ VFrame *vfrm = frame();
+ if( !vfrm ) return;
int sx0 = 0, sx1 = sx0 + vt->view_w;
int sy0 = 0, sy1 = sy0 + vt->view_h;
int dx0 = x, dx1 = dx0 + vw;
int sw = sx1 - sx0, sh = sy1 - sy0;
int dw = dx1 - dx0, dh = dy1 - dy0;
if( dw > 0 && dh > 0 && sw > 0 && sh > 0 )
- wdw->draw_vframe(frame(), dx0,dy0, dw,dh, sx0,sy0, sw,sh);
+ wdw->draw_vframe(vfrm, dx0,dy0, dw,dh, sx0,sy0, sw,sh);
}
void VIconThread::
this->refresh_rate = VICON_RATE;
done = 0;
interrupted = -1;
+ stop_age = 0;
}
VIconThread::
wdw->set_active_subwindow(view_win);
if( interrupted < 0 )
draw_lock->unlock();
+ timer->update();
+ timer->subtract(-stop_age);
interrupted = 0;
wdw->unlock_window();
}
set_view_popup(0);
if( !interrupted )
interrupted = 1;
+ stop_age = timer->get_difference();
wdw->unlock_window();
}
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 ViewPopup::draw_vframe(VFrame *frame)
{
+ if( !frame ) return;
BC_WindowBase::draw_vframe(frame, 0,0, get_w(),get_h());
}
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();
return 1;
}
+void VIconThread::hide_vicons(int v)
+{
+ for( int i=0; i<t_heap.size(); ++i ) {
+ t_heap[i]->hidden = v;
+ t_heap[i]->age = 0;
+ }
+}
+
void VIconThread::
run()
{