add asset select used to proxy list menu
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / performanceprefs.C
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 #include "bcsignals.h"
23 #include "clip.h"
24 #include "edl.h"
25 #include "edlsession.h"
26 #include "formattools.h"
27 #include "language.h"
28 #include "mwindow.h"
29 #include "performanceprefs.h"
30 #include "preferences.h"
31 #include <ctype.h>
32 #include <string.h>
33 #include "theme.h"
34
35 #define MASTER_NODE_FRAMERATE_TEXT "Master node framerate: %0.3f"
36 #if 0
37 N_(MASTER_NODE_FRAMERATE_TEXT)
38 #endif
39
40 PerformancePrefs::PerformancePrefs(MWindow *mwindow, PreferencesWindow *pwindow)
41  : PreferencesDialog(mwindow, pwindow)
42 {
43         hot_node = -1;
44 }
45
46 PerformancePrefs::~PerformancePrefs()
47 {
48         delete brender_tools;
49         nodes[0].remove_all_objects();
50         nodes[1].remove_all_objects();
51         nodes[2].remove_all_objects();
52         nodes[3].remove_all_objects();
53 }
54
55 void PerformancePrefs::create_objects()
56 {
57         int x, y;
58         int xmargin1;
59         int xmargin2 = 180;
60         int xmargin3 = 260;
61         int xmargin4 = 420;
62         char string[BCTEXTLEN];
63         BC_Resources *resources = BC_WindowBase::get_resources();
64         BC_WindowBase *win;
65         int maxw, curw;
66
67         node_list = 0;
68         generate_node_list();
69
70         xmargin1 = x = mwindow->theme->preferencesoptions_x;
71         y = mwindow->theme->preferencesoptions_y;
72
73         int y0 = y;
74         win = add_subwindow(new BC_Title(x, y + 5, _("Cache size (MB):"), MEDIUMFONT, resources->text_default));
75         maxw = win->get_w();
76
77         int y1 = y += 30;
78         win = add_subwindow(new BC_Title(x, y + 5, _("Seconds to preroll renders:")));
79         if((curw = win->get_w()) > maxw)
80                 maxw = curw;
81         maxw += x + 5;
82
83         cache_size = new CICacheSize(maxw, y0, pwindow, this);
84         cache_size->create_objects();
85
86         add_subwindow(new BC_Title(x, y + 5, _("Seconds to preroll renders:")));
87         PrefsRenderPreroll *preroll = new PrefsRenderPreroll(pwindow, this, maxw, y1);
88         preroll->create_objects();
89         y += 30;
90
91         int x1 = x + xmargin4;
92         BC_Title *smp_title = new BC_Title(x1, y + 5, _("Project SMP cpus:"));
93         add_subwindow(smp_title);
94         int x2 = x1 + smp_title->get_w() + 5;
95         PrefsProjectSMP *proj_smp = new PrefsProjectSMP(pwindow, this, x2, y);
96         proj_smp->create_objects();
97
98         PrefsForceUniprocessor *force_1cpu = new PrefsForceUniprocessor(pwindow, x, y);
99         add_subwindow(force_1cpu);
100         y += 30;
101
102 // Background rendering
103         add_subwindow(new BC_Bar(5, y,  get_w() - 10));
104         y += 5;
105
106
107         add_subwindow(new BC_Title(x, y, _("Background Rendering (Video only)"), LARGEFONT, resources->text_default));
108         y1 = y += 30;
109
110         win = add_subwindow(new PrefsUseBRender(pwindow, x, y));
111
112         y += win->get_h() + 10;
113         win = add_subwindow(new BC_Title(x, y, _("Frames per background rendering job:")));
114         y += win->get_h() + 5;
115         PrefsBRenderFragment *brender_fragment = new PrefsBRenderFragment(pwindow, this,
116                 x + xmargin3, y);
117         brender_fragment->create_objects();
118         y += brender_fragment->get_h() + 5;
119         win = add_subwindow(new BC_Title(x, y, _("Frames to preroll background:")));
120         y += win->get_h() + 5;
121         PrefsBRenderPreroll *bpreroll = new PrefsBRenderPreroll(pwindow, this,
122                 x + xmargin3, y + 5);
123         bpreroll->create_objects();
124         y += bpreroll->get_h() + 20;
125
126         x += xmargin4;
127         add_subwindow(new BC_Title(x, y1, _("Output for background rendering:")));
128         y1 += 20;
129         brender_tools = new FormatTools(mwindow, this,
130                         pwindow->thread->preferences->brender_asset);
131         brender_tools->create_objects(x, y1,
132                 0,  // Include tools for audio
133                 1,  // Include tools for video
134                 0,  // Include checkbox for audio
135                 0,  // Include checkbox for video
136                 0,
137                 1,
138                 0,  // Select compressors to be offered
139                 0,  // Prompt for recording options
140                 0,  // prompt for use labels
141                 1); // Supply file formats for background rendering
142         x = xmargin1;
143
144
145 // Renderfarm
146         add_subwindow(new BC_Bar(5, y, get_w() - 10));
147         y += 5;
148         add_subwindow(new BC_Title(x, y, _("Render Farm"), LARGEFONT, resources->text_default));
149         x1 = get_w() - BC_GenericButton::calculate_w(this, _("Reset rates")) - x;
150         add_subwindow(new PrefsRenderFarmReset(pwindow, this, x1, y));
151         x1 = x + xmargin4;
152         BC_Title *node_title = new BC_Title(x1, y, _("Nodes:"));
153         add_subwindow(node_title);
154         x1 += node_title->get_w() + 15;
155         sprintf(string, _(MASTER_NODE_FRAMERATE_TEXT),
156                 pwindow->thread->preferences->local_rate);
157         add_subwindow(master_rate = new BC_Title(x1, y, string));
158         add_subwindow(node_list = new PrefsRenderFarmNodes(pwindow, this, x + xmargin4, y+=25));
159         add_subwindow(new PrefsRenderFarm(pwindow, x, y+=5));
160         add_subwindow(new BC_Title(x, y+=30, _("Hostname:")));
161         add_subwindow(new BC_Title(x + xmargin3, y, _("Port:")));
162         add_subwindow(edit_node = new PrefsRenderFarmEditNode(pwindow, this, x, y+=25));
163         edit_port = new PrefsRenderFarmPort(pwindow, this, x+xmargin3, y);
164         edit_port->create_objects();
165
166         add_subwindow(new PrefsRenderFarmReplaceNode(pwindow, this, x, y+=30));
167         add_subwindow(new PrefsRenderFarmNewNode(pwindow, this, x+xmargin2, y));
168         add_subwindow(new PrefsRenderFarmSortNodes(pwindow, this, x, y+=30));
169         add_subwindow(new PrefsRenderFarmDelNode(pwindow, this, x+xmargin2, y));
170         add_subwindow(new BC_Title(x, y+=35, _("Client Watchdog Timeout:")));
171         renderfarm_watchdog = new PrefsRenderFarmWatchdog(pwindow, this, x+xmargin3, y-5);
172         renderfarm_watchdog->create_objects();
173         add_subwindow(new BC_Title(x, y+=35, _("Total jobs to create:")));
174         PrefsRenderFarmJobs *jobs = new PrefsRenderFarmJobs(pwindow, this,
175                 x + xmargin3, y-5);
176         jobs->create_objects();
177         y += jobs->get_h() + 5;
178         win = add_subwindow(new BC_Title(x, y,
179                 _("(overridden if new file at each label is checked)")));
180 //      y += win->get_h() + 5;
181 //      add_subwindow(new PrefsRenderFarmVFS(pwindow, this, x, y));
182 //      add_subwindow(new BC_Title(x, y,
183 //              _("Filesystem prefix on remote nodes:")));
184 //      add_subwindow(new PrefsRenderFarmMountpoint(pwindow, this, x + xmargin3, y));
185 //      y += 30;
186 }
187
188 void PerformancePrefs::generate_node_list()
189 {
190         int selected_row = node_list ? node_list->get_selection_number(0, 0) : -1;
191
192         for(int i = 0; i < TOTAL_COLUMNS; i++)
193                 nodes[i].remove_all_objects();
194
195         for(int i = 0;
196                 i < pwindow->thread->preferences->renderfarm_nodes.size();
197                 i++)
198         {
199                 BC_ListBoxItem *item;
200                 nodes[ENABLED_COLUMN].append(item = new BC_ListBoxItem(
201                         (char*)(pwindow->thread->preferences->renderfarm_enabled.get(i) ? "X" : " ")));
202                 if(i == selected_row) item->set_selected(1);
203
204                 nodes[HOSTNAME_COLUMN].append(item = new BC_ListBoxItem(
205                         pwindow->thread->preferences->renderfarm_nodes.get(i)));
206                 if(i == selected_row) item->set_selected(1);
207
208                 char string[BCTEXTLEN];
209                 sprintf(string, "%d", pwindow->thread->preferences->renderfarm_ports.get(i));
210                 nodes[PORT_COLUMN].append(item = new BC_ListBoxItem(string));
211                 if(i == selected_row) item->set_selected(1);
212
213                 sprintf(string, "%0.3f", pwindow->thread->preferences->renderfarm_rate.get(i));
214                 nodes[RATE_COLUMN].append(item = new BC_ListBoxItem(string));
215                 if(i == selected_row) item->set_selected(1);
216         }
217 }
218
219
220 static const char *default_titles[] = {
221         N_("On"), N_("Hostname"), N_("Port"), N_("Framerate")
222 };
223
224 static int default_widths[] = {
225         30, 150, 50, 50
226 };
227
228
229 void PerformancePrefs::update_node_list()
230 {
231         node_list->update_list();
232 }
233
234 void PrefsRenderFarmNodes::update_list()
235 {
236         update(subwindow->nodes, titles, widths, PerformancePrefs::TOTAL_COLUMNS,
237                 get_xposition(), get_yposition(), get_selection_number(0, 0));
238 }
239
240
241 void PerformancePrefs::update_rates()
242 {
243 //printf("PerformancePrefs::update_rates %d\n", __LINE__);
244         char string[BCTEXTLEN];
245         for(int i = 0;
246                 i < mwindow->preferences->renderfarm_rate.size();
247                 i++)
248         {
249                 if(i < nodes[RATE_COLUMN].size())
250                 {
251                         sprintf(string, "%0.3f", mwindow->preferences->renderfarm_rate.get(i));
252                         nodes[RATE_COLUMN].get(i)->set_text(string);
253                 }
254         }
255
256         sprintf(string, _(MASTER_NODE_FRAMERATE_TEXT),
257                 mwindow->preferences->local_rate);
258         master_rate->update(string);
259
260         update_node_list();
261 }
262
263
264 PrefsUseBRender::PrefsUseBRender(PreferencesWindow *pwindow,
265         int x,
266         int y)
267  : BC_CheckBox(x,
268         y,
269         pwindow->thread->preferences->use_brender,
270         _("Use background rendering"))
271 {
272         this->pwindow = pwindow;
273 }
274
275 int PrefsUseBRender::handle_event()
276 {
277         pwindow->thread->redraw_overlays = 1;
278         pwindow->thread->redraw_times = 1;
279         pwindow->thread->preferences->use_brender = get_value();
280         return 1;
281 }
282
283
284 PrefsBRenderFragment::PrefsBRenderFragment(PreferencesWindow *pwindow,
285         PerformancePrefs *subwindow, int x, int y)
286  : BC_TumbleTextBox(subwindow,
287         (int64_t)pwindow->thread->preferences->brender_fragment,
288         (int64_t)1, (int64_t)65535, x, y, 100)
289 {
290         this->pwindow = pwindow;
291 }
292 int PrefsBRenderFragment::handle_event()
293 {
294         pwindow->thread->preferences->brender_fragment = atol(get_text());
295         return 1;
296 }
297
298 CICacheSize::CICacheSize(int x, int y,
299         PreferencesWindow *pwindow, PerformancePrefs *subwindow)
300  : BC_TumbleTextBox(subwindow,
301         (int64_t)pwindow->thread->preferences->cache_size / 0x100000,
302         (int64_t)MIN_CACHE_SIZE / 0x100000,
303         (int64_t)MAX_CACHE_SIZE / 0x100000,
304         x, y, 100)
305 {
306         this->pwindow = pwindow;
307         set_increment(1);
308 }
309
310 int CICacheSize::handle_event()
311 {
312         int64_t result;
313         result = (int64_t)atol(get_text()) * 0x100000;
314         CLAMP(result, MIN_CACHE_SIZE, MAX_CACHE_SIZE);
315         pwindow->thread->preferences->cache_size = result;
316         return 0;
317 }
318
319
320 PrefsRenderPreroll::PrefsRenderPreroll(PreferencesWindow *pwindow,
321                 PerformancePrefs *subwindow,
322                 int x,
323                 int y)
324  : BC_TumbleTextBox(subwindow,
325         (float)pwindow->thread->preferences->render_preroll,
326         (float)0,
327         (float)100,
328         x,
329         y,
330         100)
331 {
332         this->pwindow = pwindow;
333         set_increment(0.1);
334 }
335 PrefsRenderPreroll::~PrefsRenderPreroll()
336 {
337 }
338 int PrefsRenderPreroll::handle_event()
339 {
340         pwindow->thread->preferences->render_preroll = atof(get_text());
341         return 1;
342 }
343
344
345 PrefsBRenderPreroll::PrefsBRenderPreroll(PreferencesWindow *pwindow,
346                 PerformancePrefs *subwindow,
347                 int x,
348                 int y)
349  : BC_TumbleTextBox(subwindow,
350         (int64_t)pwindow->thread->preferences->brender_preroll,
351         (int64_t)0,
352         (int64_t)100,
353         x,
354         y,
355         100)
356 {
357         this->pwindow = pwindow;
358 }
359 int PrefsBRenderPreroll::handle_event()
360 {
361         pwindow->thread->preferences->brender_preroll = atol(get_text());
362         return 1;
363 }
364
365
366 PrefsRenderFarm::PrefsRenderFarm(PreferencesWindow *pwindow, int x, int y)
367  : BC_CheckBox(x,
368         y,
369         pwindow->thread->preferences->use_renderfarm,
370         _("Use render farm"))
371 {
372         this->pwindow = pwindow;
373 }
374 PrefsRenderFarm::~PrefsRenderFarm()
375 {
376 }
377 int PrefsRenderFarm::handle_event()
378 {
379         pwindow->thread->preferences->use_renderfarm = get_value();
380         return 1;
381 }
382
383
384 PrefsForceUniprocessor::PrefsForceUniprocessor(PreferencesWindow *pwindow, int x, int y)
385  : BC_CheckBox(x,
386         y,
387         pwindow->thread->preferences->force_uniprocessor,
388         _("Force single processor use"))
389 {
390         this->pwindow = pwindow;
391 }
392 PrefsForceUniprocessor::~PrefsForceUniprocessor()
393 {
394 }
395 int PrefsForceUniprocessor::handle_event()
396 {
397         pwindow->thread->preferences->force_uniprocessor = get_value();
398         return 1;
399 }
400
401
402
403 PrefsRenderFarmConsolidate::PrefsRenderFarmConsolidate(PreferencesWindow *pwindow, int x, int y)
404  : BC_CheckBox(x,
405         y,
406         pwindow->thread->preferences->renderfarm_consolidate,
407         _("Consolidate output files on completion"))
408 {
409         this->pwindow = pwindow;
410 }
411 PrefsRenderFarmConsolidate::~PrefsRenderFarmConsolidate()
412 {
413 }
414 int PrefsRenderFarmConsolidate::handle_event()
415 {
416         pwindow->thread->preferences->renderfarm_consolidate = get_value();
417         return 1;
418 }
419
420
421 PrefsRenderFarmPort::PrefsRenderFarmPort(PreferencesWindow *pwindow,
422         PerformancePrefs *subwindow,
423         int x,
424         int y)
425  : BC_TumbleTextBox(subwindow,
426         (int64_t)pwindow->thread->preferences->renderfarm_port,
427         (int64_t)1,
428         (int64_t)65535,
429         x,
430         y,
431         100)
432 {
433         this->pwindow = pwindow;
434 }
435
436 PrefsRenderFarmPort::~PrefsRenderFarmPort()
437 {
438 }
439
440 int PrefsRenderFarmPort::handle_event()
441 {
442         pwindow->thread->preferences->renderfarm_port = atol(get_text());
443         return 1;
444 }
445
446
447
448 PrefsRenderFarmNodes::PrefsRenderFarmNodes(PreferencesWindow *pwindow,
449         PerformancePrefs *subwindow, int x, int y)
450  : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT, 0,0,0,1, 0,0, LISTBOX_MULTIPLE)
451 {
452         for( int i=0; i<PerformancePrefs::TOTAL_COLUMNS; ++i ) {
453                 titles[i] = _(default_titles[i]);
454                 widths[i] = default_widths[i];
455         }
456         update(subwindow->nodes, titles, widths, PerformancePrefs::TOTAL_COLUMNS,
457                 0, 0, -1, 0, 0);
458         this->subwindow = subwindow;
459         this->pwindow = pwindow;
460 }
461 PrefsRenderFarmNodes::~PrefsRenderFarmNodes()
462 {
463 }
464
465 int PrefsRenderFarmNodes::column_resize_event()
466 {
467         for( int i=0; i<PerformancePrefs::TOTAL_COLUMNS; ++i )
468                 widths[i] = get_column_width(i);
469         return 1;
470 }
471
472 int PrefsRenderFarmNodes::handle_event()
473 {
474 SET_TRACE
475         if(get_selection_number(0, 0) >= 0)
476         {
477                 subwindow->hot_node = get_selection_number(1, 0);
478                 subwindow->edit_node->update(get_selection(1, 0)->get_text());
479                 const char *text = get_selection(2, 0)->get_text();
480                 subwindow->edit_port->update(text);
481                 pwindow->thread->preferences->renderfarm_port = atol(text);
482                 if(get_cursor_x() < widths[0])
483                 {
484                         pwindow->thread->preferences->renderfarm_enabled.values[subwindow->hot_node] =
485                                 !pwindow->thread->preferences->renderfarm_enabled.values[subwindow->hot_node];
486                         subwindow->generate_node_list();
487                         subwindow->update_node_list();
488                 }
489         }
490         else
491         {
492                 subwindow->hot_node = -1;
493                 subwindow->edit_node->update("");
494         }
495 SET_TRACE
496         return 1;
497 }
498 int PrefsRenderFarmNodes::selection_changed()
499 {
500         handle_event();
501         return 1;
502 }
503
504
505 PrefsRenderFarmEditNode::PrefsRenderFarmEditNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
506  : BC_TextBox(x, y, 240, 1, "")
507 {
508         this->pwindow = pwindow;
509         this->subwindow = subwindow;
510 }
511
512 PrefsRenderFarmEditNode::~PrefsRenderFarmEditNode()
513 {
514 }
515
516 int PrefsRenderFarmEditNode::handle_event()
517 {
518         return 1;
519 }
520
521
522 PrefsRenderFarmNewNode::PrefsRenderFarmNewNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
523  : BC_GenericButton(x, y, _("Add Nodes"))
524 {
525         this->pwindow = pwindow;
526         this->subwindow = subwindow;
527 }
528 PrefsRenderFarmNewNode::~PrefsRenderFarmNewNode()
529 {
530 }
531 int PrefsRenderFarmNewNode::handle_event()
532 {
533         const char *name = subwindow->edit_node->get_text();
534         char *cp = (char*)subwindow->edit_port->get_text();
535         int64_t start_port = strtol(cp, &cp, 0), end_port = start_port;
536         while( isspace(*cp) ) ++cp;
537         if( *cp++ == '-' )
538                 end_port = strtol(cp, &cp, 0);
539         for( int port=start_port; port<=end_port; ++port ) {
540                 pwindow->thread->preferences->add_node(name, port, 1, 0.0);
541         }
542         pwindow->thread->preferences->renderfarm_port = end_port;
543         subwindow->edit_port->update(end_port);
544         pwindow->thread->preferences->reset_rates();
545         subwindow->generate_node_list();
546         subwindow->update_node_list();
547         subwindow->hot_node = -1;
548         return 1;
549 }
550
551
552 PrefsRenderFarmReplaceNode::PrefsRenderFarmReplaceNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
553  : BC_GenericButton(x, y, _("Apply Changes"))
554 {
555         this->pwindow = pwindow;
556         this->subwindow = subwindow;
557 }
558 PrefsRenderFarmReplaceNode::~PrefsRenderFarmReplaceNode()
559 {
560 }
561 int PrefsRenderFarmReplaceNode::handle_event()
562 {
563         if(subwindow->hot_node >= 0)
564         {
565                 pwindow->thread->preferences->edit_node(subwindow->hot_node,
566                         subwindow->edit_node->get_text(),
567                         pwindow->thread->preferences->renderfarm_port,
568                         pwindow->thread->preferences->renderfarm_enabled.values[subwindow->hot_node]);
569                 subwindow->generate_node_list();
570                 subwindow->update_node_list();
571         }
572         return 1;
573 }
574
575
576 PrefsRenderFarmDelNode::PrefsRenderFarmDelNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
577  : BC_GenericButton(x, y, _("Delete Nodes"))
578 {
579         this->pwindow = pwindow;
580         this->subwindow = subwindow;
581 }
582 PrefsRenderFarmDelNode::~PrefsRenderFarmDelNode()
583 {
584 }
585 int PrefsRenderFarmDelNode::handle_event()
586 {
587         ArrayList<BC_ListBoxItem *> &item_list = subwindow->nodes[0];
588         for( int i=item_list.size(); --i>=0; ) {
589                 if( !item_list[i]->get_selected() ) continue;
590                 pwindow->thread->preferences->delete_node(i);
591         }
592         subwindow->generate_node_list();
593         subwindow->update_node_list();
594         subwindow->hot_node = -1;
595         return 1;
596 }
597
598
599 PrefsRenderFarmSortNodes::PrefsRenderFarmSortNodes(PreferencesWindow *pwindow,
600         PerformancePrefs *subwindow,
601         int x,
602         int y)
603  : BC_GenericButton(x, y, _("Sort nodes"))
604 {
605         this->pwindow = pwindow;
606         this->subwindow = subwindow;
607 }
608
609 PrefsRenderFarmSortNodes::~PrefsRenderFarmSortNodes()
610 {
611 }
612
613 int PrefsRenderFarmSortNodes::handle_event()
614 {
615         pwindow->thread->preferences->sort_nodes();
616         subwindow->generate_node_list();
617         subwindow->update_node_list();
618         subwindow->hot_node = -1;
619         return 1;
620 }
621
622
623 PrefsRenderFarmReset::PrefsRenderFarmReset(PreferencesWindow *pwindow,
624         PerformancePrefs *subwindow, int x, int y)
625  : BC_GenericButton(x, y, _("Reset rates"))
626 {
627         this->pwindow = pwindow;
628         this->subwindow = subwindow;
629 }
630
631 int PrefsRenderFarmReset::handle_event()
632 {
633         pwindow->thread->preferences->reset_rates();
634         subwindow->generate_node_list();
635         subwindow->update_node_list();
636
637         char string[BCTEXTLEN];
638         sprintf(string,
639                 _(MASTER_NODE_FRAMERATE_TEXT),
640                 pwindow->thread->preferences->local_rate);
641         subwindow->master_rate->update(string);
642         subwindow->hot_node = -1;
643         return 1;
644 }
645
646
647 PrefsProjectSMP::PrefsProjectSMP(PreferencesWindow *pwindow,
648                 PerformancePrefs *subwindow, int x, int y)
649  : BC_TumbleTextBox(subwindow,
650         (int64_t)pwindow->thread->preferences->project_smp,
651         (int64_t)1, (int64_t)100, x, y, 100)
652 {
653         this->pwindow = pwindow;
654 }
655 PrefsProjectSMP::~PrefsProjectSMP()
656 {
657 }
658 int PrefsProjectSMP::handle_event()
659 {
660         pwindow->thread->preferences->project_smp = atol(get_text());
661         return 1;
662 }
663
664
665 PrefsRenderFarmJobs::PrefsRenderFarmJobs(PreferencesWindow *pwindow,
666                 PerformancePrefs *subwindow,
667                 int x,
668                 int y)
669  : BC_TumbleTextBox(subwindow,
670         (int64_t)pwindow->thread->preferences->renderfarm_job_count,
671         (int64_t)1, (int64_t)100, x, y, 100)
672 {
673         this->pwindow = pwindow;
674 }
675 PrefsRenderFarmJobs::~PrefsRenderFarmJobs()
676 {
677 }
678 int PrefsRenderFarmJobs::handle_event()
679 {
680         pwindow->thread->preferences->renderfarm_job_count = atol(get_text());
681         return 1;
682 }
683
684
685 PrefsRenderFarmMountpoint::PrefsRenderFarmMountpoint(PreferencesWindow *pwindow,
686                 PerformancePrefs *subwindow, int x, int y)
687  : BC_TextBox(x, y, 100, 1,
688         pwindow->thread->preferences->renderfarm_mountpoint)
689 {
690         this->pwindow = pwindow;
691         this->subwindow = subwindow;
692 }
693 PrefsRenderFarmMountpoint::~PrefsRenderFarmMountpoint()
694 {
695 }
696 int PrefsRenderFarmMountpoint::handle_event()
697 {
698         strcpy(pwindow->thread->preferences->renderfarm_mountpoint, get_text());
699         return 1;
700 }
701
702
703 PrefsRenderFarmVFS::PrefsRenderFarmVFS(PreferencesWindow *pwindow,
704         PerformancePrefs *subwindow, int x, int y)
705  : BC_CheckBox(x, y, pwindow->thread->preferences->renderfarm_vfs,
706         _("Use virtual filesystem"))
707 {
708         this->pwindow = pwindow;
709         this->subwindow = subwindow;
710 }
711
712 int PrefsRenderFarmVFS::handle_event()
713 {
714         pwindow->thread->preferences->renderfarm_vfs = get_value();
715         return 1;
716 }
717
718
719 PrefsRenderFarmWatchdog::PrefsRenderFarmWatchdog(PreferencesWindow *pwindow,
720                 PerformancePrefs *subwindow, int x, int y)
721  : BC_TumbleTextBox(subwindow,
722         (int64_t)pwindow->thread->preferences->renderfarm_watchdog_timeout,
723         (int64_t)0, (int64_t)1000, x, y, 100)
724 {
725         this->pwindow = pwindow;
726         set_increment(15);
727 }
728
729 int PrefsRenderFarmWatchdog::handle_event()
730 {
731         pwindow->thread->preferences->renderfarm_watchdog_timeout = atol(get_text());
732         return 1;
733 }
734
735