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);
113 ShapeWipeMain *client;
114 ShapeWipeWindow *window;
117 class ShapeWipeShape : public BC_PopupTextBox
120 ShapeWipeShape(ShapeWipeMain *client, ShapeWipeWindow *window,
121 int x, int y, int text_w, int list_h);
123 ShapeWipeMain *client;
124 ShapeWipeWindow *window;
127 class ShapeWipePreserveAspectRatio : public BC_CheckBox
130 ShapeWipePreserveAspectRatio(ShapeWipeMain *plugin,
131 ShapeWipeWindow *window,
135 ShapeWipeMain *plugin;
136 ShapeWipeWindow *window;
140 class ShapeWipeWindow : public PluginClientWindow
143 ShapeWipeWindow(ShapeWipeMain *plugin);
145 void create_objects();
149 ShapeWipeMain *plugin;
152 ShapeWipeTumble *shape_tumbler;
153 ShapeWipeShape *shape_text;
154 ShapeWipeFeather *shape_feather;
155 ShapeWipeFSlider *shape_fslider;
156 ShapeWipeReset *shape_reset;
157 ArrayList<BC_ListBoxItem*> shapes;
160 class ShapeWipeConfig
165 void read_xml(KeyFrame *keyframe);
166 void save_xml(KeyFrame *keyframe);
171 char shape_name[BCTEXTLEN];
174 class ShapeWipeMain : public PluginVClient
177 ShapeWipeMain(PluginServer *server);
180 PLUGIN_CLASS_MEMBERS(ShapeWipeConfig)
181 int process_realtime(VFrame *input, VFrame *output);
184 void read_data(KeyFrame *keyframe);
185 void save_data(KeyFrame *keyframe);
187 int read_pattern_image(char *shape_name,
188 int new_frame_width, int new_frame_height);
189 void reset_pattern_image();
192 VFrame *input, *output;
194 ArrayList<char*> shape_paths;
195 ArrayList<char*> shape_titles;
197 int shapes_initialized;
199 char current_filename[BCTEXTLEN];
200 char current_name[BCTEXTLEN];
201 unsigned char **pattern_image;
202 unsigned char min_value;
203 unsigned char max_value;
207 int last_preserve_aspect;
211 class ShapePackage : public LoadPackage
218 class ShapeUnit : public LoadClient
221 ShapeUnit(ShapeEngine *server);
223 void process_package(LoadPackage *package);
225 unsigned char threshold;
228 class ShapeEngine : public LoadServer
231 ShapeEngine(ShapeWipeMain *plugin,
232 int total_clients, int total_packages);
235 void init_packages();
236 LoadClient *new_client();
237 LoadPackage *new_package();
238 ShapeWipeMain *plugin;