6 * Copyright (C) 2015 Adam Williams <broadcast at earthling dot net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 // functions for handling proxies
26 #include "arraylist.h"
29 #include "formattools.inc"
30 #include "loadbalance.h"
32 #include "mwindow.inc"
39 class ProxyMenuItem : public BC_MenuItem
42 ProxyMenuItem(MWindow *mwindow);
45 void create_objects();
51 class FromProxyMenuItem : public BC_MenuItem
54 FromProxyMenuItem(MWindow *mwindow);
60 class ProxyThread : public BC_DialogThread
63 ProxyThread(MWindow *mwindow);
66 void handle_close_event(int result);
67 static void to_proxy_path(char *new_path, Asset *asset, int scale);
68 static void from_proxy_path(char *new_path, Asset *asset, int scale);
71 // increment the frame count by 1
72 void update_progress();
73 // if user canceled progress bar
75 // calculate possible sizes based on the original size
76 void calculate_sizes();
77 void scale_to_text(char *string, int scale);
81 MainProgressBar *progress;
89 char *size_text[MAX_SIZES];
90 int size_factors[MAX_SIZES];
94 class ProxyUseScaler : public BC_CheckBox
97 ProxyUseScaler(MWindow *mwindow, ProxyWindow *pwindow,
102 ProxyWindow *pwindow;
105 class ProxyFormatTools : public FormatTools
108 ProxyFormatTools(MWindow *mwindow, ProxyWindow *window, Asset *asset);
110 void update_format();
111 ProxyWindow *pwindow;
114 class ProxyMenu : public BC_PopupMenu
117 ProxyMenu(MWindow *mwindow, ProxyWindow *pwindow,
118 int x, int y, int w, const char *text);
122 ProxyWindow *pwindow;
126 class ProxyTumbler : public BC_Tumbler
129 ProxyTumbler(MWindow *mwindow, ProxyWindow *pwindow, int x, int y);
131 int handle_up_event();
132 int handle_down_event();
134 ProxyWindow *pwindow;
139 class ProxyWindow : public BC_Window
142 ProxyWindow(MWindow *mwindow, ProxyThread *thread,
146 void create_objects();
151 FormatTools *format_tools;
152 BC_Title *new_dimensions;
153 ProxyMenu *scale_factor;
154 ProxyUseScaler *use_scaler;
159 class ProxyPackage : public LoadPackage
167 class ProxyClient : public LoadClient
170 ProxyClient(MWindow *mwindow, ProxyThread *thread,
172 void process_package(LoadPackage *package);
179 class ProxyFarm : public LoadServer
182 ProxyFarm(MWindow *mwindow, ProxyThread *thread,
183 ArrayList<Asset*> *proxy_assets, ArrayList<Asset*> *orig_assets);
185 void init_packages();
186 LoadClient* new_client();
187 LoadPackage* new_package();
191 ArrayList<Asset*> *proxy_assets;
192 ArrayList<Asset*> *orig_assets;