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

virtualvconsole.C

Go to the documentation of this file.
00001 #include "bcsignals.h"
00002 #include "datatype.h"
00003 #include "edl.h"
00004 #include "edlsession.h"
00005 #include "mwindow.h"
00006 #include "playabletracks.h"
00007 #include "preferences.h"
00008 #include "renderengine.h"
00009 #include "tracks.h"
00010 #include "transportque.h"
00011 #include "vframe.h"
00012 #include "videodevice.h"
00013 #include "virtualvconsole.h"
00014 #include "virtualvnode.h"
00015 #include "vmodule.h"
00016 #include "vrender.h"
00017 #include "vtrack.h"
00018 
00019 VirtualVConsole::VirtualVConsole(RenderEngine *renderengine, VRender *vrender)
00020  : VirtualConsole(renderengine, vrender, TRACK_VIDEO)
00021 {
00022         this->vrender = vrender;
00023         output_temp = 0;
00024 }
00025 
00026 VirtualVConsole::~VirtualVConsole()
00027 {
00028         if(output_temp) delete output_temp;
00029 }
00030 
00031 void VirtualVConsole::get_playable_tracks()
00032 {
00033         if(!playable_tracks)
00034                 playable_tracks = new PlayableTracks(renderengine, 
00035                         commonrender->current_position, 
00036                         TRACK_VIDEO,
00037                         1);
00038 }
00039 
00040 VirtualNode* VirtualVConsole::new_entry_node(Track *track, 
00041         Module *module,
00042         int track_number)
00043 {
00044         return new VirtualVNode(renderengine, 
00045                 this, 
00046                 module,
00047                 0,
00048                 track,
00049                 0);
00050 }
00051 
00052 // start of buffer in project if forward / end of buffer if reverse
00053 int VirtualVConsole::process_buffer(int64_t input_position)
00054 {
00055         int i, j, k;
00056         int result = 0;
00057 
00058 
00059 
00060 SET_TRACE
00061 
00062 
00063         if(debug_tree) printf("VirtualVConsole::process_buffer begin\n");
00064 // clear output buffers
00065         for(i = 0; i < MAX_CHANNELS; i++)
00066         {
00067                 if(vrender->video_out[i])
00068                         vrender->video_out[i]->clear_frame();
00069         }
00070 
00071 SET_TRACE
00072 
00073 // Reset plugin rendering status
00074         reset_attachments();
00075 SET_TRACE
00076 
00077 // Render exit nodes from bottom to top
00078         for(int i = exit_nodes.total - 1; i >= 0; i--)
00079         {
00080                 VirtualVNode *node = (VirtualVNode*)exit_nodes.values[i];
00081                 Track *track = node->track;
00082 
00083 // Create temporary output to match the track size, which is acceptable since
00084 // most projects don't have variable track sizes.
00085                 if(output_temp && 
00086                         (output_temp->get_w() != track->track_w ||
00087                         output_temp->get_h() != track->track_h))
00088                 {
00089                         delete output_temp;
00090                         output_temp = 0;
00091                 }
00092 
00093                 if(!output_temp)
00094                 {
00095                         output_temp = new VFrame(0, 
00096                                 track->track_w, 
00097                                 track->track_h, 
00098                                 renderengine->edl->session->color_model,
00099                                 -1);
00100                 }
00101 
00102 //printf("VirtualVConsole::process_buffer %p\n", output_temp->get_rows());
00103                 result |= node->render(output_temp,
00104                         input_position + track->nudge,
00105                         renderengine->edl->session->frame_rate);
00106         }
00107 SET_TRACE
00108 
00109         if(debug_tree) printf("VirtualVConsole::process_buffer end\n");
00110         return result;
00111 }
00112 

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