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(Defaults *defaults);
00077 void save_defaults(Defaults *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 class BatchRenderList : public BC_ListBox
00153 {
00154 public:
00155 BatchRenderList(BatchRenderThread *thread,
00156 int x,
00157 int y,
00158 int w,
00159 int h);
00160 int handle_event();
00161 int selection_changed();
00162 int column_resize_event();
00163 int drag_start_event();
00164 int drag_motion_event();
00165 int drag_stop_event();
00166 int dragging_item;
00167 BatchRenderThread *thread;
00168 };
00169 class BatchRenderStart : public BC_GenericButton
00170 {
00171 public:
00172 BatchRenderStart(BatchRenderThread *thread,
00173 int x,
00174 int y);
00175 int handle_event();
00176 BatchRenderThread *thread;
00177 };
00178
00179 class BatchRenderStop : public BC_GenericButton
00180 {
00181 public:
00182 BatchRenderStop(BatchRenderThread *thread,
00183 int x,
00184 int y);
00185 int handle_event();
00186 BatchRenderThread *thread;
00187 };
00188
00189 class BatchRenderCancel : public BC_GenericButton
00190 {
00191 public:
00192 BatchRenderCancel(BatchRenderThread *thread,
00193 int x,
00194 int y);
00195 int handle_event();
00196 int keypress_event();
00197 BatchRenderThread *thread;
00198 };
00199
00200
00201 class BatchFormat : public FormatTools
00202 {
00203 public:
00204 BatchFormat(MWindow *mwindow,
00205 BatchRenderGUI *gui,
00206 Asset *asset);
00207 ~BatchFormat();
00208
00209 int handle_event();
00210
00211 BatchRenderGUI *gui;
00212 MWindow *mwindow;
00213 };
00214
00215
00216 class BatchRenderGUI : public BC_Window
00217 {
00218 public:
00219 BatchRenderGUI(MWindow *mwindow,
00220 BatchRenderThread *thread,
00221 int x,
00222 int y,
00223 int w,
00224 int h);
00225 ~BatchRenderGUI();
00226
00227 void create_objects();
00228 int resize_event(int w, int h);
00229 int translation_event();
00230 int close_event();
00231 void create_list(int update_widget);
00232 void change_job();
00233
00234 ArrayList<BC_ListBoxItem*> list_columns[BATCHRENDER_COLUMNS];
00235
00236 MWindow *mwindow;
00237 BatchRenderThread *thread;
00238 BC_Title *output_path_title;
00239 BatchFormat *format_tools;
00240 BrowseButton *edl_path_browse;
00241 BatchRenderEDLPath *edl_path_text;
00242 BC_Title *edl_path_title;
00243
00244
00245
00246 BC_Title *list_title;
00247 BatchRenderNew *new_batch;
00248 BatchRenderDelete *delete_batch;
00249 BatchRenderList *batch_list;
00250 BatchRenderStart *start_button;
00251 BatchRenderStop *stop_button;
00252 BatchRenderCancel *cancel_button;
00253 };
00254
00255
00256
00257
00258
00259 #endif