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 int total_playable_channels();
00036
00037 int playable_channel_number(int number);
00038 void get_duty();
00039 void create_render_threads();
00040 void arm_render_threads();
00041 void start_render_threads();
00042 void wait_render_threads();
00043 void interrupt_playback();
00044 int get_output_w();
00045 int get_output_h();
00046 int brender_available(int position, int direction);
00047
00048 Channel* get_current_channel();
00049 double get_tracking_position();
00050
00051 PluginServer* scan_plugindb(char *title,
00052 int data_type);
00053 CICache* get_acache();
00054 CICache* get_vcache();
00055 void set_acache(CICache *cache);
00056 void set_vcache(CICache *cache);
00057
00058 void get_output_levels(double *levels, int64_t position);
00059 void get_module_levels(ArrayList<double> *module_levels, int64_t position);
00060
00061 void run();
00062
00063 int arm_command(TransportCommand *command,
00064 int ¤t_vchannel,
00065 int ¤t_achannel);
00066
00067 int start_command();
00068
00069 int open_output();
00070 int close_output();
00071
00072 int64_t sync_position();
00073
00074 void reset_sync_position();
00075
00076 int64_t session_position();
00077
00078
00079 void update_framerate(float framerate);
00080
00081
00082 TransportCommand *command;
00083
00084 EDL *edl;
00085
00086 PlaybackConfig *config;
00087
00088 PlaybackEngine *playback_engine;
00089
00090 Preferences *preferences;
00091
00092 Canvas *output;
00093
00094
00095
00096 Condition *input_lock;
00097
00098 Condition *start_lock;
00099 Condition *output_lock;
00100
00101 Condition *first_frame_lock;
00102
00103 Mutex *interrupt_lock;
00104
00105
00106 int show_tc;
00107
00108 int done;
00109 AudioDevice *audio;
00110 VideoDevice *video;
00111 ARender *arender;
00112 VRender *vrender;
00113 int do_audio;
00114 int do_video;
00115
00116 Timer timer;
00117 float actual_frame_rate;
00118
00119 int interrupted;
00120
00121 ArrayList<PluginServer*> *plugindb;
00122
00123 ChannelDB *channeldb;
00124
00125
00126 int64_t fragment_len;
00127
00128 int64_t adjusted_fragment_len;
00129
00130 CICache *audio_cache, *video_cache;
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 RenderEngine(MWindow *mwindow,
00150 AudioDevice *audio = 0,
00151 VideoDevice *video = 0,
00152 PlaybackEngine *playbackengine = 0);
00153
00154
00155 int reset_parameters();
00156
00157 int arm_playback_audio(int64_t input_length,
00158 int64_t amodule_render_fragment,
00159 int64_t playback_buffer,
00160 int64_t output_length,
00161 int audio_channels);
00162
00163 int arm_playback_video(int every_frame,
00164 int64_t read_length,
00165 int64_t output_length,
00166 int track_w,
00167 int track_h,
00168 int output_w,
00169 int output_h);
00170
00171 int64_t get_correction_factor(int reset);
00172
00173
00174 int start_video();
00175
00176
00177
00178 int follow_loop;
00179 int infinite;
00180
00181 int64_t start_position;
00182 int64_t end_position;
00183 int64_t current_sample;
00184 int audio_channels;
00185 int every_frame;
00186
00187 MWindow *mwindow;
00188 };
00189
00190
00191
00192
00193
00194
00195
00196
00197 #endif