add proxy
[goodguy/history.git] / cinelerra-5.1 / cinelerra / proxy.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2015 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 "assets.h"
23 #include "bcsignals.h"
24 #include "clip.h"
25 #include "confirmsave.h"
26 #include "cstrdup.h"
27 #include "edl.h"
28 #include "edlsession.h"
29 #include "errorbox.h"
30 #include "file.h"
31 #include "filesystem.h"
32 #include "formattools.h"
33 #include "language.h"
34 #include "mainprogress.h"
35 #include "mainundo.h"
36 #include "mutex.h"
37 #include "mwindow.h"
38 #include "mwindowgui.h"
39 #include "overlayframe.h"
40 #include "preferences.h"
41 #include "proxy.h"
42 #include "theme.h"
43
44 #define WIDTH 400
45 #define HEIGHT 320
46 #define MAX_SCALE 16
47
48 ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
49  : BC_MenuItem(_("Proxy settings..."),  _("Alt-P"), 'p')
50 {
51         this->mwindow = mwindow;
52         set_alt();
53 }
54
55 void ProxyMenuItem::create_objects()
56 {
57         thread = new ProxyThread(mwindow);
58 }
59
60 int ProxyMenuItem::handle_event()
61 {
62         mwindow->gui->unlock_window();
63         thread->start();
64         mwindow->gui->lock_window("ProxyMenuItem::handle_event");
65
66         return 1;
67 }
68
69 ProxyThread::ProxyThread(MWindow *mwindow)
70 {
71         this->mwindow = mwindow;
72         gui = 0;
73         asset = new Asset;
74         progress = 0;
75         counter_lock = new Mutex("ProxyThread::counter_lock");
76         bzero(size_text, sizeof(char*) * MAX_SIZES);
77         bzero(size_factors, sizeof(int) * MAX_SIZES);
78         total_sizes = 0;
79 }
80 ProxyThread::~ProxyThread()
81 {
82         for( int i=0; i<MAX_SIZES; ++i )
83                 if( size_text[i] ) delete [] size_text[i];
84 }
85
86 BC_Window* ProxyThread::new_gui()
87 {
88         asset->format = FILE_FFMPEG;
89         asset->load_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
90         mwindow->gui->lock_window("ProxyThread::new_gui");
91         int x = mwindow->gui->get_abs_cursor_x(0) - WIDTH / 2;
92         int y = mwindow->gui->get_abs_cursor_y(0) - HEIGHT / 2;
93
94         gui = new ProxyWindow(mwindow, this, x, y);
95         gui->create_objects();
96         mwindow->gui->unlock_window();
97         return gui;
98 }
99
100 void ProxyThread::scale_to_text(char *string, int scale)
101 {
102         calculate_sizes();
103         strcpy(string, size_text[0]);
104         for( int i = 0; i < total_sizes; i++ ) {
105                 if( scale == size_factors[i] ) {
106                         strcpy(string, size_text[i]);
107                         break;
108                 }
109         }
110 }
111
112
113 void ProxyThread::calculate_sizes()
114 {
115 // delete old values
116         for( int i = 0; i < MAX_SIZES; i++ ) {
117                 if( size_text[i] ) delete [] size_text[i];
118         }
119         bzero(size_text, sizeof(char*) * MAX_SIZES);
120         bzero(size_factors, sizeof(int) * MAX_SIZES);
121
122         int orig_w = mwindow->edl->session->output_w * orig_scale;
123         int orig_h = mwindow->edl->session->output_h * orig_scale;
124         total_sizes = 0;
125         
126         size_text[0] = cstrdup(_("Original size"));
127         size_factors[0] = 1;
128         
129         int current_factor = 2;
130         total_sizes = 1;
131         for( current_factor = 2; current_factor < MAX_SCALE; current_factor++ ) {
132                 if( current_factor * (orig_w / current_factor) == orig_w &&
133                         current_factor * (orig_h / current_factor) == orig_h ) {
134 //printf("ProxyThread::calculate_sizes %d\n", current_factor);
135                         char string[BCTEXTLEN];
136                         sprintf(string, "1/%d", current_factor);
137                         size_text[total_sizes] = cstrdup(string);
138                         size_factors[total_sizes] = current_factor;
139                         total_sizes++;
140                 }
141                 
142                 current_factor++;
143         }
144 }
145
146 void ProxyThread::handle_close_event(int result)
147 {
148         asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0); 
149
150         if( !result ) {
151                 to_proxy();
152         }
153 }
154
155 void ProxyThread::to_proxy()
156 {
157 // test for new files
158         ArrayList<char *> confirm_paths;
159         confirm_paths.set_array_delete();
160 // all proxy assets
161         ArrayList<Indexable*> proxy_assets;
162 // assets which must be created
163         ArrayList<Asset*> needed_assets;
164 // original assets
165         ArrayList<Indexable*> orig_assets;
166 // original assets which match the needed_assets
167         ArrayList<Asset*> needed_orig_assets;
168         Asset *proxy_asset = 0;
169         Asset *orig_asset = 0;
170
171         mwindow->edl->Garbage::add_user();
172         mwindow->save_backup();
173         mwindow->undo->update_undo_before(_("proxy"), this);
174
175 // revert project to original size from current size
176         if( mwindow->edl->session->proxy_scale > 1 ) {
177                 for( orig_asset = mwindow->edl->assets->first;
178                         orig_asset;
179                         orig_asset = orig_asset->next ) {
180                         char new_path[BCTEXTLEN];
181                         to_proxy_path(new_path, orig_asset, mwindow->edl->session->proxy_scale);
182
183 // test if proxy asset was already added to proxy assets
184                         int got_it = 0;
185                         proxy_asset = 0;
186                         for( int i = 0; i < proxy_assets.size(); i++ ) {
187                                 if( !strcmp(proxy_assets.get(i)->path, new_path) ) {
188                                         got_it = 1;
189                                         break;
190                                 }
191                         }
192
193 // add pointer to existing EDL asset if it exists
194 // EDL won't delete it unless it's the same pointer.
195                         if( !got_it ) {
196                                 proxy_asset = mwindow->edl->assets->get_asset(new_path);
197
198                                 if( proxy_asset ) {
199                                         proxy_assets.append(proxy_asset);
200                                         proxy_asset->Garbage::add_user();
201
202                                         orig_assets.append(orig_asset);
203                                         orig_asset->Garbage::add_user();
204                                 }
205
206                         }
207                 }
208
209 // convert from the proxy assets to the original assets
210                 mwindow->set_proxy(1, &proxy_assets, &orig_assets);
211
212 // remove the proxy assets
213                 mwindow->remove_assets_from_project(0, 0, &proxy_assets, NULL);
214
215
216                 for( int i = 0; i < proxy_assets.size(); i++ ) {
217                         proxy_assets.get(i)->Garbage::remove_user();
218                 }
219                 proxy_assets.remove_all();
220
221                 for( int i = 0; i < orig_assets.size(); i++ ) {
222                         orig_assets.get(i)->Garbage::remove_user();
223                 }
224                 orig_assets.remove_all();
225         }
226
227 // convert to new size if not original size
228         if( new_scale != 1 ) {
229                 for( orig_asset = mwindow->edl->assets->first;
230                         orig_asset;
231                         orig_asset = orig_asset->next ) {
232                         if( orig_asset->video_data ) {
233                                 char new_path[BCTEXTLEN];
234                                 to_proxy_path(new_path, orig_asset, new_scale);
235 // add to proxy_assets & orig_assets if it isn't already there.
236                                 int got_it = 0;
237                                 proxy_asset = 0;
238                                 for( int i = 0; i < proxy_assets.size(); i++ ) {
239                                         if( !strcmp(proxy_assets.get(i)->path, new_path) ) {
240                                                 got_it = 1;
241                                                 proxy_asset = (Asset*)proxy_assets.get(i);
242                                                 break;
243                                         }
244                                 }
245
246                                 if( !got_it ) {
247                                         proxy_asset = new Asset;
248 // new compression parameters
249                                         proxy_asset->copy_format(asset, 0);
250                                         proxy_asset->update_path(new_path);
251                                         proxy_asset->audio_data = 0;
252                                         proxy_asset->video_data = 1;
253                                         proxy_asset->layers = 1;
254                                         proxy_asset->width = orig_asset->width / new_scale;
255                                         proxy_asset->height = orig_asset->height / new_scale;
256                                         proxy_asset->frame_rate = orig_asset->frame_rate;
257                                         proxy_asset->video_length = orig_asset->video_length;
258                                         
259                                         proxy_assets.append(proxy_asset);
260                                         orig_asset->add_user();
261                                         orig_assets.append(orig_asset);
262                                 }
263
264 // test if proxy file exists.
265                                 int exists = 0;
266                                 FILE *fd = fopen(new_path, "r");
267                                 if( fd ) {
268                                         got_it = 1;
269                                         exists = 1;
270                                         fclose(fd);
271
272                                         FileSystem fs;
273 // test if proxy file is newer than original.
274                                         if( fs.get_date(new_path) < fs.get_date(asset->path) ) {
275                                                 got_it = 0;
276                                         }
277                                 }
278                                 else {
279 // proxy doesn't exist
280                                         got_it = 0;
281                                 }
282
283                                 if( !got_it ) {
284 // prompt user to overwrite
285                                         if( exists ) {
286                                                 confirm_paths.append(cstrdup(new_path));
287                                         }
288
289                                         needed_assets.append(proxy_asset);
290                                         proxy_asset->add_user();
291                                         needed_orig_assets.append(orig_asset);
292                                         orig_asset->add_user();
293                                 }
294 //printf("ProxyThread::handle_close_event %d %s\n", __LINE__, new_path);
295                         }
296                 }
297
298 // test for existing files
299                 int result = 0;
300                 if( confirm_paths.size() ) {
301                         result = ConfirmSave::test_files(mwindow, &confirm_paths);
302                         confirm_paths.remove_all_objects();
303                 }
304
305                 if( !result ) {
306                         int canceled = 0;
307                         failed = 0;
308
309 // create proxy assets which don't already exist
310                         if( needed_orig_assets.size() > 0 ) {
311                                 int64_t total_len = 0;
312                                 for( int i = 0; i < needed_orig_assets.size(); i++ )
313                                         total_len += needed_orig_assets.get(i)->video_length;
314 // start progress bar.  MWindow is locked inside this
315                                 progress = mwindow->mainprogress->
316                                         start_progress(_("Creating proxy files..."), total_len);
317                                 total_rendered = 0;
318
319                                 ProxyFarm engine(mwindow, 
320                                         this, 
321                                         &needed_assets,
322                                         &needed_orig_assets);
323                                 engine.process_packages();
324
325 printf("failed=%d canceled=%d\n", failed, progress->is_cancelled());
326
327         // stop progress bar
328                                 canceled = progress->is_cancelled();
329                                 progress->stop_progress();
330                                 delete progress;
331                                 progress = 0;
332
333                                 if( failed && !canceled ) {
334                                         ErrorBox error_box(PROGRAM_NAME ": Error",
335                                                 mwindow->gui->get_abs_cursor_x(1),
336                                                 mwindow->gui->get_abs_cursor_y(1));
337                                         error_box.create_objects(_("Error making proxy."));
338                                         error_box.raise_window();
339                                         error_box.run_window();
340                                 }
341                         }
342
343 // resize project
344                         if( !failed && !canceled ) {
345                                 mwindow->set_proxy(new_scale, &orig_assets, &proxy_assets);
346                         }
347                 }
348
349                 for( int i = 0; i < proxy_assets.size(); i++ ) {
350                         proxy_assets.get(i)->Garbage::remove_user();
351                 }
352
353                 for( int i = 0; i < orig_assets.size(); i++ ) {
354                         orig_assets.get(i)->Garbage::remove_user();
355                 }
356
357                 for( int i = 0; i < needed_assets.size(); i++ ) {
358                         needed_assets.get(i)->Garbage::remove_user();
359                 }
360
361                 for( int i = 0; i < needed_orig_assets.size(); i++ ) {
362                         needed_orig_assets.get(i)->Garbage::remove_user();
363                 }
364         }
365
366         mwindow->undo->update_undo_after(_("proxy"), LOAD_ALL);
367
368         mwindow->edl->Garbage::remove_user();
369
370         mwindow->restart_brender();
371
372         mwindow->gui->lock_window("ProxyThread::to_proxy");
373         mwindow->update_project(LOAD_ALL);
374         mwindow->gui->unlock_window();
375 }
376
377
378 void ProxyThread::to_proxy_path(char *new_path, Asset *asset, int scale)
379 {
380         strcpy(new_path, asset->path);
381         char prxy[BCTEXTLEN];
382         sprintf(prxy, ".proxy%d", scale);
383 // path is already a proxy
384         if( strstr(new_path, prxy) ) return;
385         int len = strlen(new_path);
386 // insert proxy prxy
387         char *ptr = strrchr(new_path, '.');
388         if( ptr ) {
389                 char *cp = new_path + len;
390                 int n = strlen(prxy);
391                 char *bp = cp + n;
392                 for( *bp=0; cp>ptr; ) *--bp = *--cp;
393                 for( cp= prxy+n; bp>ptr; ) *--bp = *--cp;
394 //printf("ProxyThread::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
395         }
396         else
397                 strcpy(new_path+len, prxy);
398 }
399
400 void ProxyThread::from_proxy_path(char *new_path, Asset *asset, int scale)
401 {
402         char prxy[BCTEXTLEN];
403         sprintf(prxy, ".proxy%d", scale);
404         strcpy(new_path, asset->path);
405         char *ptr = strstr(asset->path, prxy);
406         if( !ptr ) return;
407         int n = strlen(prxy);
408         for( char *cp=ptr+n; --n>=0; ++ptr,++cp ) *ptr = *cp;
409         *ptr = 0;
410 }
411
412 void ProxyThread::update_progress()
413 {
414         counter_lock->lock();
415         total_rendered++;
416         counter_lock->unlock();
417         progress->update(total_rendered);
418 }
419
420 int ProxyThread::is_canceled()
421 {
422         return progress->is_cancelled();
423 }
424
425
426
427 ProxyWindow::ProxyWindow(MWindow *mwindow, ProxyThread *thread, int x, int y)
428  : BC_Window(_(PROGRAM_NAME ": Proxy settings"), x, y, WIDTH, HEIGHT,
429                 -1, -1, 0, 0, 1)
430 {
431         this->mwindow = mwindow;
432         this->thread = thread;
433         format_tools = 0;
434 }
435
436 ProxyWindow::~ProxyWindow()
437 {
438         lock_window("ProxyWindow::~ProxyWindow");
439         delete format_tools;
440         unlock_window();
441 }
442
443
444 void ProxyWindow::create_objects()
445 {
446         lock_window("ProxyWindow::create_objects");
447         
448         int margin = mwindow->theme->widget_border;
449         int x = margin;
450         int y = margin;
451         thread->orig_scale = 
452                 thread->new_scale = 
453                 mwindow->edl->session->proxy_scale;
454         
455         BC_Title *text;
456         add_subwindow(text = new BC_Title(x, y, 
457                 _("What size should the project\n"
458                   "be scaled to for editing?")));
459         y += text->get_h() * 2 + margin;
460         
461         
462         add_subwindow(text = new BC_Title(x, y, _("Scale factor:")));
463         x += text->get_w() + margin;
464
465
466         thread->calculate_sizes();
467         int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, thread->size_text[0]));
468         add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, ""));
469         for( int i = 0; i < thread->total_sizes; i++ ) {
470                 scale_factor->add_item(new BC_MenuItem(thread->size_text[i]));
471         }
472         x += scale_factor->get_w() + margin;
473         
474         ProxyTumbler *tumbler;
475         add_subwindow(tumbler = new ProxyTumbler(mwindow, this, x, y));
476
477         x = margin;
478         y += tumbler->get_h() + margin;
479         ProxyReset *reset;
480         add_subwindow(reset = new ProxyReset(mwindow, this, x, y));
481         
482         y += reset->get_h() * 2 + margin;
483         x = margin;
484         add_subwindow(text = new BC_Title(x, y, _("New project dimensions: ")));
485         x += text->get_w() + margin;
486         add_subwindow(new_dimensions = new BC_Title(x, y, ""));
487
488         x = margin;
489         y += new_dimensions->get_h() * 2 + margin;
490
491
492         format_tools = new FormatTools(mwindow, this, thread->asset);
493         format_tools->create_objects(x, y, 0, 1, 0, 0, 0, 1, 0, 1, // skip the path
494                 0, 0);
495
496         update();
497                 
498         add_subwindow(new BC_OKButton(this));
499         add_subwindow(new BC_CancelButton(this));
500         show_window(1);
501         unlock_window();
502 }
503
504 void ProxyWindow::update()
505 {
506 // preview the new size
507         char string[BCTEXTLEN];
508 //printf("ProxyWindow::update %d %d %d %d %d\n", 
509 // __LINE__, mwindow->edl->session->output_w, mwindow->edl->session->output_h,
510 // thread->orig_scale, thread->new_scale);
511         int orig_w = mwindow->edl->session->output_w * thread->orig_scale;
512         int orig_h = mwindow->edl->session->output_h * thread->orig_scale;
513         sprintf(string, "%dx%d", 
514                 orig_w / thread->new_scale, orig_h / thread->new_scale);
515         new_dimensions->update(string);
516         thread->scale_to_text(string, thread->new_scale);
517         scale_factor->set_text(string);
518 }
519
520
521 ProxyReset::ProxyReset(MWindow *mwindow, ProxyWindow *pwindow, int x, int y)
522  : BC_GenericButton(x, y, _("Reset"))
523 {
524         this->mwindow = mwindow;
525         this->pwindow = pwindow;
526 }
527
528 int ProxyReset::handle_event()
529 {
530         pwindow->thread->new_scale = pwindow->thread->orig_scale;
531         pwindow->update();
532         return 1;
533 }
534
535
536 ProxyMenu::ProxyMenu(MWindow *mwindow, ProxyWindow *pwindow,
537                 int x, int y, int w, const char *text)
538  : BC_PopupMenu(x, y, w, text, 1)
539 {
540         this->mwindow = mwindow;
541         this->pwindow = pwindow;
542 }
543
544 int ProxyMenu::handle_event()
545 {
546         for( int i = 0; i < pwindow->thread->total_sizes; i++ ) {
547                 if( !strcmp(get_text(), pwindow->thread->size_text[i]) ) {
548                         pwindow->thread->new_scale = pwindow->thread->size_factors[i];
549                         pwindow->update();
550                         break;
551                 }
552         }
553         return 1;
554 }
555
556
557 ProxyTumbler::ProxyTumbler(MWindow *mwindow, ProxyWindow *pwindow, int x, int y)
558  : BC_Tumbler(x, y, 0)
559 {
560         this->mwindow = mwindow;
561         this->pwindow = pwindow;
562 }
563
564 int ProxyTumbler::handle_up_event()
565 {
566         if( pwindow->thread->new_scale > 1 ) {
567                 int i;
568                 for( i = 0; i < pwindow->thread->total_sizes; i++ ) {
569                         if( pwindow->thread->new_scale == pwindow->thread->size_factors[i] ) {
570                                 i--;
571                                 pwindow->thread->new_scale = pwindow->thread->size_factors[i];
572                                 pwindow->update();
573                                 return 1;
574                         }
575                 }               
576         }
577
578         return 0;
579 }
580
581 int ProxyTumbler::handle_down_event()
582 {
583         int i;
584         for( i = 0; i < pwindow->thread->total_sizes - 1; i++ ) {
585                 if( pwindow->thread->new_scale == pwindow->thread->size_factors[i] ) {
586                         i++;
587                         pwindow->thread->new_scale = pwindow->thread->size_factors[i];
588                         pwindow->update();
589                         return 1;
590                 }
591         }
592
593         return 0;
594 }
595
596
597 ProxyPackage::ProxyPackage()
598  : LoadPackage()
599 {
600 }
601
602 ProxyClient::ProxyClient(MWindow *mwindow, ProxyThread *thread, ProxyFarm *server)
603  : LoadClient(server)
604 {
605         this->mwindow = mwindow;
606         this->thread = thread;
607 }
608
609 void ProxyClient::process_package(LoadPackage *ptr)
610 {
611         ProxyPackage *package = (ProxyPackage*)ptr;
612         if( thread->failed ) return;
613
614         File src_file;
615         File dst_file;
616         EDL *edl = mwindow->edl;
617         Preferences *preferences = mwindow->preferences;
618         int processors = 1;
619
620         int result;
621         src_file.set_processors(processors);
622         src_file.set_preload(edl->session->playback_preload);
623         src_file.set_subtitle(edl->session->decode_subtitles ? 
624                 edl->session->subtitle_number : -1);
625         src_file.set_interpolate_raw(edl->session->interpolate_raw);
626         src_file.set_white_balance_raw(edl->session->white_balance_raw);
627
628 //printf("%s %s\n", package->orig_asset->path, package->proxy_asset->path);
629
630
631         result = src_file.open_file(preferences, package->orig_asset, 1, 0);
632         if( result ) {
633 // go to the next asset if the reader fails
634 //              thread->failed = 1;
635                 return;
636         }
637         
638         dst_file.set_processors(processors);
639         result = dst_file.open_file(preferences, package->proxy_asset, 0, 1);
640         if( result ) {
641                 thread->failed = 1;
642                 return;
643         }
644         
645         dst_file.start_video_thread(1, edl->session->color_model,
646                         processors > 1 ? 2 : 1, 0);
647         
648         VFrame src_frame(0, -1,
649                 package->orig_asset->width, package->orig_asset->height, 
650                 edl->session->color_model, -1);
651         
652         OverlayFrame scaler(processors);
653
654         for( int64_t i = 0; i < package->orig_asset->video_length &&
655              !thread->failed && !thread->is_canceled(); i++ ) {
656                 src_file.set_video_position(i, 0);
657                 result = src_file.read_frame(&src_frame);
658 //printf("result=%d\n", result);
659
660                 if( result ) {
661 // go to the next asset if the reader fails
662 //                      thread->failed = 1;
663                         break;
664                 }
665
666 // have to write after getting the video buffer or it locks up
667                 VFrame ***dst_frames = dst_file.get_video_buffer();
668                 VFrame *dst_frame = dst_frames[0][0];
669                 scaler.overlay(dst_frame, &src_frame,
670                         0, 0, src_frame.get_w(), src_frame.get_h(),
671                         0, 0, dst_frame->get_w(), dst_frame->get_h(),
672                         1.0, TRANSFER_REPLACE, NEAREST_NEIGHBOR);
673                 result = dst_file.write_video_buffer(1);
674                 if( result ) {
675 // only fail if the writer fails
676                         thread->failed = 1;
677                         break;
678                 }
679                 else {
680                         thread->update_progress();
681                 }
682         }
683 }
684
685
686 ProxyFarm::ProxyFarm(MWindow *mwindow, ProxyThread *thread,
687         ArrayList<Asset*> *proxy_assets, ArrayList<Asset*> *orig_assets)
688  : LoadServer(MIN(mwindow->preferences->processors, proxy_assets->size()), 
689         proxy_assets->size())
690 {
691         this->mwindow = mwindow;
692         this->thread = thread;
693         this->proxy_assets = proxy_assets;
694         this->orig_assets = orig_assets;
695 }
696
697 void ProxyFarm::init_packages()
698 {
699         for( int i = 0; i < get_total_packages(); i++ ) {
700         ProxyPackage *package = (ProxyPackage*)get_package(i);
701         package->proxy_asset = proxy_assets->get(i);
702                 package->orig_asset = orig_assets->get(i);
703         }
704 }
705
706 LoadClient* ProxyFarm::new_client()
707 {
708         return new ProxyClient(mwindow, thread, this);
709 }
710
711 LoadPackage* ProxyFarm::new_package()
712 {
713         return new ProxyPackage;
714 }
715