6 #include "defaults.inc"
9 #include "pluginaclient.h"
12 class CompressorEffect
;
18 class CompressorCanvas
: public BC_SubWindow
21 CompressorCanvas(CompressorEffect
*plugin
, int x
, int y
, int w
, int h
);
22 int button_press_event();
23 int button_release_event();
24 int cursor_motion_event();
34 int current_operation
;
35 CompressorEffect
*plugin
;
39 class CompressorPreview
: public BC_TextBox
42 CompressorPreview(CompressorEffect
*plugin
, int x
, int y
);
44 CompressorEffect
*plugin
;
47 class CompressorReaction
: public BC_TextBox
50 CompressorReaction(CompressorEffect
*plugin
, int x
, int y
);
52 CompressorEffect
*plugin
;
55 class CompressorClear
: public BC_GenericButton
58 CompressorClear(CompressorEffect
*plugin
, int x
, int y
);
60 CompressorEffect
*plugin
;
63 class CompressorX
: public BC_TextBox
66 CompressorX(CompressorEffect
*plugin
, int x
, int y
);
68 CompressorEffect
*plugin
;
71 class CompressorY
: public BC_TextBox
74 CompressorY(CompressorEffect
*plugin
, int x
, int y
);
76 CompressorEffect
*plugin
;
79 class CompressorTrigger
: public BC_TextBox
82 CompressorTrigger(CompressorEffect
*plugin
, int x
, int y
);
84 CompressorEffect
*plugin
;
91 class CompressorWindow
: public BC_Window
94 CompressorWindow(CompressorEffect
*plugin
, int x
, int y
);
95 void create_objects();
97 void update_textboxes();
103 CompressorCanvas
*canvas
;
104 CompressorPreview
*preview
;
105 CompressorReaction
*reaction
;
106 CompressorClear
*clear
;
109 CompressorTrigger
*trigger
;
110 CompressorEffect
*plugin
;
113 PLUGIN_THREAD_HEADER(CompressorEffect
, CompressorThread
, CompressorWindow
)
118 // DB from min_db - 0
120 } compressor_point_t
;
122 class CompressorConfig
127 void copy_from(CompressorConfig
&that
);
128 int equivalent(CompressorConfig
&that
);
129 void interpolate(CompressorConfig
&prev
,
130 CompressorConfig
&next
,
133 int64_t current_frame
);
136 void remove_point(int number
);
138 // Return values of a specific point
139 double get_y(int number
);
140 double get_x(int number
);
141 // Returns db output given linear input
142 double calculate_db(double x
);
143 int set_point(double x
, double y
);
152 ArrayList
<compressor_point_t
> levels
;
155 class CompressorEffect
: public PluginAClient
158 CompressorEffect(PluginServer
*server
);
161 int is_multichannel();
163 void read_data(KeyFrame
*keyframe
);
164 void save_data(KeyFrame
*keyframe
);
165 int process_realtime(int64_t size
, double **input_ptr
, double **output_ptr
);
176 PLUGIN_CLASS_MEMBERS(CompressorConfig
, CompressorThread
)
178 double **input_buffer
;
180 int64_t input_allocated
;
181 double *reaction_buffer
;
182 int64_t reaction_allocated
;
183 int64_t reaction_position
;
185 double previous_slope
;
186 double previous_intercept
;
188 double previous_coef
;
192 // Same coefs are applied to all channels
194 int64_t coefs_allocated
;
195 int64_t last_peak_age
;