4 * Copyright (C) 2008 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
25 class ShapeWipeConfig;
27 class ShapeWipeWindow;
30 class ShapeWipeTumble;
31 class ShapeWipeFeather;
32 class ShapeWipeFSlider;
35 class ShapeWipePreserveAspectRatio;
40 #include "overlayframe.inc"
41 #include "pluginvclient.h"
44 class ShapeWipeW2B : public BC_Radial
47 ShapeWipeW2B(ShapeWipeMain *plugin,
48 ShapeWipeWindow *window,
52 ShapeWipeMain *plugin;
53 ShapeWipeWindow *window;
56 class ShapeWipeB2W : public BC_Radial
59 ShapeWipeB2W(ShapeWipeMain *plugin,
60 ShapeWipeWindow *window,
64 ShapeWipeMain *plugin;
65 ShapeWipeWindow *window;
69 class ShapeWipeTumble : public BC_Tumbler
72 ShapeWipeTumble(ShapeWipeMain *client,
73 ShapeWipeWindow *window,
77 int handle_up_event();
78 int handle_down_event();
80 ShapeWipeMain *client;
81 ShapeWipeWindow *window;
84 class ShapeWipeFeather : public BC_TumbleTextBox
87 ShapeWipeFeather(ShapeWipeMain *client,
88 ShapeWipeWindow *window, int x, int y);
91 ShapeWipeMain *client;
92 ShapeWipeWindow *window;
95 class ShapeWipeFSlider : public BC_FSlider
98 ShapeWipeFSlider(ShapeWipeMain *client,
99 ShapeWipeWindow *window, int x, int y, int w);
102 ShapeWipeMain *client;
103 ShapeWipeWindow *window;
106 class ShapeWipeReset : public BC_Button
109 ShapeWipeReset(ShapeWipeMain *client,
110 ShapeWipeWindow *window, int x, int y);
112 static int calculate_w(ShapeWipeMain *client);
114 ShapeWipeMain *client;
115 ShapeWipeWindow *window;
118 class ShapeWipeShape : public BC_PopupTextBox
121 ShapeWipeShape(ShapeWipeMain *client, ShapeWipeWindow *window,
122 int x, int y, int text_w, int list_h);
124 ShapeWipeMain *client;
125 ShapeWipeWindow *window;
128 class ShapeWipePreserveAspectRatio : public BC_CheckBox
131 ShapeWipePreserveAspectRatio(ShapeWipeMain *plugin,
132 ShapeWipeWindow *window,
136 ShapeWipeMain *plugin;
137 ShapeWipeWindow *window;
141 class ShapeWipeWindow : public PluginClientWindow
144 ShapeWipeWindow(ShapeWipeMain *plugin);
146 void create_objects();
150 ShapeWipeMain *plugin;
153 ShapeWipeTumble *shape_tumbler;
154 ShapeWipeShape *shape_text;
155 ShapeWipeFeather *shape_feather;
156 ShapeWipeFSlider *shape_fslider;
157 ShapeWipeReset *shape_reset;
158 ArrayList<BC_ListBoxItem*> shapes;
161 class ShapeWipeConfig
166 void read_xml(KeyFrame *keyframe);
167 void save_xml(KeyFrame *keyframe);
172 char shape_name[BCTEXTLEN];
175 class ShapeWipeMain : public PluginVClient
178 ShapeWipeMain(PluginServer *server);
181 PLUGIN_CLASS_MEMBERS(ShapeWipeConfig)
182 int process_realtime(VFrame *input, VFrame *output);
185 void read_data(KeyFrame *keyframe);
186 void save_data(KeyFrame *keyframe);
188 int read_pattern_image(char *shape_name,
189 int new_frame_width, int new_frame_height);
190 void reset_pattern_image();
193 VFrame *input, *output;
195 ArrayList<char*> shape_paths;
196 ArrayList<char*> shape_titles;
198 int shapes_initialized;
200 char current_filename[BCTEXTLEN];
201 char current_name[BCTEXTLEN];
202 unsigned char **pattern_image;
203 unsigned char min_value;
204 unsigned char max_value;
208 int last_preserve_aspect;
212 class ShapePackage : public LoadPackage
219 class ShapeUnit : public LoadClient
222 ShapeUnit(ShapeEngine *server);
224 void process_package(LoadPackage *package);
226 unsigned char threshold;
229 class ShapeEngine : public LoadServer
232 ShapeEngine(ShapeWipeMain *plugin,
233 int total_clients, int total_packages);
236 void init_packages();
237 LoadClient *new_client();
238 LoadPackage *new_package();
239 ShapeWipeMain *plugin;