Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / batchrender.h
blobc94d49a1a8908eebc036ba2ad54b04bdf06bb2c3
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);
35 void copy_from(BatchRenderJob *src);
36 void load(FileXML *file);
37 void save(FileXML *file);
38 void fix_strategy();
40 // Source EDL to render
41 char edl_path[BCTEXTLEN];
42 // Destination file for output
43 Asset_GC asset;
44 int strategy;
45 int enabled;
46 // Amount of time elapsed in last render operation
47 double elapsed;
48 Preferences *preferences;
58 class BatchRenderThread : public BC_DialogThread
60 public:
61 BatchRenderThread(MWindow *mwindow);
62 BatchRenderThread();
63 void handle_close_event(int result);
64 BC_Window* new_gui();
66 int test_edl_files();
67 void calculate_dest_paths(ArrayList<char*> *paths,
68 Preferences *preferences,
69 ArrayList<PluginServer*> *plugindb);
71 // Load batch rendering jobs
72 void load_jobs(char *path, Preferences *preferences);
73 // Not applicable to western civilizations
74 void save_jobs(char *path);
75 void load_defaults(BC_Hash *defaults);
76 void save_defaults(BC_Hash *defaults);
77 // Create path for persistent storage functions
78 char* create_path(char *string);
79 void new_job();
80 void delete_job();
81 // Conditionally returns the job or the default job based on current_job
82 BatchRenderJob* get_current_job();
83 Asset_GC get_current_asset();
84 char* get_current_edl();
85 // For command line usage
86 void start_rendering(char *config_path, char *batch_path);
87 // For GUI usage
88 void start_rendering();
89 void stop_rendering();
90 // Highlight the currently rendering job.
91 void update_active(int number);
92 void update_done(int number, int create_list, double elapsed_time);
93 void move_batch(int src, int dst);
95 MWindow *mwindow;
96 double current_start;
97 double current_end;
98 BatchRenderJob *default_job;
99 ArrayList<BatchRenderJob*> jobs;
100 BatchRenderGUI *gui;
101 int column_width[BATCHRENDER_COLUMNS];
102 // job being edited
103 int current_job;
104 // job being rendered
105 int rendering_job;
106 int is_rendering;
118 class BatchRenderEDLPath : public BC_TextBox
120 public:
121 BatchRenderEDLPath(BatchRenderThread *thread,
122 int x,
123 int y,
124 int w,
125 char *text);
126 int handle_event();
127 BatchRenderThread *thread;
131 class BatchRenderNew : public BC_GenericButton
133 public:
134 BatchRenderNew(BatchRenderThread *thread,
135 int x,
136 int y);
137 int handle_event();
138 BatchRenderThread *thread;
141 class BatchRenderDelete : public BC_GenericButton
143 public:
144 BatchRenderDelete(BatchRenderThread *thread,
145 int x,
146 int y);
147 int handle_event();
148 BatchRenderThread *thread;
153 class BatchRenderSaveList : public BC_GenericButton, public Thread
155 public:
156 BatchRenderSaveList(BatchRenderThread *thread,
157 int x,
158 int y);
159 ~BatchRenderSaveList();
160 int handle_event();
161 BatchRenderThread *thread;
162 BC_FileBox *gui;
163 void run();
164 virtual int keypress_event();
165 Mutex *startup_lock;
168 class BatchRenderLoadList : public BC_GenericButton, public Thread
170 public:
171 BatchRenderLoadList(BatchRenderThread *thread,
172 int x,
173 int y);
174 ~BatchRenderLoadList();
175 int handle_event();
176 BatchRenderThread *thread;
177 BC_FileBox *gui;
178 void run();
179 virtual int keypress_event();
180 Mutex *startup_lock;
185 class BatchRenderList : public BC_ListBox
187 public:
188 BatchRenderList(BatchRenderThread *thread,
189 int x,
190 int y,
191 int w,
192 int h);
193 int handle_event();
194 int selection_changed();
195 int column_resize_event();
196 int drag_start_event();
197 int drag_motion_event();
198 int drag_stop_event();
199 int dragging_item;
200 BatchRenderThread *thread;
202 class BatchRenderStart : public BC_GenericButton
204 public:
205 BatchRenderStart(BatchRenderThread *thread,
206 int x,
207 int y);
208 int handle_event();
209 BatchRenderThread *thread;
212 class BatchRenderStop : public BC_GenericButton
214 public:
215 BatchRenderStop(BatchRenderThread *thread,
216 int x,
217 int y);
218 int handle_event();
219 BatchRenderThread *thread;
222 class BatchRenderCancel : public BC_GenericButton
224 public:
225 BatchRenderCancel(BatchRenderThread *thread,
226 int x,
227 int y);
228 int handle_event();
229 int keypress_event();
230 BatchRenderThread *thread;
234 class BatchFormat : public FormatTools
236 public:
237 BatchFormat(MWindow *mwindow,
238 BatchRenderGUI *gui,
239 Asset_GC asset);
240 ~BatchFormat();
242 int handle_event();
244 BatchRenderGUI *gui;
245 MWindow *mwindow;
249 class BatchRenderGUI : public BC_Window
251 public:
252 BatchRenderGUI(MWindow *mwindow,
253 BatchRenderThread *thread,
254 int x,
255 int y,
256 int w,
257 int h);
258 ~BatchRenderGUI();
260 void create_objects();
261 int resize_event(int w, int h);
262 int translation_event();
263 int close_event();
264 void create_list(int update_widget);
265 void change_job();
267 ArrayList<BC_ListBoxItem*> list_columns[BATCHRENDER_COLUMNS];
269 MWindow *mwindow;
270 BatchRenderThread *thread;
271 BC_Title *output_path_title;
272 BatchFormat *format_tools;
273 BrowseButton *edl_path_browse;
274 BatchRenderEDLPath *edl_path_text;
275 BC_Title *edl_path_title;
276 // BC_Title *status_title;
277 // BC_Title *status_text;
278 // BC_ProgressBar *progress_bar;
279 BC_Title *list_title;
280 BatchRenderNew *new_batch;
281 BatchRenderDelete *delete_batch;
282 BatchRenderSaveList *savelist_batch;
283 BatchRenderLoadList *loadlist_batch;
284 BatchRenderList *batch_list;
285 BatchRenderStart *start_button;
286 BatchRenderStop *stop_button;
287 BatchRenderCancel *cancel_button;
294 #endif
296 // Local Variables:
297 // mode: C++
298 // c-file-style: "linux"
299 // End: