4 * Copyright (C) 2015 Adam Williams <broadcast at earthling dot net>
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.
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.
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
23 #include "audiodevice.h"
24 #include "bcsignals.h"
29 #include "edlsession.h"
32 #include "filesystem.h"
33 #include "formattools.h"
35 #include "mainerror.h"
36 #include "mainindexes.h"
37 #include "mainprogress.h"
41 #include "mwindowgui.h"
42 #include "overlayframe.h"
43 #include "preferences.h"
45 #include "renderengine.h"
47 #include "transportque.h"
51 #define HEIGHT yS(330)
54 ProxyMenuItem::ProxyMenuItem(MWindow *mwindow)
55 : BC_MenuItem(_("Proxy settings..."), _("Alt-r"), 'r')
57 this->mwindow = mwindow;
61 ProxyMenuItem::~ProxyMenuItem()
66 void ProxyMenuItem::create_objects()
68 dialog = new ProxyDialog(mwindow);
71 int ProxyMenuItem::handle_event()
73 mwindow->gui->unlock_window();
75 mwindow->gui->lock_window("ProxyMenuItem::handle_event");
80 ProxyDialog::ProxyDialog(MWindow *mwindow)
82 this->mwindow = mwindow;
86 // quicker than some, not as good as others
87 asset->format = FILE_FFMPEG;
88 strcpy(asset->fformat, "mpeg");
89 strcpy(asset->vcodec, "mpeg.mpeg");
90 asset->ff_video_bitrate = 2000000;
91 asset->video_data = 1;
93 bzero(size_text, sizeof(char*) * MAX_SIZES);
94 bzero(size_factors, sizeof(int) * MAX_SIZES);
95 size_text[0] = cstrdup(_("Original size"));
100 ProxyDialog::~ProxyDialog()
103 for( int i=0; i<MAX_SIZES; ++i ) delete [] size_text[i];
104 asset->remove_user();
107 BC_Window* ProxyDialog::new_gui()
109 asset->format = FILE_FFMPEG;
110 asset->load_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
111 mwindow->gui->lock_window("ProxyDialog::new_gui");
113 mwindow->gui->get_abs_cursor(cx, cy);
114 gui = new ProxyWindow(mwindow, this, cx - WIDTH/2, cy - HEIGHT/2);
115 gui->create_objects();
116 mwindow->gui->unlock_window();
120 void ProxyDialog::scale_to_text(char *string, int scale)
122 strcpy(string, size_text[0]);
123 for( int i = 0; i < total_sizes; i++ ) {
124 if( scale == size_factors[i] ) {
125 strcpy(string, size_text[i]);
132 void ProxyDialog::calculate_sizes()
134 for( int i=1; i<total_sizes; ++i ) {
135 delete [] size_text[i];
142 // w,h should stay even for yuv
143 int ow = orig_w, oh = orig_h;
144 if( BC_CModels::is_yuv(mwindow->edl->session->color_model) ) {
147 for( int i=2; i<MAX_SCALE; ++i ) {
148 if( (ow % i) != 0 ) continue;
149 if( (oh % i) != 0 ) continue;
150 size_factors[total_sizes++] = i;
154 size_factors[total_sizes++] = 2; size_factors[total_sizes++] = 3;
155 size_factors[total_sizes++] = 8; size_factors[total_sizes++] = 12;
156 size_factors[total_sizes++] = 16; size_factors[total_sizes++] = 24;
157 size_factors[total_sizes++] = 32;
159 for( int i=1; i<total_sizes; ++i ) {
160 char string[BCTEXTLEN];
161 sprintf(string, "1/%d", size_factors[i]);
162 size_text[i] = cstrdup(string);
166 void ProxyDialog::handle_close_event(int result)
169 if( !File::renders_video(asset) ) {
170 eprintf(_("Specified format does not render video"));
173 mwindow->edl->session->proxy_auto_scale = auto_scale;
174 mwindow->edl->session->proxy_beep = beep;
175 asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
176 result = mwindow->to_proxy(asset, new_scale, use_scaler);
177 if( result >= 0 && beep > 0 && new_scale != 1 ) {
179 mwindow->beep(4000., 0.5, beep);
181 mwindow->beep(1000., 0.5, beep);
183 mwindow->beep(4000., 0.5, beep);
186 mwindow->beep(2000., 2.0, beep);
188 mwindow->edl->session->proxy_disabled_scale = 1;
189 mwindow->gui->lock_window("ProxyDialog::handle_close_event");
190 mwindow->update_project(LOADMODE_REPLACE);
191 mwindow->gui->unlock_window();
194 void ProxyRender::to_proxy_path(char *new_path, Indexable *indexable, int scale)
196 // path is already a proxy
197 if( strstr(indexable->path, ".proxy") ) return;
198 if( !indexable->is_asset ) {
199 char *ifn = indexable->path, *cp = strrchr(ifn, '/');
201 char proxy_path[BCTEXTLEN];
202 File::getenv_path(proxy_path,
203 mwindow->preferences->nested_proxy_path);
204 sprintf(new_path, "%s/%s", proxy_path, ifn);
207 strcpy(new_path, indexable->path);
209 int n = sprintf(prxy, ".proxy%d", scale);
210 // insert proxy, path.sfx => path.proxy#-sfx.ext
211 char *ep = new_path + strlen(new_path);
212 char *sfx = strrchr(new_path, '.');
214 char *bp = ep, *cp = (ep += n);
215 while( --bp > sfx ) *--cp = *bp;
221 for( char *cp=prxy; --n>=0; ++cp ) *sfx++ = *cp;
223 const char *ext = indexable->get_video_frames() < 0 ? "png" :
224 format_asset->format == FILE_FFMPEG ?
225 format_asset->fformat :
226 File::get_tag(format_asset->format);
227 while( *ext ) *ep++ = *ext++;
229 //printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path);
232 int ProxyRender::from_proxy_path(char *new_path, Asset *asset, int scale)
234 char prxy[BCTEXTLEN];
235 int n = sprintf(prxy, ".proxy%d", scale);
236 strcpy(new_path, asset->path);
237 char *ptr = strstr(new_path, prxy);
238 if( !ptr || (ptr[n] != '-' && ptr[n] != '.') ) return 1;
239 // remove proxy, path.proxy#-sfx.ext => path.sfx
240 char *ext = strrchr(ptr, '.');
241 if( !ext ) ext = ptr + strlen(ptr);
243 for( *cp='.'; cp<ext; ++cp ) *ptr++ = *cp;
245 if( asset->proxy_edl ) {
246 if( (cp = strrchr(new_path, '/')) != 0 ) {
247 for( ptr=new_path; *++cp; ) *ptr++ = *cp;
254 ProxyRender::ProxyRender(MWindow *mwindow, Asset *format_asset, int asset_scale)
256 this->mwindow = mwindow;
257 this->format_asset = format_asset;
258 this->asset_scale = asset_scale;
260 counter_lock = new Mutex("ProxyDialog::counter_lock");
262 failed = 0; canceled = 0;
265 ProxyRender::~ProxyRender()
270 for( int i=0,n=orig_idxbls.size(); i<n; ++i ) orig_idxbls[i]->remove_user();
271 for( int i=0,n=orig_proxies.size(); i<n; ++i ) orig_proxies[i]->remove_user();
272 for( int i=0,n=needed_idxbls.size(); i<n; ++i ) needed_idxbls[i]->remove_user();
273 for( int i=0,n=needed_proxies.size(); i<n; ++i ) needed_proxies[i]->remove_user();
276 Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale)
278 if( !idxbl->have_video() ) return 0;
279 // don't proxy proxies
280 if( strstr(idxbl->path,".proxy") ) return 0;
281 char new_path[BCTEXTLEN];
282 to_proxy_path(new_path, idxbl, new_scale);
283 // don't proxy if not readable, or proxy_path not writable
284 if( idxbl->is_asset && access(idxbl->path, R_OK) ) return 0;
285 int ret = access(new_path, W_OK);
287 int fd = ::open(new_path,O_WRONLY);
288 if( fd < 0 ) fd = open(new_path,O_WRONLY+O_CREAT,0666);
289 if( fd >= 0 ) { close(fd); ret = 0; }
292 eprintf(_("bad proxy path: %s\n"), new_path);
295 // add to orig_idxbls & orig_proxies if it isn't already there.
297 for( int i = 0; !got_it && i<orig_proxies.size(); ++i )
298 got_it = !strcmp(orig_proxies[i]->path, new_path);
299 if( got_it ) return 0;
300 Assets *edl_assets = mwindow->edl->assets;
301 Asset *proxy = edl_assets->get_asset(new_path);
303 proxy = new Asset(new_path);
304 // new compression parameters
305 int64_t video_frames = idxbl->get_video_frames();
306 if( video_frames < 0 ) {
307 proxy->format = FILE_PNG;
308 proxy->png_use_alpha = 1;
309 proxy->video_length = -1;
312 proxy->copy_format(format_asset, 0);
313 proxy->video_length = video_frames;
315 proxy->folder_no = AW_PROXY_FOLDER;
316 proxy->proxy_edl = !idxbl->is_asset ? 1 : 0;
317 proxy->audio_data = 0;
318 proxy->video_data = 1;
320 proxy->width = idxbl->get_w() / new_scale;
321 if( proxy->width & 1 ) ++proxy->width;
322 proxy->actual_width = proxy->width;
323 proxy->height = idxbl->get_h() / new_scale;
324 if( proxy->height & 1 ) ++proxy->height;
325 proxy->actual_height = proxy->height;
326 proxy->frame_rate = idxbl->get_frame_rate();
328 orig_proxies.append(proxy);
330 orig_idxbls.append(idxbl);
334 void ProxyRender::add_needed(Indexable *idxbl, Asset *proxy)
336 needed_idxbls.append(idxbl);
338 needed_proxies.append(proxy);
342 void ProxyRender::update_progress()
344 counter_lock->lock();
346 counter_lock->unlock();
347 progress->update(total_rendered);
350 int ProxyRender::is_canceled()
352 return progress->is_cancelled();
355 int ProxyRender::create_needed_proxies(int new_scale)
357 if( !needed_proxies.size() ) return 0;
359 failed = 0; canceled = 0;
361 // create proxy assets which don't already exist
362 int64_t total_len = 0;
363 for( int i = 0; i < needed_idxbls.size(); i++ ) {
364 total_len += needed_idxbls[i]->get_video_frames();
367 // start progress bar. MWindow is locked inside this
368 mwindow->gui->lock_window("ProxyRender::create_needed_proxies");
369 progress = mwindow->mainprogress->
370 start_progress(_("Creating proxy files..."), total_len);
371 mwindow->gui->unlock_window();
373 ProxyFarm engine(mwindow, this, &needed_idxbls, &needed_proxies);
374 engine.process_packages();
375 printf("proxy: failed=%d canceled=%d\n", failed, progress->is_cancelled());
378 canceled = progress->is_cancelled();
379 progress->stop_progress();
380 delete progress; progress = 0;
382 if( failed && !canceled ) {
383 eprintf(_("Error making proxy."));
385 return !failed && !canceled ? 0 : 1;
389 ProxyWindow::ProxyWindow(MWindow *mwindow, ProxyDialog *dialog, int x, int y)
390 : BC_Window(_(PROGRAM_NAME ": Proxy settings"), x, y, WIDTH, HEIGHT,
393 this->mwindow = mwindow;
394 this->dialog = dialog;
398 ProxyWindow::~ProxyWindow()
400 lock_window("ProxyWindow::~ProxyWindow");
406 void ProxyWindow::create_objects()
408 lock_window("ProxyWindow::create_objects");
409 int margin = mwindow->theme->widget_border;
410 int lmargin = margin + xS(10);
412 dialog->use_scaler = mwindow->edl->session->proxy_use_scaler;
413 dialog->orig_scale = mwindow->edl->session->proxy_scale;
414 dialog->auto_scale = mwindow->edl->session->proxy_auto_scale;
415 dialog->beep = mwindow->edl->session->proxy_beep;
416 dialog->new_scale = dialog->orig_scale;
417 dialog->orig_w = mwindow->edl->session->output_w;
418 dialog->orig_h = mwindow->edl->session->output_h;
419 if( !dialog->use_scaler ) {
420 dialog->orig_w *= dialog->orig_scale;
421 dialog->orig_h *= dialog->orig_scale;
425 int y = margin+yS(10);
426 add_subwindow(use_scaler = new ProxyUseScaler(this, x, y));
427 y += use_scaler->get_h() + margin;
430 add_subwindow(text = new BC_Title(x, y, _("Scale factor:")));
431 x += text->get_w() + margin;
433 int popupmenu_w = BC_PopupMenu::calculate_w(get_text_width(MEDIUMFONT, dialog->size_text[0])+xS(15));
434 add_subwindow(scale_factor = new ProxyMenu(mwindow, this, x, y, popupmenu_w, ""));
435 scale_factor->update_sizes();
436 x += scale_factor->get_w() + margin;
438 ProxyTumbler *tumbler;
439 add_subwindow(tumbler = new ProxyTumbler(mwindow, this, x, y));
440 y += tumbler->get_h() + margin;
443 add_subwindow(text = new BC_Title(x, y, _("New media dimensions: ")));
444 x += text->get_w() + margin;
445 add_subwindow(new_dimensions = new BC_Title(x, y, ""));
446 y += new_dimensions->get_h() + margin;
449 add_subwindow(text = new BC_Title(x, y, _("Active Scale: ")));
450 x += text->get_w() + margin;
451 add_subwindow(active_scale = new BC_Title(x, y, ""));
452 y += active_scale->get_h() + margin;
454 x = lmargin; y += yS(25);
455 format_tools = new ProxyFormatTools(mwindow, this, dialog->asset);
456 format_tools->create_objects(x, y, 0, 1, 0, 0, 0, 1, 0, 1, // skip the path
460 add_subwindow(auto_scale = new ProxyAutoScale(this, x, y));
461 y += auto_scale->get_h() + margin;
462 add_subwindow(beep_on_done = new ProxyBeepOnDone(this, x, y));
463 x += beep_on_done->get_w() + margin + xS(10);
464 add_subwindow(new BC_Title(x, y+yS(10), _("Beep on done volume")));
465 // y += beep_on_done->get_h() + margin;
469 add_subwindow(new BC_OKButton(this));
470 add_subwindow(new BC_CancelButton(this));
475 ProxyFormatTools::ProxyFormatTools(MWindow *mwindow, ProxyWindow *pwindow, Asset *asset)
476 : FormatTools(mwindow, pwindow, asset)
478 this->pwindow = pwindow;
481 void ProxyFormatTools::update_format()
483 asset->save_defaults(mwindow->defaults, "PROXY_", 1, 1, 0, 0, 0);
484 FormatTools::update_format();
485 pwindow->use_scaler->update();
488 void ProxyWindow::update()
490 char string[BCSTRLEN];
491 int new_w = dialog->orig_w / dialog->new_scale;
492 if( new_w & 1 ) ++new_w;
493 int new_h = dialog->orig_h / dialog->new_scale;
494 if( new_h & 1 ) ++new_h;
495 sprintf(string, "%dx%d", new_w, new_h);
496 new_dimensions->update(string);
497 dialog->scale_to_text(string, dialog->new_scale);
498 scale_factor->set_text(string);
499 use_scaler->update();
500 auto_scale->update();
501 int scale = mwindow->edl->session->proxy_scale;
502 if( scale == 1 ) scale = mwindow->edl->session->proxy_disabled_scale;
503 sprintf(string, scale>1 ? "1/%d" : "%d", scale);
504 active_scale->update(string);
508 ProxyUseScaler::ProxyUseScaler(ProxyWindow *pwindow, int x, int y)
509 : BC_CheckBox(x, y, pwindow->dialog->use_scaler, _("Use scaler (FFMPEG only)"))
511 this->pwindow = pwindow;
514 void ProxyUseScaler::update()
516 ProxyDialog *dialog = pwindow->dialog;
517 if( dialog->asset->format != FILE_FFMPEG ) dialog->use_scaler = 0;
518 BC_CheckBox::update(dialog->use_scaler);
519 int scaler_avail = dialog->asset->format == FILE_FFMPEG ? 1 : 0;
520 if( !scaler_avail && enabled ) disable();
521 if( scaler_avail && !enabled ) enable();
524 int ProxyUseScaler::handle_event()
526 pwindow->dialog->new_scale = 1;
527 pwindow->dialog->use_scaler = get_value();
528 pwindow->scale_factor->update_sizes();
533 ProxyAutoScale::ProxyAutoScale(ProxyWindow *pwindow, int x, int y)
534 : BC_CheckBox(x, y, pwindow->dialog->auto_scale, _("Auto proxy/scale media loads"))
536 this->pwindow = pwindow;
539 void ProxyAutoScale::update()
541 ProxyDialog *dialog = pwindow->dialog;
542 if( dialog->new_scale == 1 ) dialog->auto_scale = 0;
543 BC_CheckBox::update(dialog->auto_scale);
544 int can_auto_proxy = dialog->new_scale != 1 ? 1 : 0;
545 if( !can_auto_proxy && enabled ) disable();
546 if( can_auto_proxy && !enabled ) enable();
549 int ProxyAutoScale::handle_event()
551 pwindow->dialog->auto_scale = get_value();
556 ProxyBeepOnDone::ProxyBeepOnDone(ProxyWindow *pwindow, int x, int y)
557 : BC_FPot(x, y, pwindow->dialog->beep*100.f, 0.f, 100.f)
559 this->pwindow = pwindow;
562 int ProxyBeepOnDone::handle_event()
564 pwindow->dialog->beep = get_value()/100.f;
570 ProxyMenu::ProxyMenu(MWindow *mwindow, ProxyWindow *pwindow,
571 int x, int y, int w, const char *text)
572 : BC_PopupMenu(x, y, w, text, 1)
574 this->mwindow = mwindow;
575 this->pwindow = pwindow;
578 void ProxyMenu::update_sizes()
580 while( total_items() > 0 ) del_item(0);
581 ProxyDialog *dialog = pwindow->dialog;
582 dialog->calculate_sizes();
583 for( int i=0; i < dialog->total_sizes; i++ )
584 add_item(new BC_MenuItem(dialog->size_text[i]));
587 int ProxyMenu::handle_event()
589 ProxyDialog *dialog = pwindow->dialog;
590 for( int i = 0; i < dialog->total_sizes; i++ ) {
591 if( !strcmp(get_text(), pwindow->dialog->size_text[i]) ) {
592 dialog->new_scale = pwindow->dialog->size_factors[i];
601 ProxyTumbler::ProxyTumbler(MWindow *mwindow, ProxyWindow *pwindow, int x, int y)
602 : BC_Tumbler(x, y, 0)
604 this->mwindow = mwindow;
605 this->pwindow = pwindow;
608 int ProxyTumbler::handle_up_event()
610 if( pwindow->dialog->new_scale > 1 ) {
612 for( i = 0; i < pwindow->dialog->total_sizes; i++ ) {
613 if( pwindow->dialog->new_scale == pwindow->dialog->size_factors[i] ) {
615 pwindow->dialog->new_scale = pwindow->dialog->size_factors[i];
625 int ProxyTumbler::handle_down_event()
628 for( i = 0; i < pwindow->dialog->total_sizes - 1; i++ ) {
629 if( pwindow->dialog->new_scale == pwindow->dialog->size_factors[i] ) {
631 pwindow->dialog->new_scale = pwindow->dialog->size_factors[i];
642 ProxyPackage::ProxyPackage()
647 ProxyClient::ProxyClient(MWindow *mwindow,
648 ProxyRender *proxy_render, ProxyFarm *server)
651 this->mwindow = mwindow;
652 this->proxy_render = proxy_render;
657 ProxyClient::~ProxyClient()
659 delete render_engine;
661 video_cache->remove_user();
665 void ProxyClient::process_package(LoadPackage *ptr)
667 if( proxy_render->failed ) return;
668 if( proxy_render->is_canceled() ) return;
670 EDL *edl = mwindow->edl;
671 Preferences *preferences = mwindow->preferences;
672 ProxyPackage *package = (ProxyPackage*)ptr;
673 Indexable *orig = package->orig_idxbl;
674 Asset *proxy = package->proxy_asset;
675 //printf("%s %s\n", orig->path, proxy->path);
676 VRender *vrender = 0;
677 int jobs = proxy_render->needed_proxies.size();
678 int processors = preferences->project_smp / jobs + 1, result = 0;
680 // each cpu should process at least about 1 MB, or it thrashes
681 int size = edl->session->output_w * edl->session->output_h * 4;
682 int cpus = size / 0x100000 + 1;
683 if( processors > cpus ) processors = cpus;
685 if( orig->is_asset ) {
687 src_file->set_processors(processors);
688 src_file->set_preload(edl->session->playback_preload);
689 src_file->set_subtitle(edl->session->decode_subtitles ?
690 edl->session->subtitle_number : -1);
691 src_file->set_interpolate_raw(edl->session->interpolate_raw);
692 src_file->set_white_balance_raw(edl->session->white_balance_raw);
693 if( src_file->open_file(preferences, (Asset*)orig, 1, 0) != FILE_OK )
697 TransportCommand command;
698 command.command = CURRENT_FRAME;
699 command.get_edl()->copy_all((EDL *)orig);
700 command.change_type = CHANGE_ALL;
701 command.realtime = 0;
702 render_engine = new RenderEngine(0, preferences, 0, 0);
703 render_engine->set_vcache(video_cache = new CICache(preferences));
704 render_engine->arm_command(&command);
705 if( !(vrender = render_engine->vrender) )
709 // go to the next asset if the reader fails
710 // proxy_render->failed = 1;
715 dst_file.set_processors(processors);
716 result = dst_file.open_file(preferences, proxy, 0, 1);
718 proxy_render->failed = 1;
719 ::remove(proxy->path);
723 dst_file.start_video_thread(1, edl->session->color_model,
724 processors > 1 ? 2 : 1, 0);
726 int src_w = orig->get_w(), src_h = orig->get_h();
727 VFrame src_frame(src_w,src_h, edl->session->color_model);
729 OverlayFrame scaler(processors);
730 int64_t video_length = orig->get_video_frames();
731 if( video_length < 0 ) video_length = 1;
733 for( int64_t i=0; i<video_length &&
734 !proxy_render->failed && !proxy_render->is_canceled(); ++i ) {
735 if( orig->is_asset ) {
736 src_file->set_video_position(i, 0);
737 result = src_file->read_frame(&src_frame);
740 result = vrender->process_buffer(&src_frame, i, 0);
741 //printf("result=%d\n", result);
744 // go to the next asset if the reader fails
745 // proxy_render->failed = 1;
749 // have to write after getting the video buffer or it locks up
750 VFrame ***dst_frames = dst_file.get_video_buffer();
751 VFrame *dst_frame = dst_frames[0][0];
752 int dst_w = dst_frame->get_w(), dst_h = dst_frame->get_h();
753 scaler.overlay(dst_frame, &src_frame,
754 0,0, src_w,src_h, 0,0, dst_w,dst_h,
755 1.0, TRANSFER_REPLACE, NEAREST_NEIGHBOR);
756 result = dst_file.write_video_buffer(1);
758 // only fail if the writer fails
759 proxy_render->failed = 1;
762 proxy_render->update_progress();
764 if( !proxy_render->failed && !proxy_render->is_canceled() ) {
765 Asset *asset = edl->assets->update(proxy);
766 asset->proxy_scale = proxy_render->asset_scale;
767 int scale = asset->proxy_scale;
768 if( !scale ) scale = 1;
769 asset->width = asset->actual_width * scale;
770 asset->height = asset->actual_height * scale;
771 mwindow->mainindexes->add_indexable(asset);
772 mwindow->mainindexes->start_build();
775 ::remove(proxy->path);
779 ProxyFarm::ProxyFarm(MWindow *mwindow, ProxyRender *proxy_render,
780 ArrayList<Indexable*> *orig_idxbls,
781 ArrayList<Asset*> *proxy_assets)
782 : LoadServer(MIN(mwindow->preferences->processors, proxy_assets->size()),
783 proxy_assets->size())
785 this->mwindow = mwindow;
786 this->proxy_render = proxy_render;
787 this->orig_idxbls = orig_idxbls;
788 this->proxy_assets = proxy_assets;
791 void ProxyFarm::init_packages()
793 for( int i = 0; i < get_total_packages(); i++ ) {
794 ProxyPackage *package = (ProxyPackage*)get_package(i);
795 package->proxy_asset = proxy_assets->get(i);
796 package->orig_idxbl = orig_idxbls->get(i);
800 LoadClient* ProxyFarm::new_client()
802 return new ProxyClient(mwindow, proxy_render, this);
805 LoadPackage* ProxyFarm::new_package()
807 return new ProxyPackage;