4 * Copyright (C) 2008-2019 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
27 #include "pluginaclient.h"
36 int equivalent(FlangerConfig &that);
37 void copy_from(FlangerConfig &that);
38 void interpolate(FlangerConfig &prev,
42 int64_t current_frame);
47 // starting position of oscillation in %
49 // how much the phase oscillates in ms
51 // rate of phase oscillation in Hz
53 // how much of input signal
58 // state of a single voice
64 // position in the waveform table
68 // each sample in the flanging waveform
75 class Flanger : public PluginAClient
78 Flanger(PluginServer *server);
85 // required for all realtime/multichannel plugins
86 PLUGIN_CLASS_MEMBERS(FlangerConfig);
87 int process_buffer(int64_t size,
89 int64_t start_position,
91 void reallocate_dsp(int new_dsp_allocated);
92 void reallocate_history(int new_allocation);
96 int is_multichannel();
97 void save_data(KeyFrame *keyframe);
98 void read_data(KeyFrame *keyframe);
100 double *history_buffer;
101 // Number of samples in the history buffer
102 int64_t history_size;
104 // the temporary all voices are painted on
106 int dsp_in_allocated;
109 // flanging table is a whole number of samples that repeats
110 // always an even number
112 flange_sample_t *flanging_table;
115 int64_t last_position;
117 int need_reconfigure;
124 class FlangerWindow : public PluginClientWindow
127 FlangerWindow(Flanger *plugin);
130 void create_objects();
132 void param_updated();
136 PluginParam *starting_phase;
139 PluginParam *wetness;