00001 #ifndef RENDERENGINE_H
00002 #define RENDERENGINE_H
00003
00004
00005 class RenderEngine;
00006
00007 #include "arender.inc"
00008 #include "audiodevice.inc"
00009 #include "cache.inc"
00010 #include "canvas.inc"
00011 #include "channel.inc"
00012 #include "channeldb.inc"
00013 #include "condition.inc"
00014 #include "mutex.inc"
00015 #include "mwindow.inc"
00016 #include "playbackengine.inc"
00017 #include "pluginserver.inc"
00018 #include "preferences.inc"
00019 #include "thread.h"
00020 #include "transportque.inc"
00021 #include "videodevice.inc"
00022 #include "vrender.inc"
00023
00024 class RenderEngine : public Thread
00025 {
00026 public:
00027 RenderEngine(PlaybackEngine *playback_engine,
00028 Preferences *preferences,
00029 TransportCommand *command,
00030 Canvas *output,
00031 ArrayList<PluginServer*> *plugindb,
00032 ChannelDB *channeldb);
00033 ~RenderEngine();
00034
00035 void get_duty();
00036 void create_render_threads();
00037 void arm_render_threads();
00038 void start_render_threads();
00039 void wait_render_threads();
00040 void interrupt_playback();
00041 int get_output_w();
00042 int get_output_h();
00043 int brender_available(int position, int direction);
00044
00045 Channel* get_current_channel();
00046 double get_tracking_position();
00047
00048 PluginServer* scan_plugindb(char *title,
00049 int data_type);
00050 CICache* get_acache();
00051 CICache* get_vcache();
00052 void set_acache(CICache *cache);
00053 void set_vcache(CICache *cache);
00054
00055 void get_output_levels(double *levels, int64_t position);
00056 void get_module_levels(ArrayList<double> *module_levels, int64_t position);
00057
00058 void run();
00059
00060 int arm_command(TransportCommand *command,
00061 int ¤t_vchannel,
00062 int ¤t_achannel);
00063
00064 int start_command();
00065
00066 int open_output();
00067 int close_output();
00068
00069 int64_t sync_position();
00070
00071 void reset_sync_position();
00072
00073 int64_t session_position();
00074
00075
00076 void update_framerate(float framerate);
00077
00078
00079 TransportCommand *command;
00080
00081 EDL *edl;
00082
00083 PlaybackConfig *config;
00084
00085 PlaybackEngine *playback_engine;
00086
00087 Preferences *preferences;
00088
00089 Canvas *output;
00090
00091
00092
00093 Condition *input_lock;
00094
00095 Condition *start_lock;
00096 Condition *output_lock;
00097
00098 Condition *first_frame_lock;
00099
00100 Mutex *interrupt_lock;
00101
00102
00103 int show_tc;
00104
00105 int done;
00106 AudioDevice *audio;
00107 VideoDevice *video;
00108 ARender *arender;
00109 VRender *vrender;
00110 int do_audio;
00111 int do_video;
00112
00113 Timer timer;
00114 float actual_frame_rate;
00115
00116 int interrupted;
00117
00118 ArrayList<PluginServer*> *plugindb;
00119
00120 ChannelDB *channeldb;
00121
00122
00123 int64_t fragment_len;
00124
00125 int64_t adjusted_fragment_len;
00126
00127 CICache *audio_cache, *video_cache;
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 RenderEngine(MWindow *mwindow,
00147 AudioDevice *audio = 0,
00148 VideoDevice *video = 0,
00149 PlaybackEngine *playbackengine = 0);
00150
00151
00152 int reset_parameters();
00153
00154 int arm_playback_audio(int64_t input_length,
00155 int64_t amodule_render_fragment,
00156 int64_t playback_buffer,
00157 int64_t output_length);
00158
00159 int arm_playback_video(int every_frame,
00160 int64_t read_length,
00161 int64_t output_length,
00162 int track_w,
00163 int track_h,
00164 int output_w,
00165 int output_h);
00166
00167 int64_t get_correction_factor(int reset);
00168
00169
00170 int start_video();
00171
00172
00173
00174 int follow_loop;
00175 int infinite;
00176
00177 int64_t start_position;
00178 int64_t end_position;
00179 int64_t current_sample;
00180 int every_frame;
00181
00182 MWindow *mwindow;
00183 };
00184
00185
00186
00187
00188
00189
00190
00191
00192 #endif