Fixed initialisation of tf in file_open(). Without setting the memory to 0,
[cinelerra_cv/mob.git] / plugins / timefront / timefront.h
blob59771f96bb7105c4559440cecc78b53d1f2d060d
1 #ifndef TIMEFRONT_H
2 #define TIMEFRONT_H
4 class TimeFrontMain;
5 class TimeFrontEngine;
6 class TimeFrontThread;
7 class TimeFrontWindow;
8 class TimeFrontServer;
11 #include "bchash.inc"
12 #include "filexml.inc"
13 #include "guicast.h"
14 #include "loadbalance.h"
15 #include "overlayframe.inc"
16 #include "plugincolors.h"
17 #include "pluginvclient.h"
18 #include "thread.h"
19 #include "vframe.inc"
21 class TimeFrontConfig
23 public:
24 TimeFrontConfig();
26 int equivalent(TimeFrontConfig &that);
27 void copy_from(TimeFrontConfig &that);
28 void interpolate(TimeFrontConfig &prev,
29 TimeFrontConfig &next,
30 long prev_frame,
31 long next_frame,
32 long current_frame);
33 // Int to hex triplet conversion
34 int get_in_color();
35 int get_out_color();
37 // LINEAR or RADIAL
38 int shape;
39 // LINEAR or LOG or SQUARE
40 int rate;
41 enum
43 LINEAR,
44 RADIAL,
45 LOG,
46 SQUARE,
47 OTHERTRACK,
48 ALPHA
52 double center_x;
53 double center_y;
54 double angle;
55 double in_radius;
56 double out_radius;
57 int frame_range;
58 int track_usage;
59 enum
61 OTHERTRACK_INTENSITY,
62 OTHERTRACK_ALPHA,
64 int invert;
65 int show_grayscale;
69 class TimeFrontShape : public BC_PopupMenu
71 public:
72 TimeFrontShape(TimeFrontMain *plugin,
73 TimeFrontWindow *gui,
74 int x,
75 int y);
76 void create_objects();
77 static char* to_text(int shape);
78 static int from_text(char *text);
79 int handle_event();
80 TimeFrontMain *plugin;
81 TimeFrontWindow *gui;
84 class TimeFrontTrackUsage : public BC_PopupMenu
86 public:
87 TimeFrontTrackUsage(TimeFrontMain *plugin,
88 TimeFrontWindow *gui,
89 int x,
90 int y);
91 void create_objects();
92 static char* to_text(int track_usage);
93 static int from_text(char *text);
94 int handle_event();
95 TimeFrontMain *plugin;
96 TimeFrontWindow *gui;
100 class TimeFrontRate : public BC_PopupMenu
102 public:
103 TimeFrontRate(TimeFrontMain *plugin,
104 int x,
105 int y);
106 void create_objects();
107 static char* to_text(int shape);
108 static int from_text(char *text);
109 int handle_event();
110 TimeFrontMain *plugin;
111 TimeFrontWindow *gui;
114 class TimeFrontCenterX : public BC_FPot
116 public:
117 TimeFrontCenterX(TimeFrontMain *plugin, int x, int y);
118 int handle_event();
119 TimeFrontMain *plugin;
122 class TimeFrontCenterY : public BC_FPot
124 public:
125 TimeFrontCenterY(TimeFrontMain *plugin, int x, int y);
126 int handle_event();
127 TimeFrontMain *plugin;
130 class TimeFrontAngle : public BC_FPot
132 public:
133 TimeFrontAngle(TimeFrontMain *plugin, int x, int y);
134 int handle_event();
135 TimeFrontMain *plugin;
138 class TimeFrontInRadius : public BC_FSlider
140 public:
141 TimeFrontInRadius(TimeFrontMain *plugin, int x, int y);
142 int handle_event();
143 TimeFrontMain *plugin;
146 class TimeFrontOutRadius : public BC_FSlider
148 public:
149 TimeFrontOutRadius(TimeFrontMain *plugin, int x, int y);
150 int handle_event();
151 TimeFrontMain *plugin;
154 class TimeFrontFrameRange : public BC_ISlider
156 public:
157 TimeFrontFrameRange(TimeFrontMain *plugin, int x, int y);
158 int handle_event();
159 TimeFrontMain *plugin;
163 class TimeFrontInvert : public BC_CheckBox
165 public:
166 TimeFrontInvert(TimeFrontMain *plugin, int x, int y);
167 int handle_event();
168 TimeFrontMain *plugin;
171 class TimeFrontShowGrayscale : public BC_CheckBox
173 public:
174 TimeFrontShowGrayscale(TimeFrontMain *plugin, int x, int y);
175 int handle_event();
176 TimeFrontMain *plugin;
180 class TimeFrontWindow : public BC_Window
182 public:
183 TimeFrontWindow(TimeFrontMain *plugin, int x, int y);
184 ~TimeFrontWindow();
186 int create_objects();
187 int close_event();
188 void update_shape();
190 TimeFrontMain *plugin;
191 BC_Title *angle_title;
192 BC_Title *rate_title, *in_radius_title, *out_radius_title, *track_usage_title;
193 TimeFrontAngle *angle;
194 TimeFrontInRadius *in_radius;
195 TimeFrontOutRadius *out_radius;
196 TimeFrontFrameRange *frame_range;
197 TimeFrontShape *shape;
198 TimeFrontTrackUsage *track_usage;
199 BC_Title *shape_title;
200 TimeFrontCenterX *center_x;
201 BC_Title *center_x_title;
202 BC_Title *center_y_title;
203 TimeFrontCenterY *center_y;
204 TimeFrontRate *rate;
205 TimeFrontShowGrayscale *show_grayscale;
206 TimeFrontInvert *invert;
207 int frame_range_x, frame_range_y;
208 int shape_x, shape_y;
213 PLUGIN_THREAD_HEADER(TimeFrontMain, TimeFrontThread, TimeFrontWindow)
216 class TimeFrontMain : public PluginVClient
218 public:
219 TimeFrontMain(PluginServer *server);
220 ~TimeFrontMain();
222 // int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
223 int process_buffer(VFrame **frame,
224 int64_t start_position,
225 double frame_rate);
227 int is_realtime();
228 int is_multichannel();
229 int load_defaults();
230 int save_defaults();
231 void save_data(KeyFrame *keyframe);
232 void read_data(KeyFrame *keyframe);
233 void update_gui();
234 int is_synthesis();
236 PLUGIN_CLASS_MEMBERS(TimeFrontConfig, TimeFrontThread)
238 int need_reconfigure;
240 OverlayFrame *overlayer;
241 VFrame *gradient;
242 VFrame *input, *output;
243 TimeFrontServer *engine;
246 class TimeFrontPackage : public LoadPackage
248 public:
249 TimeFrontPackage();
250 int y1;
251 int y2;
254 class TimeFrontUnit : public LoadClient
256 public:
257 TimeFrontUnit(TimeFrontServer *server, TimeFrontMain *plugin);
258 void process_package(LoadPackage *package);
259 TimeFrontServer *server;
260 TimeFrontMain *plugin;
261 YUV yuv;
264 class TimeFrontServer : public LoadServer
266 public:
267 TimeFrontServer(TimeFrontMain *plugin, int total_clients, int total_packages);
268 void init_packages();
269 LoadClient* new_client();
270 LoadPackage* new_package();
271 TimeFrontMain *plugin;
276 #endif