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
22 #ifndef PLUGINACLIENTLAD_H
23 #define PLUGINACLIENTLAD_H
25 #include "bcdisplayinfo.h"
28 #include "pluginaclient.h"
29 #include "pluginaclientlad.inc"
30 #include "samples.inc"
33 class PluginAClientConfig
36 PluginAClientConfig();
37 ~PluginAClientConfig();
39 int equivalent(PluginAClientConfig &that);
40 void copy_from(PluginAClientConfig &that);
41 void interpolate(PluginAClientConfig &prev,
42 PluginAClientConfig &next,
45 int64_t current_frame);
47 void delete_objects();
48 // Create the port tables based on the LAD descriptor
49 void initialize(PluginServer *server);
51 // Need total_ports record to avoid saving default data buffer ports.
61 // Frequencies are stored in units of frequency to aid the GUI.
62 LADSPA_Data *port_data;
65 class PluginACLientToggle : public BC_CheckBox
68 PluginACLientToggle(PluginAClientLAD *plugin,
73 PluginAClientLAD *plugin;
77 class PluginACLientILinear : public BC_IPot
80 PluginACLientILinear(PluginAClientLAD *plugin,
87 PluginAClientLAD *plugin;
91 class PluginACLientFLinear : public BC_FPot
94 PluginACLientFLinear(PluginAClientLAD *plugin,
101 PluginAClientLAD *plugin;
105 class PluginACLientFreq : public BC_QPot
108 PluginACLientFreq(PluginAClientLAD *plugin,
112 int translate_linear);
114 PluginAClientLAD *plugin;
116 // Decode LAD frequency table
117 int translate_linear;
121 class PluginAClientWindow : public PluginClientWindow
124 PluginAClientWindow(PluginAClientLAD *plugin);
125 ~PluginAClientWindow();
127 void create_objects();
132 ArrayList<PluginACLientToggle*> toggles;
133 ArrayList<PluginACLientILinear*> ipots;
134 ArrayList<PluginACLientFLinear*> fpots;
135 ArrayList<PluginACLientFreq*> freqs;
137 PluginAClientLAD *plugin;
141 class PluginAClientLAD : public PluginAClient
144 PluginAClientLAD(PluginServer *server);
147 int process_realtime(int64_t size,
149 Samples *output_ptr);
150 int process_realtime(int64_t size,
152 Samples **output_ptr);
153 // Update output pointers as well
156 int is_multichannel();
159 void save_data(KeyFrame *keyframe);
160 void read_data(KeyFrame *keyframe);
162 PLUGIN_CLASS_MEMBERS(PluginAClientConfig)
165 static char* lad_to_string(char *string, const char *input);
166 static char* lad_to_upper(char *string, const char *input);
167 int get_inchannels();
168 int get_outchannels();
169 void delete_buffers();
170 void delete_plugin();
171 void init_plugin(int total_in, int total_out, int size);
173 // Temporaries for LAD data
174 LADSPA_Data **in_buffers;
176 LADSPA_Data **out_buffers;
177 int total_outbuffers;
178 int buffer_allocation;
179 LADSPA_Handle lad_instance;
180 LADSPA_Data dummy_control_output;