Fixed initialisation of tf in file_open(). Without setting the memory to 0,
[cinelerra_cv/mob.git] / plugins / dbx / dbx.h
blob402233f3c5ef8f5abc6cd4a21aecc5c74cdd116c
1 #ifndef DBX_H
2 #define DBX_H
6 #include "bchash.inc"
7 #include "guicast.h"
8 #include "mutex.h"
9 #include "pluginaclient.h"
10 #include "vframe.inc"
12 class DBXEffect;
18 class DBXSize : public BC_TextBox
20 public:
21 DBXSize(DBXEffect *plugin, int x, int y);
22 int handle_events();
23 DBXEffect *plugin;
27 class DBXGain : public BC_TextBox
29 public:
30 DBXGain(DBXEffect *plugin, int x, int y);
31 int handle_events();
32 DBXEffect *plugin;
36 class DBXWindow : public BC_Window
38 public:
39 DBXWindow(DBXEffect *plugin, int x, int y);
40 void create_objects();
41 void update();
42 void update_textboxes();
43 void update_canvas();
44 int close_event();
45 void draw_scales();
48 DBXCanvas *canvas;
49 DBXPreview *preview;
50 DBXReaction *reaction;
51 DBXClear *clear;
52 DBXX *x_text;
53 DBXY *y_text;
54 DBXTrigger *trigger;
55 DBXEffect *plugin;
58 class DBXThread : public Thread
60 public:
61 DBXThread(DBXEffect *plugin);
62 ~DBXThread();
63 void run();
64 Mutex completion;
65 DBXWindow *window;
66 DBXEffect *plugin;
70 typedef struct
72 // Units are linear from 0 - 1
73 double x, y;
74 } compressor_point_t;
76 class DBXConfig
78 public:
79 DBXConfig();
81 int total_points();
82 void remove_point(int number);
83 void optimize();
84 double get_y(int number);
85 double get_x(int number);
86 // Returns linear output given linear input
87 double calculate_linear(double x);
88 int set_point(double x, double y);
89 void dump();
91 int trigger;
92 double min_db;
93 double preview_len;
94 double reaction_len;
95 double min_x, min_y;
96 double max_x, max_y;
97 ArrayList<compressor_point_t> levels;
100 class DBXEffect : public PluginAClient
102 public:
103 DBXEffect(PluginServer *server);
104 ~DBXEffect();
106 VFrame* new_picon();
107 char* plugin_title();
108 int is_multichannel();
109 int is_realtime();
110 void read_data(KeyFrame *keyframe);
111 void save_data(KeyFrame *keyframe);
112 int process_realtime(long size, double **input_ptr, double **output_ptr);
113 int show_gui();
114 void raise_window();
115 int set_string();
120 int load_defaults();
121 int save_defaults();
122 void load_configuration();
123 void reset();
124 void update_gui();
125 void delete_dsp();
128 double **input_buffer;
129 long input_size;
130 long input_allocated;
131 double *reaction_buffer;
132 long reaction_allocated;
133 long reaction_position;
134 double current_coef;
136 // Same coefs are applied to all channels
137 double *coefs;
138 long coefs_allocated;
142 BC_Hash *defaults;
143 DBXThread *thread;
144 DBXConfig config;
148 #endif