Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vedit.C

Go to the documentation of this file.
00001 #include "asset.h"
00002 #include "cache.h"
00003 #include "edl.h"
00004 #include "edlsession.h"
00005 #include "file.h"
00006 #include "mwindow.h"
00007 #include "patch.h"
00008 #include "preferences.h"
00009 #include "mainsession.h"
00010 #include "trackcanvas.h"
00011 #include "tracks.h"
00012 #include "transportque.h"
00013 #include "units.h"
00014 #include "vedit.h"
00015 #include "vedits.h"
00016 #include "vframe.h"
00017 #include "vtrack.h"
00018 
00019 VEdit::VEdit(EDL *edl, Edits *edits)
00020  : Edit(edl, edits)
00021 {
00022 }
00023 
00024 
00025 VEdit::~VEdit() { }
00026 
00027 int VEdit::load_properties_derived(FileXML *xml)
00028 {
00029         channel = xml->tag.get_property("CHANNEL", (int64_t)0);
00030         return 0;
00031 }
00032 
00033 
00034 
00035 
00036 
00037 // ================================================== editing
00038 
00039 
00040 
00041 int VEdit::read_frame(VFrame *video_out, 
00042         int64_t input_position, 
00043         int direction,
00044         CICache *cache,
00045         int use_nudge,
00046         int use_cache)
00047 {
00048         File *file = cache->check_out(asset);
00049         int result = 0;
00050         if(use_nudge) input_position += track->nudge;
00051 
00052         if(file)
00053         {
00054 
00055                 input_position = (direction == PLAY_FORWARD) ? input_position : (input_position - 1);
00056 
00057                 file->set_layer(channel);
00058 
00059                 file->set_video_position(input_position - startproject + startsource, edl->session->frame_rate);
00060 
00061                 file->set_cache_frames(use_cache);
00062                 result = file->read_frame(video_out);
00063                 file->set_cache_frames(0);
00064 
00065                 cache->check_in(asset);
00066         }
00067         else
00068                 result = 1;
00069         
00070 //for(int i = 0; i < video_out->get_w() * 3 * 20; i++) video_out->get_rows()[0][i] = 128;
00071         return result;
00072 }
00073 
00074 int VEdit::copy_properties_derived(FileXML *xml, int64_t length_in_selection)
00075 {
00076         return 0;
00077 }
00078 
00079 int VEdit::dump_derived()
00080 {
00081         printf("        VEdit::dump_derived\n");
00082         printf("                startproject %ld\n", startproject);
00083         printf("                length %ld\n", length);
00084 }
00085 
00086 int64_t VEdit::get_source_end(int64_t default_)
00087 {
00088         if(!asset) return default_;   // Infinity
00089 
00090         return (int64_t)((double)asset->video_length / asset->frame_rate * edl->session->frame_rate + 0.5);
00091 }

Generated on Sun Jan 8 13:39:02 2006 for Cinelerra-svn by  doxygen 1.4.4