fix valgrind memory leaks/reports, add cache to dump, fix hw probe frame leak, startu...
[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         PerfsUseHWDev *use_hw_dev;
50
51         enum
52         {
53                 ENABLED_COLUMN,
54                 HOSTNAME_COLUMN,
55                 PORT_COLUMN,
56                 RATE_COLUMN,
57                 TOTAL_COLUMNS
58         };
59
60         ArrayList<BC_ListBoxItem*> nodes[TOTAL_COLUMNS];
61         PrefsRenderFarmEditNode *edit_node;
62         PrefsRenderFarmPort *edit_port;
63         PrefsRenderFarmNodes *node_list;
64         PrefsRenderFarmWatchdog *renderfarm_watchdog;
65         FormatTools *brender_tools;
66         BC_Title *master_rate;
67 };
68
69
70 class PrefsUseBRender : public BC_CheckBox
71 {
72 public:
73         PrefsUseBRender(PreferencesWindow *pwindow,
74                 int x, int y);
75         int handle_event();
76         PreferencesWindow *pwindow;
77 };
78
79 class PrefsBRenderFragment : public BC_TumbleTextBox
80 {
81 public:
82         PrefsBRenderFragment(PreferencesWindow *pwindow,
83                 PerformancePrefs *subwindow,
84                 int x, int y);
85         int handle_event();
86         PreferencesWindow *pwindow;
87 };
88
89 class PrefsRenderPreroll : public BC_TumbleTextBox
90 {
91 public:
92         PrefsRenderPreroll(PreferencesWindow *pwindow,
93                 PerformancePrefs *subwindow,
94                 int x,
95                 int y);
96         ~PrefsRenderPreroll();
97
98         int handle_event();
99
100         PreferencesWindow *pwindow;
101 };
102
103 class PrefsBRenderPreroll : public BC_TumbleTextBox
104 {
105 public:
106         PrefsBRenderPreroll(PreferencesWindow *pwindow,
107                 PerformancePrefs *subwindow,
108                 int x,
109                 int y);
110         int handle_event();
111         PreferencesWindow *pwindow;
112 };
113
114 class PrefsForceUniprocessor : public BC_CheckBox
115 {
116 public:
117         PrefsForceUniprocessor(PreferencesWindow *pwindow, int x, int y);
118         ~PrefsForceUniprocessor();
119         int handle_event();
120
121         PreferencesWindow *pwindow;
122 };
123
124 class PrefsFFMPEGMarkerIndecies : public BC_CheckBox
125 {
126 public:
127         PrefsFFMPEGMarkerIndecies(PerformancePrefs *perf_prefs, int x, int y);
128         ~PrefsFFMPEGMarkerIndecies();
129
130         int handle_event();
131
132         PerformancePrefs *perf_prefs;
133 };
134
135 class PrefsRenderFarm : public BC_CheckBox
136 {
137 public:
138         PrefsRenderFarm(PreferencesWindow *pwindow, int x, int y);
139         ~PrefsRenderFarm();
140
141         int handle_event();
142
143         PreferencesWindow *pwindow;
144 };
145
146 class PrefsRenderFarmConsolidate : public BC_CheckBox
147 {
148 public:
149         PrefsRenderFarmConsolidate(PreferencesWindow *pwindow, int x, int y);
150         ~PrefsRenderFarmConsolidate();
151
152         int handle_event();
153
154         PreferencesWindow *pwindow;
155 };
156
157
158 class PrefsRenderFarmPort : public BC_TumbleTextBox
159 {
160 public:
161         PrefsRenderFarmPort(PreferencesWindow *pwindow,
162                 PerformancePrefs *subwindow,
163                 int x, int y);
164         ~PrefsRenderFarmPort();
165
166         int handle_event();
167
168         PreferencesWindow *pwindow;
169 };
170
171 class PrefsProjectSMP : public BC_TumbleTextBox
172 {
173 public:
174         PrefsProjectSMP(PreferencesWindow *pwindow,
175                 PerformancePrefs *subwindow, int x, int y);
176         ~PrefsProjectSMP();
177
178         int handle_event();
179         PreferencesWindow *pwindow;
180 };
181
182 class PrefsRenderFarmJobs : public BC_TumbleTextBox
183 {
184 public:
185         PrefsRenderFarmJobs(PreferencesWindow *pwindow,
186                 PerformancePrefs *subwindow,
187                 int x, int y);
188         ~PrefsRenderFarmJobs();
189
190         int handle_event();
191
192         PreferencesWindow *pwindow;
193 };
194
195 class PrefsRenderFarmMountpoint : public BC_TextBox
196 {
197 public:
198         PrefsRenderFarmMountpoint(PreferencesWindow *pwindow,
199                 PerformancePrefs *subwindow,
200                 int x, int y);
201         ~PrefsRenderFarmMountpoint();
202
203         int handle_event();
204
205         PreferencesWindow *pwindow;
206         PerformancePrefs *subwindow;
207 };
208
209 class PrefsRenderFarmVFS : public BC_CheckBox
210 {
211 public:
212         PrefsRenderFarmVFS(PreferencesWindow *pwindow,
213                 PerformancePrefs *subwindow,
214                 int x,
215                 int y);
216         int handle_event();
217         PreferencesWindow *pwindow;
218         PerformancePrefs *subwindow;
219 };
220
221 class PrefsRenderFarmNodes : public BC_ListBox
222 {
223 public:
224         PrefsRenderFarmNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
225         ~PrefsRenderFarmNodes();
226
227         int handle_event();
228         int selection_changed();
229         int column_resize_event();
230         void update_list();
231
232         const char *titles[PerformancePrefs::TOTAL_COLUMNS];
233         int widths[PerformancePrefs::TOTAL_COLUMNS];
234
235         PreferencesWindow *pwindow;
236         PerformancePrefs *subwindow;
237 };
238
239 class PrefsRenderFarmEditNode : public BC_TextBox
240 {
241 public:
242         PrefsRenderFarmEditNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
243         ~PrefsRenderFarmEditNode();
244
245         int handle_event();
246
247         PerformancePrefs *subwindow;
248         PreferencesWindow *pwindow;
249 };
250
251 class PrefsRenderFarmNewNode : public BC_GenericButton
252 {
253 public:
254         PrefsRenderFarmNewNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
255         ~PrefsRenderFarmNewNode();
256
257         int handle_event();
258
259
260         PerformancePrefs *subwindow;
261         PreferencesWindow *pwindow;
262 };
263
264 class PrefsRenderFarmReplaceNode : public BC_GenericButton
265 {
266 public:
267         PrefsRenderFarmReplaceNode(PreferencesWindow *pwindow,
268                 PerformancePrefs *subwindow,
269                 int x,
270                 int y);
271         ~PrefsRenderFarmReplaceNode();
272
273         int handle_event();
274
275
276         PerformancePrefs *subwindow;
277         PreferencesWindow *pwindow;
278 };
279
280 class PrefsRenderFarmDelNode : public BC_GenericButton
281 {
282 public:
283         PrefsRenderFarmDelNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
284         ~PrefsRenderFarmDelNode();
285
286         int handle_event();
287
288         PerformancePrefs *subwindow;
289         PreferencesWindow *pwindow;
290 };
291
292 class PrefsRenderFarmSortNodes : public BC_GenericButton
293 {
294 public:
295         PrefsRenderFarmSortNodes(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y);
296         ~PrefsRenderFarmSortNodes();
297
298         int handle_event();
299
300         PerformancePrefs *subwindow;
301         PreferencesWindow *pwindow;
302 };
303
304 class PrefsRenderFarmReset : public BC_GenericButton
305 {
306 public:
307         PrefsRenderFarmReset(PreferencesWindow *pwindow,
308                 PerformancePrefs *subwindow, int x, int y);
309
310         int handle_event();
311
312         PerformancePrefs *subwindow;
313         PreferencesWindow *pwindow;
314 };
315
316 class PrefsRenderFarmWatchdog : public BC_TumbleTextBox
317 {
318 public:
319         PrefsRenderFarmWatchdog(PreferencesWindow *pwindow,
320                 PerformancePrefs *subwindow, int x, int y);
321
322         int handle_event();
323
324         PerformancePrefs *subwindow;
325         PreferencesWindow *pwindow;
326 };
327
328
329 class CICacheSize : public BC_TumbleTextBox
330 {
331 public:
332         CICacheSize(int x, int y,
333                 PreferencesWindow *pwindow,
334                 PerformancePrefs *subwindow);
335
336         int handle_event();
337
338         PreferencesWindow *pwindow;
339 };
340
341 class PrefsUseHWDevItems : public ArrayList<BC_ListBoxItem *>
342 {
343 public:
344         PrefsUseHWDevItems() {}
345         ~PrefsUseHWDevItems() { remove_all_objects(); }
346 };
347
348 class PrefsUseHWDev : public BC_PopupTextBox
349 {
350 public:
351         PrefsUseHWDev(PreferencesWindow *pwindow,
352                 PerformancePrefs *subwindow, int x, int y);
353         void create_objects();
354         int handle_event();
355
356         PreferencesWindow *pwindow;
357         PrefsUseHWDevItems hw_dev_names;
358 };
359
360
361 #endif