5 #include "edlsession.h"
9 #include "preferences.h"
10 #include "mainsession.h"
11 #include "trackcanvas.h"
13 #include "transportque.h"
20 VEdit::VEdit(EDL *edl, Edits *edits)
28 int VEdit::load_properties_derived(FileXML *xml)
30 channel = xml->tag.get_property("CHANNEL", (int64_t)0);
38 // ================================================== editing
42 int VEdit::read_frame(VFrame *video_out,
43 int64_t input_position,
50 File *file = cache->check_out(asset,
53 if(use_nudge) input_position += track->nudge;
58 input_position = (direction == PLAY_FORWARD) ? input_position : (input_position - 1);
61 file->start_video_decode_thread();
63 file->stop_video_thread();
65 file->set_layer(channel);
66 file->set_video_position(input_position - startproject + startsource, edl->session->frame_rate);
67 if(use_cache) file->set_cache_frames(use_cache);
68 result = file->read_frame(video_out);
69 if(use_cache) file->set_cache_frames(0);
71 cache->check_in(asset);
76 //for(int i = 0; i < video_out->get_w() * 3 * 20; i++) video_out->get_rows()[0][i] = 128;
80 int VEdit::copy_properties_derived(FileXML *xml, int64_t length_in_selection)
85 int VEdit::dump_derived()
87 printf(" VEdit::dump_derived\n");
88 printf(" startproject %ld\n", startproject);
89 printf(" length %ld\n", length);
92 int64_t VEdit::get_source_end(int64_t default_)
94 if(!asset) return default_; // Infinity
96 return (int64_t)((double)asset->video_length / asset->frame_rate * edl->session->frame_rate + 0.5);