2 #include "bezierauto.h"
3 #include "bezierautos.h"
6 #include "edlsession.h"
10 #include "preferences.h"
11 #include "mainsession.h"
12 #include "trackcanvas.h"
14 #include "transportque.h"
21 VEdit::VEdit(EDL *edl, Edits *edits)
29 int VEdit::load_properties_derived(FileXML *xml)
31 channel = xml->tag.get_property("CHANNEL", (int64_t)0);
39 // ================================================== editing
43 int VEdit::read_frame(VFrame *video_out,
44 int64_t input_position,
48 //printf("VEdit::read_frame 1 %f %d %p %p %s\n", asset->frame_rate, asset->video_length, cache, asset, asset->path);
49 File *file = cache->check_out(asset);
52 //printf("VEdit::read_frame 2\n");
56 //printf("VEdit::read_frame 3\n");
57 input_position = (direction == PLAY_FORWARD) ? input_position : (input_position - 1);
59 //printf("VEdit::read_frame 4\n");
60 file->set_layer(channel);
62 //printf("VEdit::read_frame 5\n");
63 file->set_video_position(input_position - startproject + startsource, edl->session->frame_rate);
65 //printf("VEdit::read_frame 6 channel: %d w: %d h: %d video_out: %p\n", channel, asset->width, asset->height, video_out);
67 result = file->read_frame(video_out);
69 //printf("VEdit::read_frame 7 %d\n", video_out->get_compressed_size());
70 cache->check_in(asset);
72 //printf("VEdit::read_frame 8\n");
77 //for(int i = 0; i < video_out->get_w() * 3 * 20; i++) video_out->get_rows()[0][i] = 128;
81 int VEdit::copy_properties_derived(FileXML *xml, int64_t length_in_selection)
86 int VEdit::dump_derived()
88 printf(" VEdit::dump_derived\n");
89 printf(" startproject %ld\n", startproject);
90 printf(" length %ld\n", length);
93 int64_t VEdit::get_source_end(int64_t default_)
95 if(!asset) return default_; // Infinity
97 return (int64_t)((double)asset->video_length / asset->frame_rate * edl->session->frame_rate + 0.5);