5 #include "defaults.inc"
9 #include "pluginaclient.h"
13 // This parametric EQ multiplies the data by a gaussian curve in frequency domain.
14 // It causes significant delay but is useful.
18 #define WINDOW_SIZE 16384
19 #define MAXMAGNITUDE 15
23 class ParametricConfig
;
24 class ParametricThread
;
26 class ParametricQuality
;
27 class ParametricMagnitude
;
28 class ParametricBandGUI
;
29 class ParametricWindow
;
41 int equivalent(ParametricBand
&that
);
42 void copy_from(ParametricBand
&that
);
43 void interpolate(ParametricBand
&prev
,
63 class ParametricConfig
68 int equivalent(ParametricConfig
&that
);
69 void copy_from(ParametricConfig
&that
);
70 void interpolate(ParametricConfig
&prev
,
71 ParametricConfig
&next
,
74 int64_t current_frame
);
76 ParametricBand band
[BANDS
];
83 PLUGIN_THREAD_HEADER(ParametricEQ
, ParametricThread
, ParametricWindow
)
86 class ParametricFreq
: public BC_QPot
89 ParametricFreq(ParametricEQ
*plugin
, int x
, int y
, int band
);
98 class ParametricQuality
: public BC_FPot
101 ParametricQuality(ParametricEQ
*plugin
, int x
, int y
, int band
);
106 ParametricEQ
*plugin
;
110 class ParametricMagnitude
: public BC_FPot
113 ParametricMagnitude(ParametricEQ
*plugin
, int x
, int y
, int band
);
118 ParametricEQ
*plugin
;
124 class ParametricMode
: public BC_PopupMenu
127 ParametricMode(ParametricEQ
*plugin
, int x
, int y
, int band
);
129 void create_objects();
131 static int text_to_mode(char *text
);
132 static char* mode_to_text(int mode
);
135 ParametricEQ
*plugin
;
142 class ParametricBandGUI
145 ParametricBandGUI(ParametricEQ
*plugin
,
146 ParametricWindow
*window
,
150 ~ParametricBandGUI();
152 void create_objects();
157 ParametricEQ
*plugin
;
158 ParametricWindow
*window
;
159 ParametricFreq
*freq
;
160 ParametricQuality
*quality
;
161 ParametricMagnitude
*magnitude
;
162 ParametricMode
*mode
;
167 class ParametricWetness
: public BC_FPot
170 ParametricWetness(ParametricEQ
*plugin
, int x
, int y
);
172 ParametricEQ
*plugin
;
176 class ParametricWindow
: public BC_Window
179 ParametricWindow(ParametricEQ
*plugin
, int x
, int y
);
182 void create_objects();
185 void update_canvas();
187 BC_SubWindow
*canvas
;
188 ParametricEQ
*plugin
;
189 ParametricBandGUI
* bands
[BANDS
];
190 ParametricWetness
*wetness
;
193 class ParametricFFT
: public CrossfadeFFT
196 ParametricFFT(ParametricEQ
*plugin
);
199 int signal_process();
201 ParametricEQ
*plugin
;
205 class ParametricEQ
: public PluginAClient
208 ParametricEQ(PluginServer
*server
);
212 void read_data(KeyFrame
*keyframe
);
213 void save_data(KeyFrame
*keyframe
);
214 int process_realtime(int64_t size
, double *input_ptr
, double *output_ptr
);
222 double calculate_envelope();
223 double gauss(double sigma
, double a
, double x
);
225 double envelope
[WINDOW_SIZE
/ 2];
226 int need_reconfigure
;
227 PLUGIN_CLASS_MEMBERS(ParametricConfig
, ParametricThread
)