update thirdparty
[goodguy/history.git] / cinelerra-5.0 / cinelerra / awindowgui.C
index f340bb0e207f92b6b0bdbf2de80ee7a07af74293..3e4c383b9f5095abe32d6a829220dc8aa2e772b1 100644 (file)
@@ -90,11 +90,12 @@ VFrame *AssetVIcon::frame()
                }
                if( !temp )
                        temp = new VFrame(asset->width, asset->height, BC_RGB888);
-               file->set_layer(0);
-               file->set_video_position(images.size(),0);
                int ww = picon->gui->vicon_thread->view_w;
                int hh = picon->gui->vicon_thread->view_h;
                while( seq_no >= images.size() ) {
+                       file->set_layer(0);
+                       int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
+                       file->set_video_position(pos,0);
                        file->read_frame(temp);
                        add_image(temp, ww, hh, BC_RGB8);
                }
@@ -103,11 +104,10 @@ VFrame *AssetVIcon::frame()
        return *images[seq_no];
 }
 
-int64_t AssetVIcon::next_frame(int n)
+int64_t AssetVIcon::set_seq_no(int64_t no)
 {
-       age += n * period;
-       if( (seq_no+=n) >= length ) seq_no = 0;
-       return seq_no;
+       if( no >= length ) no = 0;
+       return seq_no = no;
 }
 
 int AssetVIcon::get_vx()
@@ -201,7 +201,7 @@ void AssetPicon::create_objects()
        int pixmap_w, pixmap_h;
        const int debug = 0;
 
-       pixmap_h = 50;
+       pixmap_h = 50 * BC_WindowBase::get_resources()->icon_scale;
 
        if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
        if(indexable)
@@ -262,10 +262,11 @@ void AssetPicon::create_objects()
                                        icon_vframe->transfer_from(gui->temp_picon);
 // vicon images
                                        double framerate = asset->get_frame_rate();
-                                       if( !framerate ) framerate = 24;
-                                       int64_t length = framerate * 5;
-                                       int64_t vframes = asset->get_video_frames();
-                                       if( length > vframes ) length = vframes;
+                                       if( !framerate ) framerate = VICON_RATE;
+                                       int64_t frames = asset->get_video_frames();
+                                       double secs = frames / framerate;
+                                       if( secs > 5 ) secs = 5;
+                                       int64_t length = secs * gui->vicon_thread->refresh_rate;
                                        vicon = new AssetVIcon(this, pixmap_w, pixmap_h, framerate, length);
                                        gui->vicon_thread->add_vicon(vicon);
                                        if(debug) printf("AssetPicon::create_objects %d\n", __LINE__);
@@ -495,11 +496,11 @@ SET_TRACE
        vtransition_icon = new BC_Pixmap(this, vtransition_vframe, PIXMAP_ALPHA);
        aeffect_vframe = mwindow->theme->get_image("aeffect_icon");
        aeffect_icon = new BC_Pixmap(this, aeffect_vframe, PIXMAP_ALPHA);
-       ladspa_vframe = new VFrame(lad_picon_png);
+       ladspa_vframe = new VFramePng(lad_picon_png);
        ladspa_icon = new BC_Pixmap(this, ladspa_vframe, PIXMAP_ALPHA);
-       ff_aud_vframe = new VFrame(ff_audio_png);
+       ff_aud_vframe = new VFramePng(ff_audio_png);
        ff_aud_icon = new BC_Pixmap(this, ff_aud_vframe, PIXMAP_ALPHA);
-       ff_vid_vframe = new VFrame(ff_video_png);
+       ff_vid_vframe = new VFramePng(ff_video_png);
        ff_vid_icon = new BC_Pixmap(this, ff_vid_vframe, PIXMAP_ALPHA);
        veffect_vframe = mwindow->theme->get_image("veffect_icon");
        veffect_icon = new BC_Pixmap(this, veffect_vframe, PIXMAP_ALPHA);