r1009: Move the dependencies to newer package names
[cinelerra_cv/mob.git] / cinelerra / batchrender.h
blobd17fe0d7bfb1e3ff4889dc41bb6c7d3c7bfab667
1 #ifndef BATCHRENDER_H
2 #define BATCHRENDER_H
4 #include "arraylist.h"
5 #include "asset.inc"
6 #include "batchrender.inc"
7 #include "bcdialog.h"
8 #include "browsebutton.inc"
9 #include "filexml.inc"
10 #include "formattools.h"
11 #include "mwindow.inc"
12 #include "preferences.inc"
13 #include "timeentry.h"
15 #define BATCHRENDER_COLUMNS 4
20 class BatchRenderMenuItem : public BC_MenuItem
22 public:
23 BatchRenderMenuItem(MWindow *mwindow);
24 int handle_event();
25 MWindow *mwindow;
30 class BatchRenderJob
32 public:
33 BatchRenderJob(Preferences *preferences);
34 ~BatchRenderJob();
36 void copy_from(BatchRenderJob *src);
37 void load(FileXML *file);
38 void save(FileXML *file);
39 void fix_strategy();
41 // Source EDL to render
42 char edl_path[BCTEXTLEN];
43 // Destination file for output
44 Asset *asset;
45 int strategy;
46 int enabled;
47 // Amount of time elapsed in last render operation
48 double elapsed;
49 Preferences *preferences;
59 class BatchRenderThread : public BC_DialogThread
61 public:
62 BatchRenderThread(MWindow *mwindow);
63 BatchRenderThread();
64 void handle_close_event(int result);
65 BC_Window* new_gui();
67 int test_edl_files();
68 void calculate_dest_paths(ArrayList<char*> *paths,
69 Preferences *preferences,
70 ArrayList<PluginServer*> *plugindb);
72 // Load batch rendering jobs
73 void load_jobs(char *path, Preferences *preferences);
74 // Not applicable to western civilizations
75 void save_jobs(char *path);
76 void load_defaults(BC_Hash *defaults);
77 void save_defaults(BC_Hash *defaults);
78 // Create path for persistent storage functions
79 char* create_path(char *string);
80 void new_job();
81 void delete_job();
82 // Conditionally returns the job or the default job based on current_job
83 BatchRenderJob* get_current_job();
84 Asset* get_current_asset();
85 char* get_current_edl();
86 // For command line usage
87 void start_rendering(char *config_path, char *batch_path);
88 // For GUI usage
89 void start_rendering();
90 void stop_rendering();
91 // Highlight the currently rendering job.
92 void update_active(int number);
93 void update_done(int number, int create_list, double elapsed_time);
94 void move_batch(int src, int dst);
96 MWindow *mwindow;
97 double current_start;
98 double current_end;
99 BatchRenderJob *default_job;
100 ArrayList<BatchRenderJob*> jobs;
101 BatchRenderGUI *gui;
102 int column_width[BATCHRENDER_COLUMNS];
103 // job being edited
104 int current_job;
105 // job being rendered
106 int rendering_job;
107 int is_rendering;
119 class BatchRenderEDLPath : public BC_TextBox
121 public:
122 BatchRenderEDLPath(BatchRenderThread *thread,
123 int x,
124 int y,
125 int w,
126 char *text);
127 int handle_event();
128 BatchRenderThread *thread;
132 class BatchRenderNew : public BC_GenericButton
134 public:
135 BatchRenderNew(BatchRenderThread *thread,
136 int x,
137 int y);
138 int handle_event();
139 BatchRenderThread *thread;
142 class BatchRenderDelete : public BC_GenericButton
144 public:
145 BatchRenderDelete(BatchRenderThread *thread,
146 int x,
147 int y);
148 int handle_event();
149 BatchRenderThread *thread;
154 class BatchRenderSaveList : public BC_GenericButton, public Thread
156 public:
157 BatchRenderSaveList(BatchRenderThread *thread,
158 int x,
159 int y);
160 ~BatchRenderSaveList();
161 int handle_event();
162 BatchRenderThread *thread;
163 BC_FileBox *gui;
164 void run();
165 virtual int keypress_event();
166 Mutex *startup_lock;
169 class BatchRenderLoadList : public BC_GenericButton, public Thread
171 public:
172 BatchRenderLoadList(BatchRenderThread *thread,
173 int x,
174 int y);
175 ~BatchRenderLoadList();
176 int handle_event();
177 BatchRenderThread *thread;
178 BC_FileBox *gui;
179 void run();
180 virtual int keypress_event();
181 Mutex *startup_lock;
186 class BatchRenderList : public BC_ListBox
188 public:
189 BatchRenderList(BatchRenderThread *thread,
190 int x,
191 int y,
192 int w,
193 int h);
194 int handle_event();
195 int selection_changed();
196 int column_resize_event();
197 int drag_start_event();
198 int drag_motion_event();
199 int drag_stop_event();
200 int dragging_item;
201 BatchRenderThread *thread;
203 class BatchRenderStart : public BC_GenericButton
205 public:
206 BatchRenderStart(BatchRenderThread *thread,
207 int x,
208 int y);
209 int handle_event();
210 BatchRenderThread *thread;
213 class BatchRenderStop : public BC_GenericButton
215 public:
216 BatchRenderStop(BatchRenderThread *thread,
217 int x,
218 int y);
219 int handle_event();
220 BatchRenderThread *thread;
223 class BatchRenderCancel : public BC_GenericButton
225 public:
226 BatchRenderCancel(BatchRenderThread *thread,
227 int x,
228 int y);
229 int handle_event();
230 int keypress_event();
231 BatchRenderThread *thread;
235 class BatchFormat : public FormatTools
237 public:
238 BatchFormat(MWindow *mwindow,
239 BatchRenderGUI *gui,
240 Asset *asset);
241 ~BatchFormat();
243 int handle_event();
245 BatchRenderGUI *gui;
246 MWindow *mwindow;
250 class BatchRenderGUI : public BC_Window
252 public:
253 BatchRenderGUI(MWindow *mwindow,
254 BatchRenderThread *thread,
255 int x,
256 int y,
257 int w,
258 int h);
259 ~BatchRenderGUI();
261 void create_objects();
262 int resize_event(int w, int h);
263 int translation_event();
264 int close_event();
265 void create_list(int update_widget);
266 void change_job();
268 ArrayList<BC_ListBoxItem*> list_columns[BATCHRENDER_COLUMNS];
270 MWindow *mwindow;
271 BatchRenderThread *thread;
272 BC_Title *output_path_title;
273 BatchFormat *format_tools;
274 BrowseButton *edl_path_browse;
275 BatchRenderEDLPath *edl_path_text;
276 BC_Title *edl_path_title;
277 // BC_Title *status_title;
278 // BC_Title *status_text;
279 // BC_ProgressBar *progress_bar;
280 BC_Title *list_title;
281 BatchRenderNew *new_batch;
282 BatchRenderDelete *delete_batch;
283 BatchRenderSaveList *savelist_batch;
284 BatchRenderLoadList *loadlist_batch;
285 BatchRenderList *batch_list;
286 BatchRenderStart *start_button;
287 BatchRenderStop *stop_button;
288 BatchRenderCancel *cancel_button;
295 #endif