add Autosave continuous backups by Andras Reuss and Andrew-R
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / performanceprefs.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef PERFORMANCEPREFS_H
23 #define PERFORMANCEPREFS_H
24
25
26 #include "formattools.inc"
27 #include "mwindow.inc"
28 #include "performanceprefs.inc"
29 #include "preferencesthread.h"
30 #include "probeprefs.inc"
31
32
33 class PerformancePrefs : public PreferencesDialog
34 {
35 public:
36         PerformancePrefs(MWindow *mwindow, PreferencesWindow *pwindow);
37         ~PerformancePrefs();
38
39         void create_objects();
40
41         void generate_node_list();
42         void update_node_list();
43         void update_rates();
44         void start_probe_dialog();
45
46         int hot_node;
47
48         CICacheSize *cache_size;
49         CacheTransitions *cache_transitions;
50         PerfsUseHWDev *use_hw_dev;
51
52         enum
53         {
54                 ENABLED_COLUMN,
55                 HOSTNAME_COLUMN,
56                 PORT_COLUMN,
57                 RATE_COLUMN,
58                 TOTAL_COLUMNS
59         };
60
61         ArrayList<BC_ListBoxItem*> nodes[TOTAL_COLUMNS];
62         PrefsRenderFarmEditNode *edit_node;
63         PrefsRenderFarmPort *edit_port;
64         PrefsRenderFarmNodes *node_list;
65         PrefsRenderFarmWatchdog *renderfarm_watchdog;
66         FormatTools *brender_tools;
67         BC_Title *master_rate;
68 };
69
70
71 class PrefsUseBRender : public BC_CheckBox
72 {
73 public:
74         PrefsUseBRender(PreferencesWindow *pwindow,
75                 int x, int y);
76         int handle_event();
77         PreferencesWindow *pwindow;
78 };
79
80 class PrefsBRenderFragment : public BC_TumbleTextBox
81 {
82 public:
83         PrefsBRenderFragment(PreferencesWindow *pwindow,
84                 PerformancePrefs *subwindow,
85                 int x, int y);
86         int handle_event();
87         PreferencesWindow *pwindow;
88 };
89
90 class PrefsRenderPreroll : public BC_TumbleTextBox
91 {
92 public:
93         PrefsRenderPreroll(PreferencesWindow *pwindow,
94                 PerformancePrefs *subwindow,
95                 int x,
96                 int y);
97         ~PrefsRenderPreroll();
98
99         int handle_event();
100
101         PreferencesWindow *pwindow;
102 };
103
104 class PrefsBRenderPreroll : public BC_TumbleTextBox
105 {
106 public:
107         PrefsBRenderPreroll(PreferencesWindow *pwindow,
108                 PerformancePrefs *subwindow,
109                 int x,
110                 int y);
111         int handle_event();
112         PreferencesWindow *pwindow;
113 };
114
115 class PrefsForceUniprocessor : public BC_CheckBox
116 {
117 public:
118         PrefsForceUniprocessor(PreferencesWindow *pwindow, int x, int y);
119         ~PrefsForceUniprocessor();
120         int handle_event();
121
122         PreferencesWindow *pwindow;
123 };
124
125 class PrefsFFMPEGMarkerIndecies : public BC_CheckBox
126 {
127 public:
128         PrefsFFMPEGMarkerIndecies(PerformancePrefs *perf_prefs, int x, int y);
129         ~PrefsFFMPEGMarkerIndecies();
130
131         int handle_event();
132
133         PerformancePrefs *perf_prefs;
134 };
135
136 class PrefsRenderFarm : public BC_CheckBox
137 {
138 public:
139         PrefsRenderFarm(PreferencesWindow *pwindow, int x, int y);
140         ~PrefsRenderFarm();
141
142         int handle_event();
143
144         PreferencesWindow *pwindow;
145 };
146
147 class PrefsRenderFarmConsolidate : public BC_CheckBox
148 {
149 public:
150         PrefsRenderFarmConsolidate(PreferencesWindow *pwindow, int x, int y);
151         ~PrefsRenderFarmConsolidate();
152
153         int handle_event();
154
155         PreferencesWindow *pwindow;
156 };
157
158
159 class PrefsRenderFarmPort : public BC_TumbleTextBox
160 {
161 public:
162         PrefsRenderFarmPort(PreferencesWindow *pwindow,
163                 PerformancePrefs *subwindow,
164                 int x, int y);
165         ~PrefsRenderFarmPort();
166
167         int handle_event();
168
169         PreferencesWindow *pwindow;
170 };
171
172 class PrefsProjectSMP : public BC_TumbleTextBox
173 {
174 public:
175         PrefsProjectSMP(PreferencesWindow *pwindow,
176                 PerformancePrefs *subwindow, int x, int y);
177         ~PrefsProjectSMP();
178
179         int handle_event();
180         PreferencesWindow *pwindow;
181 };
182
183 class PrefsRenderFarmJobs : public BC_TumbleTextBox
184 {
185 public:
186         PrefsRenderFarmJobs(PreferencesWindow *pwindow,
187                 PerformancePrefs *subwindow,
188                 int x, int y);
189         ~PrefsRenderFarmJobs();
190
191         int handle_event();
192
193         PreferencesWindow *pwindow;
194 };
195
196 class PrefsRenderFarmMountpoint : public BC_TextBox
197 {
198 public:
199         PrefsRenderFarmMountpoint(PreferencesWindow *pwindow,
200                 PerformancePrefs *subwindow,
201                 int x, int y);
202         ~PrefsRenderFarmMountpoint();
203
204         int handle_event();
205
206         PreferencesWindow *pwindow;
207         PerformancePrefs *subwindow;
208 };
209
210 class PrefsRenderFarmVFS : public BC_CheckBox
211 {
212 public:
213         PrefsRenderFarmVFS(PreferencesWindow *pwindow,
214                 PerformancePrefs *subwindow,
215                 int x,
216                 int y);
217         int handle_event();
218         PreferencesWindow *pwindow;
219         PerformancePrefs *subwindow;
220 };
221
222 class PrefsRenderFarmNodes : public BC_ListBox
223 {
224 public:
225         PrefsRenderFarmNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
226         ~PrefsRenderFarmNodes();
227
228         int handle_event();
229         int selection_changed();
230         int column_resize_event();
231         void update_list();
232
233         const char *titles[PerformancePrefs::TOTAL_COLUMNS];
234         int widths[PerformancePrefs::TOTAL_COLUMNS];
235
236         PreferencesWindow *pwindow;
237         PerformancePrefs *subwindow;
238 };
239
240 class PrefsRenderFarmEditNode : public BC_TextBox
241 {
242 public:
243         PrefsRenderFarmEditNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
244         ~PrefsRenderFarmEditNode();
245
246         int handle_event();
247
248         PerformancePrefs *subwindow;
249         PreferencesWindow *pwindow;
250 };
251
252 class PrefsRenderFarmNewNode : public BC_GenericButton
253 {
254 public:
255         PrefsRenderFarmNewNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
256         ~PrefsRenderFarmNewNode();
257
258         int handle_event();
259
260
261         PerformancePrefs *subwindow;
262         PreferencesWindow *pwindow;
263 };
264
265 class PrefsRenderFarmReplaceNode : public BC_GenericButton
266 {
267 public:
268         PrefsRenderFarmReplaceNode(PreferencesWindow *pwindow,
269                 PerformancePrefs *subwindow,
270                 int x,
271                 int y);
272         ~PrefsRenderFarmReplaceNode();
273
274         int handle_event();
275
276
277         PerformancePrefs *subwindow;
278         PreferencesWindow *pwindow;
279 };
280
281 class PrefsRenderFarmDelNode : public BC_GenericButton
282 {
283 public:
284         PrefsRenderFarmDelNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
285         ~PrefsRenderFarmDelNode();
286
287         int handle_event();
288
289         PerformancePrefs *subwindow;
290         PreferencesWindow *pwindow;
291 };
292
293 class PrefsRenderFarmSortNodes : public BC_GenericButton
294 {
295 public:
296         PrefsRenderFarmSortNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
297         ~PrefsRenderFarmSortNodes();
298
299         int handle_event();
300
301         PerformancePrefs *subwindow;
302         PreferencesWindow *pwindow;
303 };
304
305 class PrefsRenderFarmReset : public BC_GenericButton
306 {
307 public:
308         PrefsRenderFarmReset(PreferencesWindow *pwindow,
309                 PerformancePrefs *subwindow, int x, int y);
310
311         int handle_event();
312
313         PerformancePrefs *subwindow;
314         PreferencesWindow *pwindow;
315 };
316
317 class PrefsRenderFarmWatchdog : public BC_TumbleTextBox
318 {
319 public:
320         PrefsRenderFarmWatchdog(PreferencesWindow *pwindow,
321                 PerformancePrefs *subwindow, int x, int y);
322
323         int handle_event();
324
325         PerformancePrefs *subwindow;
326         PreferencesWindow *pwindow;
327 };
328
329
330 class CICacheSize : public BC_TumbleTextBox
331 {
332 public:
333         CICacheSize(int x, int y,
334                 PreferencesWindow *pwindow,
335                 PerformancePrefs *subwindow);
336
337         int handle_event();
338
339         PreferencesWindow *pwindow;
340 };
341
342 class CacheTransitions : public BC_CheckBox
343 {
344 public:
345         CacheTransitions(int x, int y,
346                 PreferencesWindow *pwindow,
347                 PerformancePrefs *subwindow);
348
349         int handle_event();
350
351         PreferencesWindow *pwindow;
352 };
353
354 class PrefsUseHWDevItems : public ArrayList<BC_ListBoxItem *>
355 {
356 public:
357         PrefsUseHWDevItems() {}
358         ~PrefsUseHWDevItems() { remove_all_objects(); }
359 };
360
361 class PrefsUseHWDev : public BC_PopupTextBox
362 {
363 public:
364         PrefsUseHWDev(PreferencesWindow *pwindow,
365                 PerformancePrefs *subwindow, int x, int y);
366         void create_objects();
367         int handle_event();
368
369         PreferencesWindow *pwindow;
370         PrefsUseHWDevItems hw_dev_names;
371 };
372
373
374 #endif