00001 #ifndef TIMEFRONT_H
00002 #define TIMEFRONT_H
00003
00004 class TimeFrontMain;
00005 class TimeFrontEngine;
00006 class TimeFrontThread;
00007 class TimeFrontWindow;
00008 class TimeFrontServer;
00009
00010
00011 #include "bchash.inc"
00012 #include "filexml.inc"
00013 #include "guicast.h"
00014 #include "loadbalance.h"
00015 #include "overlayframe.inc"
00016 #include "plugincolors.h"
00017 #include "pluginvclient.h"
00018 #include "thread.h"
00019 #include "vframe.inc"
00020
00021 class TimeFrontConfig
00022 {
00023 public:
00024 TimeFrontConfig();
00025
00026 int equivalent(TimeFrontConfig &that);
00027 void copy_from(TimeFrontConfig &that);
00028 void interpolate(TimeFrontConfig &prev,
00029 TimeFrontConfig &next,
00030 long prev_frame,
00031 long next_frame,
00032 long current_frame);
00033
00034 int get_in_color();
00035 int get_out_color();
00036
00037
00038 int shape;
00039
00040 int rate;
00041 enum
00042 {
00043 LINEAR,
00044 RADIAL,
00045 LOG,
00046 SQUARE,
00047 OTHERTRACK,
00048 ALPHA
00049 };
00050
00051
00052 double center_x;
00053 double center_y;
00054 double angle;
00055 double in_radius;
00056 double out_radius;
00057 int frame_range;
00058 int track_usage;
00059 enum
00060 {
00061 OTHERTRACK_INTENSITY,
00062 OTHERTRACK_ALPHA,
00063 };
00064 int invert;
00065 int show_grayscale;
00066 };
00067
00068
00069 class TimeFrontShape : public BC_PopupMenu
00070 {
00071 public:
00072 TimeFrontShape(TimeFrontMain *plugin,
00073 TimeFrontWindow *gui,
00074 int x,
00075 int y);
00076 void create_objects();
00077 static char* to_text(int shape);
00078 static int from_text(char *text);
00079 int handle_event();
00080 TimeFrontMain *plugin;
00081 TimeFrontWindow *gui;
00082 };
00083
00084 class TimeFrontTrackUsage : public BC_PopupMenu
00085 {
00086 public:
00087 TimeFrontTrackUsage(TimeFrontMain *plugin,
00088 TimeFrontWindow *gui,
00089 int x,
00090 int y);
00091 void create_objects();
00092 static char* to_text(int track_usage);
00093 static int from_text(char *text);
00094 int handle_event();
00095 TimeFrontMain *plugin;
00096 TimeFrontWindow *gui;
00097 };
00098
00099
00100 class TimeFrontRate : public BC_PopupMenu
00101 {
00102 public:
00103 TimeFrontRate(TimeFrontMain *plugin,
00104 int x,
00105 int y);
00106 void create_objects();
00107 static char* to_text(int shape);
00108 static int from_text(char *text);
00109 int handle_event();
00110 TimeFrontMain *plugin;
00111 TimeFrontWindow *gui;
00112 };
00113
00114 class TimeFrontCenterX : public BC_FPot
00115 {
00116 public:
00117 TimeFrontCenterX(TimeFrontMain *plugin, int x, int y);
00118 int handle_event();
00119 TimeFrontMain *plugin;
00120 };
00121
00122 class TimeFrontCenterY : public BC_FPot
00123 {
00124 public:
00125 TimeFrontCenterY(TimeFrontMain *plugin, int x, int y);
00126 int handle_event();
00127 TimeFrontMain *plugin;
00128 };
00129
00130 class TimeFrontAngle : public BC_FPot
00131 {
00132 public:
00133 TimeFrontAngle(TimeFrontMain *plugin, int x, int y);
00134 int handle_event();
00135 TimeFrontMain *plugin;
00136 };
00137
00138 class TimeFrontInRadius : public BC_FSlider
00139 {
00140 public:
00141 TimeFrontInRadius(TimeFrontMain *plugin, int x, int y);
00142 int handle_event();
00143 TimeFrontMain *plugin;
00144 };
00145
00146 class TimeFrontOutRadius : public BC_FSlider
00147 {
00148 public:
00149 TimeFrontOutRadius(TimeFrontMain *plugin, int x, int y);
00150 int handle_event();
00151 TimeFrontMain *plugin;
00152 };
00153
00154 class TimeFrontFrameRange : public BC_ISlider
00155 {
00156 public:
00157 TimeFrontFrameRange(TimeFrontMain *plugin, int x, int y);
00158 int handle_event();
00159 TimeFrontMain *plugin;
00160 };
00161
00162
00163 class TimeFrontInvert : public BC_CheckBox
00164 {
00165 public:
00166 TimeFrontInvert(TimeFrontMain *plugin, int x, int y);
00167 int handle_event();
00168 TimeFrontMain *plugin;
00169 };
00170
00171 class TimeFrontShowGrayscale : public BC_CheckBox
00172 {
00173 public:
00174 TimeFrontShowGrayscale(TimeFrontMain *plugin, int x, int y);
00175 int handle_event();
00176 TimeFrontMain *plugin;
00177 };
00178
00179
00180 class TimeFrontWindow : public BC_Window
00181 {
00182 public:
00183 TimeFrontWindow(TimeFrontMain *plugin, int x, int y);
00184 ~TimeFrontWindow();
00185
00186 int create_objects();
00187 int close_event();
00188 void update_shape();
00189
00190 TimeFrontMain *plugin;
00191 BC_Title *angle_title;
00192 BC_Title *rate_title, *in_radius_title, *out_radius_title, *track_usage_title;
00193 TimeFrontAngle *angle;
00194 TimeFrontInRadius *in_radius;
00195 TimeFrontOutRadius *out_radius;
00196 TimeFrontFrameRange *frame_range;
00197 TimeFrontShape *shape;
00198 TimeFrontTrackUsage *track_usage;
00199 BC_Title *shape_title;
00200 TimeFrontCenterX *center_x;
00201 BC_Title *center_x_title;
00202 BC_Title *center_y_title;
00203 TimeFrontCenterY *center_y;
00204 TimeFrontRate *rate;
00205 TimeFrontShowGrayscale *show_grayscale;
00206 TimeFrontInvert *invert;
00207 int frame_range_x, frame_range_y;
00208 int shape_x, shape_y;
00209 };
00210
00211
00212
00213 PLUGIN_THREAD_HEADER(TimeFrontMain, TimeFrontThread, TimeFrontWindow)
00214
00215
00216 class TimeFrontMain : public PluginVClient
00217 {
00218 public:
00219 TimeFrontMain(PluginServer *server);
00220 ~TimeFrontMain();
00221
00222
00223 int process_buffer(VFrame **frame,
00224 int64_t start_position,
00225 double frame_rate);
00226
00227 int is_realtime();
00228 int is_multichannel();
00229 int load_defaults();
00230 int save_defaults();
00231 void save_data(KeyFrame *keyframe);
00232 void read_data(KeyFrame *keyframe);
00233 void update_gui();
00234 int is_synthesis();
00235
00236 PLUGIN_CLASS_MEMBERS(TimeFrontConfig, TimeFrontThread)
00237
00238 int need_reconfigure;
00239
00240 OverlayFrame *overlayer;
00241 VFrame *gradient;
00242 VFrame *input, *output;
00243 TimeFrontServer *engine;
00244 };
00245
00246 class TimeFrontPackage : public LoadPackage
00247 {
00248 public:
00249 TimeFrontPackage();
00250 int y1;
00251 int y2;
00252 };
00253
00254 class TimeFrontUnit : public LoadClient
00255 {
00256 public:
00257 TimeFrontUnit(TimeFrontServer *server, TimeFrontMain *plugin);
00258 void process_package(LoadPackage *package);
00259 TimeFrontServer *server;
00260 TimeFrontMain *plugin;
00261 YUV yuv;
00262 };
00263
00264 class TimeFrontServer : public LoadServer
00265 {
00266 public:
00267 TimeFrontServer(TimeFrontMain *plugin, int total_clients, int total_packages);
00268 void init_packages();
00269 LoadClient* new_client();
00270 LoadPackage* new_package();
00271 TimeFrontMain *plugin;
00272 };
00273
00274
00275
00276 #endif