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"
35 int equivalent(ChorusConfig &that);
36 void copy_from(ChorusConfig &that);
37 void interpolate(ChorusConfig &prev,
41 int64_t current_frame);
45 // number of voices per channel to be rendered
47 // starting phase offset in ms
49 // how much the phase oscillates in ms
51 // rate of phase oscillation in Hz
53 // how much of input signal
57 // state of a single voice
63 // position in the waveform table
67 // destination channel
72 // each sample in the flanging waveform
79 class Chorus : public PluginAClient
82 Chorus(PluginServer *server);
89 // required for all realtime/multichannel plugins
90 PLUGIN_CLASS_MEMBERS(ChorusConfig);
91 int process_buffer(int64_t size,
93 int64_t start_position,
95 void reallocate_dsp(int new_dsp_allocated);
96 void reallocate_history(int new_allocation);
101 int is_multichannel();
102 void save_data(KeyFrame *keyframe);
103 void read_data(KeyFrame *keyframe);
105 double **history_buffer;
106 // Number of samples in the history buffer
107 int64_t history_size;
109 // the temporary all voices are painted on
111 int dsp_in_allocated;
114 // flanging table is a whole number of samples that repeats
115 // always an even number
117 flange_sample_t *flanging_table;
120 int64_t last_position;
122 int need_reconfigure;
128 class ChorusWindow : public PluginClientWindow
131 ChorusWindow(Chorus *plugin);
134 void create_objects();
136 void param_updated();
143 PluginParam *wetness;