00001 #ifndef COMMONRENDER_H 00002 #define COMMONRENDER_H 00003 00004 #include "cache.inc" 00005 #include "condition.inc" 00006 #include "virtualconsole.inc" 00007 #include "module.inc" 00008 #include "mwindow.inc" 00009 #include "renderengine.inc" 00010 #include "thread.h" 00011 #include "track.inc" 00012 00013 #include <stdint.h> 00014 00015 class CommonRender : public Thread 00016 { 00017 public: 00018 CommonRender(RenderEngine *renderengine); 00019 virtual ~CommonRender(); 00020 00021 virtual void arm_command(); 00022 virtual int get_total_tracks() { return 0; }; 00023 virtual Module* new_module(Track *track) { return 0; }; 00024 void delete_vconsole(); 00025 void create_modules(); 00026 void reset_parameters(); 00027 // Build the virtual console at the current position 00028 virtual void build_virtual_console(); 00029 virtual VirtualConsole* new_vconsole_object() { return 0; }; 00030 virtual void init_output_buffers() {}; 00031 void start_plugins(); 00032 int test_reconfigure(int64_t position, int64_t &length); 00033 00034 void evaluate_current_position(); 00035 void start_command(); 00036 virtual int restart_playback(); 00037 virtual void run(); 00038 00039 RenderEngine *renderengine; 00040 // Virtual console 00041 VirtualConsole *vconsole; 00042 // Native units position in project used for all functions 00043 int64_t current_position; 00044 Condition *start_lock; 00045 // flag for normally completed playback 00046 int done; 00047 // Flag for interrupted playback 00048 int interrupt; 00049 // flag for last buffer to be played back 00050 int last_playback; 00051 // if this media type is being rendered asynchronously by threads 00052 int asynchronous; 00053 // Module for every track to dispatch plugins in whether the track is 00054 // playable or not. 00055 // Maintain module structures here instead of reusing the EDL so 00056 // plugins persist if the EDL is replaced. 00057 // Modules can persist after vconsole is restarted. 00058 int total_modules; 00059 Module **modules; 00060 int data_type; 00061 // If a VirtualConsole was created need to start plugins 00062 int restart_plugins; 00063 00064 00065 00066 00067 00068 00069 00070 00071 CommonRender(MWindow *mwindow, RenderEngine *renderengine); 00072 00073 // clean up rendering 00074 int virtual stop_rendering() {}; 00075 int wait_for_completion(); 00076 virtual int wait_device_completion() {}; 00077 // renders to a device when there's a device 00078 virtual int process_buffer(int64_t input_len, int64_t input_position) {}; 00079 00080 virtual int get_datatype() {}; 00081 // test region against loop boundaries 00082 int get_boundaries(int64_t ¤t_render_length); 00083 // test region for playback automation changes 00084 int get_automation(int64_t ¤t_render_length, int data_type); 00085 // advance the buffer position depending on the loop status 00086 int advance_position(int64_t current_render_length); 00087 00088 // convert to and from the native units of the render engine 00089 virtual int64_t tounits(double position, int round); 00090 virtual double fromunits(int64_t position); 00091 virtual int64_t get_render_length(int64_t current_render_length) {}; 00092 00093 MWindow *mwindow; 00094 00095 int64_t input_length; // frames/samples to read from disk at a time 00096 00097 protected: 00098 // make sure automation agrees with playable tracks 00099 // automatically tests direction of playback 00100 // return 1 if it doesn't 00101 int test_automation_before(int64_t ¤t_render_length, int data_type); 00102 int test_automation_after(int64_t ¤t_render_length, int data_type); 00103 }; 00104 00105 00106 #endif
1.4.4