license header for review
[cinelerra_cv/ct.git] / cinelerra / pluginaclientlad.h
blob8c8969ef7843cd52104603b16d22c6ac019bd22e
1 #ifndef PLUGINACLIENTLAD_H
2 #define PLUGINACLIENTLAD_H
4 #include "bcdisplayinfo.h"
5 #include "guicast.h"
6 #include "ladspa.h"
7 #include "pluginaclient.h"
8 #include "pluginaclientlad.inc"
11 class PluginAClientConfig
13 public:
14 PluginAClientConfig();
15 ~PluginAClientConfig();
17 int equivalent(PluginAClientConfig &that);
18 void copy_from(PluginAClientConfig &that);
19 void interpolate(PluginAClientConfig &prev,
20 PluginAClientConfig &next,
21 int64_t prev_frame,
22 int64_t next_frame,
23 int64_t current_frame);
24 void reset();
25 void delete_objects();
26 // Create the port tables based on the LAD descriptor
27 void initialize(PluginServer *server);
29 // Need total_ports record to avoid saving default data buffer ports.
30 int total_ports;
31 enum
33 PORT_NORMAL,
34 PORT_FREQ_INDEX,
35 PORT_TOGGLE,
36 PORT_INTEGER
38 int *port_type;
39 // Frequencies are stored in units of frequency to aid the GUI.
40 LADSPA_Data *port_data;
43 class PluginACLientToggle : public BC_CheckBox
45 public:
46 PluginACLientToggle(PluginAClientLAD *plugin,
47 int x,
48 int y,
49 LADSPA_Data *output);
50 int handle_event();
51 PluginAClientLAD *plugin;
52 LADSPA_Data *output;
55 class PluginACLientILinear : public BC_IPot
57 public:
58 PluginACLientILinear(PluginAClientLAD *plugin,
59 int x,
60 int y,
61 LADSPA_Data *output,
62 int min,
63 int max);
64 int handle_event();
65 PluginAClientLAD *plugin;
66 LADSPA_Data *output;
69 class PluginACLientFLinear : public BC_FPot
71 public:
72 PluginACLientFLinear(PluginAClientLAD *plugin,
73 int x,
74 int y,
75 LADSPA_Data *output,
76 float min,
77 float max);
78 int handle_event();
79 PluginAClientLAD *plugin;
80 LADSPA_Data *output;
83 class PluginACLientFreq : public BC_QPot
85 public:
86 PluginACLientFreq(PluginAClientLAD *plugin,
87 int x,
88 int y,
89 LADSPA_Data *output,
90 int translate_linear);
91 int handle_event();
92 PluginAClientLAD *plugin;
93 LADSPA_Data *output;
94 // Decode LAD frequency table
95 int translate_linear;
99 class PluginAClientWindow : public BC_Window
101 public:
102 PluginAClientWindow(PluginAClientLAD *plugin,
103 int x,
104 int y);
105 ~PluginAClientWindow();
107 int create_objects();
108 int close_event();
112 ArrayList<PluginACLientToggle*> toggles;
113 ArrayList<PluginACLientILinear*> ipots;
114 ArrayList<PluginACLientFLinear*> fpots;
115 ArrayList<PluginACLientFreq*> freqs;
117 PluginAClientLAD *plugin;
120 PLUGIN_THREAD_HEADER(PluginAClientLAD, PluginAClientThread, PluginAClientWindow)
122 class PluginAClientLAD : public PluginAClient
124 public:
125 PluginAClientLAD(PluginServer *server);
126 ~PluginAClientLAD();
128 int process_realtime(int64_t size,
129 double *input_ptr,
130 double *output_ptr);
131 int process_realtime(int64_t size,
132 double **input_ptr,
133 double **output_ptr);
134 // Update output pointers as well
135 void update_gui();
136 int is_realtime();
137 int is_multichannel();
138 int is_synthesis();
139 int uses_gui();
140 int load_defaults();
141 int save_defaults();
142 void save_data(KeyFrame *keyframe);
143 void read_data(KeyFrame *keyframe);
145 PLUGIN_CLASS_MEMBERS(PluginAClientConfig, PluginAClientThread)
148 static char* lad_to_string(char *string, char *input);
149 static char* lad_to_upper(char *string, char *input);
150 int get_inchannels();
151 int get_outchannels();
152 void delete_buffers();
153 void delete_plugin();
154 void init_plugin(int total_in, int total_out, int size);
156 // Temporaries for LAD data
157 LADSPA_Data **in_buffers;
158 int total_inbuffers;
159 LADSPA_Data **out_buffers;
160 int total_outbuffers;
161 int buffer_allocation;
162 LADSPA_Handle lad_instance;
163 LADSPA_Data dummy_control_output;
166 #endif
168 // Local Variables:
169 // mode: C++
170 // c-file-style: "linux"
171 // End: