4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "reverbwindow.h"
29 #include "pluginaclient.h"
31 #define MAX_DELAY_INIT 1000
32 #define MIN_REFLECTIONS 1
33 #define MAX_REFLECTIONS 255
34 #define MAX_REFLENGTH 5000
42 int equivalent(ReverbConfig &that);
43 void copy_from(ReverbConfig &that);
44 void interpolate(ReverbConfig &prev,
48 int64_t current_frame);
58 int64_t lowpass1, lowpass2;
61 class Reverb : public PluginAClient
64 Reverb(PluginServer *server);
68 // int load_from_file(char *data);
69 // int save_to_file(char *data);
72 char config_directory[1024];
74 double **main_in, **main_out;
76 int64_t **ref_channels, **ref_offsets, **ref_lowpass;
78 int64_t dsp_in_length;
80 // skirts for lowpass filter
81 double **lowpass_in1, **lowpass_in2;
83 // required for all realtime/multichannel plugins
85 PLUGIN_CLASS_MEMBERS(ReverbConfig);
86 int process_realtime(int64_t size, Samples **input_ptr, Samples **output_ptr);
89 int is_multichannel();
92 void save_data(KeyFrame *keyframe);
93 void read_data(KeyFrame *keyframe);
96 ReverbEngine **engine;
100 class ReverbEngine : public Thread
103 ReverbEngine(Reverb *plugin);
106 int process_overlay(double *in, double *out, double &out1, double &out2, double level, int64_t lowpass, int64_t samplerate, int64_t size);
107 int process_overlays(int output_buffer, int64_t size);
108 int wait_process_overlays();
111 Mutex input_lock, output_lock;