+
+
+AssetVIcon::AssetVIcon(AssetPicon *picon, int w, int h, double framerate, int64_t length)
+ : VIcon(w, h, framerate)
+{
+ this->picon = picon;
+ this->length = length;
+}
+
+AssetVIcon::~AssetVIcon()
+{
+}
+
+VFrame *AssetVIcon::frame()
+{
+ if( seq_no >= images.size() ) {
+ MWindow *mwindow = picon->mwindow;
+ Asset *asset = (Asset *)picon->indexable;
+ File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
+ if( !file ) return 0;
+ 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();
+ while( seq_no >= images.size() ) {
+ file->read_frame(&frame);
+ add_image(&frame, ww, hh, cmdl);
+ }
+ mwindow->video_cache->check_in(asset);
+ }
+ return images[seq_no];
+}
+
+int64_t AssetVIcon::next_frame(int n)
+{
+ age += n * period;
+ if( (seq_no+=n) >= length ) seq_no = 0;
+ return seq_no;
+}
+
+int AssetVIcon::get_vx()
+{
+ BC_ListBox *lbox = picon->gui->asset_list;
+ return lbox->get_item_x(picon);
+}
+int AssetVIcon::get_vy()
+{
+ BC_ListBox *lbox = picon->gui->asset_list;
+ return lbox->get_item_y(picon) + lbox->get_title_h();
+}
+