00001 #ifndef BATCHRENDER_H
00002 #define BATCHRENDER_H
00003
00004 #include "arraylist.h"
00005 #include "asset.inc"
00006 #include "batchrender.inc"
00007 #include "bcdialog.h"
00008 #include "browsebutton.inc"
00009 #include "filexml.inc"
00010 #include "formattools.h"
00011 #include "mwindow.inc"
00012 #include "preferences.inc"
00013 #include "timeentry.h"
00014
00015 #define BATCHRENDER_COLUMNS 4
00016
00017
00018
00019
00020 class BatchRenderMenuItem : public BC_MenuItem
00021 {
00022 public:
00023 BatchRenderMenuItem(MWindow *mwindow);
00024 int handle_event();
00025 MWindow *mwindow;
00026 };
00027
00028
00029
00030 class BatchRenderJob
00031 {
00032 public:
00033 BatchRenderJob(Preferences *preferences);
00034 ~BatchRenderJob();
00035
00036 void copy_from(BatchRenderJob *src);
00037 void load(FileXML *file);
00038 void save(FileXML *file);
00039 void fix_strategy();
00040
00041
00042 char edl_path[BCTEXTLEN];
00043
00044 Asset *asset;
00045 int strategy;
00046 int enabled;
00047
00048 double elapsed;
00049 Preferences *preferences;
00050 };
00051
00052
00053
00054
00055
00056
00057
00058
00059 class BatchRenderThread : public BC_DialogThread
00060 {
00061 public:
00062 BatchRenderThread(MWindow *mwindow);
00063 BatchRenderThread();
00064 void handle_close_event(int result);
00065 BC_Window* new_gui();
00066
00067 int test_edl_files();
00068 void calculate_dest_paths(ArrayList<char*> *paths,
00069 Preferences *preferences,
00070 ArrayList<PluginServer*> *plugindb);
00071
00072
00073 void load_jobs(char *path, Preferences *preferences);
00074
00075 void save_jobs(char *path);
00076 void load_defaults(BC_Hash *defaults);
00077 void save_defaults(BC_Hash *defaults);
00078
00079 char* create_path(char *string);
00080 void new_job();
00081 void delete_job();
00082
00083 BatchRenderJob* get_current_job();
00084 Asset* get_current_asset();
00085 char* get_current_edl();
00086
00087 void start_rendering(char *config_path, char *batch_path);
00088
00089 void start_rendering();
00090 void stop_rendering();
00091
00092 void update_active(int number);
00093 void update_done(int number, int create_list, double elapsed_time);
00094 void move_batch(int src, int dst);
00095
00096 MWindow *mwindow;
00097 double current_start;
00098 double current_end;
00099 BatchRenderJob *default_job;
00100 ArrayList<BatchRenderJob*> jobs;
00101 BatchRenderGUI *gui;
00102 int column_width[BATCHRENDER_COLUMNS];
00103
00104 int current_job;
00105
00106 int rendering_job;
00107 int is_rendering;
00108 };
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 class BatchRenderEDLPath : public BC_TextBox
00120 {
00121 public:
00122 BatchRenderEDLPath(BatchRenderThread *thread,
00123 int x,
00124 int y,
00125 int w,
00126 char *text);
00127 int handle_event();
00128 BatchRenderThread *thread;
00129 };
00130
00131
00132 class BatchRenderNew : public BC_GenericButton
00133 {
00134 public:
00135 BatchRenderNew(BatchRenderThread *thread,
00136 int x,
00137 int y);
00138 int handle_event();
00139 BatchRenderThread *thread;
00140 };
00141
00142 class BatchRenderDelete : public BC_GenericButton
00143 {
00144 public:
00145 BatchRenderDelete(BatchRenderThread *thread,
00146 int x,
00147 int y);
00148 int handle_event();
00149 BatchRenderThread *thread;
00150 };
00151
00152
00153
00154 class BatchRenderSaveList : public BC_GenericButton, public Thread
00155 {
00156 public:
00157 BatchRenderSaveList(BatchRenderThread *thread,
00158 int x,
00159 int y);
00160 ~BatchRenderSaveList();
00161 int handle_event();
00162 BatchRenderThread *thread;
00163 BC_FileBox *gui;
00164 void run();
00165 virtual int keypress_event();
00166 Mutex *startup_lock;
00167 };
00168
00169 class BatchRenderLoadList : public BC_GenericButton, public Thread
00170 {
00171 public:
00172 BatchRenderLoadList(BatchRenderThread *thread,
00173 int x,
00174 int y);
00175 ~BatchRenderLoadList();
00176 int handle_event();
00177 BatchRenderThread *thread;
00178 BC_FileBox *gui;
00179 void run();
00180 virtual int keypress_event();
00181 Mutex *startup_lock;
00182 };
00183
00184
00185
00186 class BatchRenderList : public BC_ListBox
00187 {
00188 public:
00189 BatchRenderList(BatchRenderThread *thread,
00190 int x,
00191 int y,
00192 int w,
00193 int h);
00194 int handle_event();
00195 int selection_changed();
00196 int column_resize_event();
00197 int drag_start_event();
00198 int drag_motion_event();
00199 int drag_stop_event();
00200 int dragging_item;
00201 BatchRenderThread *thread;
00202 };
00203 class BatchRenderStart : public BC_GenericButton
00204 {
00205 public:
00206 BatchRenderStart(BatchRenderThread *thread,
00207 int x,
00208 int y);
00209 int handle_event();
00210 BatchRenderThread *thread;
00211 };
00212
00213 class BatchRenderStop : public BC_GenericButton
00214 {
00215 public:
00216 BatchRenderStop(BatchRenderThread *thread,
00217 int x,
00218 int y);
00219 int handle_event();
00220 BatchRenderThread *thread;
00221 };
00222
00223 class BatchRenderCancel : public BC_GenericButton
00224 {
00225 public:
00226 BatchRenderCancel(BatchRenderThread *thread,
00227 int x,
00228 int y);
00229 int handle_event();
00230 int keypress_event();
00231 BatchRenderThread *thread;
00232 };
00233
00234
00235 class BatchFormat : public FormatTools
00236 {
00237 public:
00238 BatchFormat(MWindow *mwindow,
00239 BatchRenderGUI *gui,
00240 Asset *asset);
00241 ~BatchFormat();
00242
00243 int handle_event();
00244
00245 BatchRenderGUI *gui;
00246 MWindow *mwindow;
00247 };
00248
00249
00250 class BatchRenderGUI : public BC_Window
00251 {
00252 public:
00253 BatchRenderGUI(MWindow *mwindow,
00254 BatchRenderThread *thread,
00255 int x,
00256 int y,
00257 int w,
00258 int h);
00259 ~BatchRenderGUI();
00260
00261 void create_objects();
00262 int resize_event(int w, int h);
00263 int translation_event();
00264 int close_event();
00265 void create_list(int update_widget);
00266 void change_job();
00267
00268 ArrayList<BC_ListBoxItem*> list_columns[BATCHRENDER_COLUMNS];
00269
00270 MWindow *mwindow;
00271 BatchRenderThread *thread;
00272 BC_Title *output_path_title;
00273 BatchFormat *format_tools;
00274 BrowseButton *edl_path_browse;
00275 BatchRenderEDLPath *edl_path_text;
00276 BC_Title *edl_path_title;
00277
00278
00279
00280 BC_Title *list_title;
00281 BatchRenderNew *new_batch;
00282 BatchRenderDelete *delete_batch;
00283 BatchRenderSaveList *savelist_batch;
00284 BatchRenderLoadList *loadlist_batch;
00285 BatchRenderList *batch_list;
00286 BatchRenderStart *start_button;
00287 BatchRenderStop *stop_button;
00288 BatchRenderCancel *cancel_button;
00289 };
00290
00291
00292
00293
00294
00295 #endif