Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / pluginaclient.h
blobe5d20ac324242f29e00c1b28c16c6778454c5de6
1 #ifndef PLUGINACLIENT_H
2 #define PLUGINACLIENT_H
6 #include "maxbuffers.h"
7 #include "pluginclient.h"
9 class PluginAClient : public PluginClient
11 public:
12 PluginAClient(PluginServer *server);
13 virtual ~PluginAClient();
15 int get_render_ptrs();
16 int init_realtime_parameters();
18 int is_audio();
19 // These should return 1 if error or 0 if success.
20 // Multichannel buffer process for backwards compatibility
21 virtual int process_realtime(int64_t size,
22 double **input_ptr,
23 double **output_ptr);
24 // Single channel buffer process for backwards compatibility and transitions
25 virtual int process_realtime(int64_t size,
26 double *input_ptr,
27 double *output_ptr);
29 // Process buffer using pull method. By default this loads the input into the
30 // buffer and calls process_realtime with input and output pointing to buffer.
31 // start_position - requested position relative to sample_rate. Relative
32 // to start of EDL. End of buffer if reverse.
33 // sample_rate - scale of start_position.
34 virtual int process_buffer(int64_t size,
35 double **buffer,
36 int64_t start_position,
37 int sample_rate);
38 virtual int process_buffer(int64_t size,
39 double *buffer,
40 int64_t start_position,
41 int sample_rate);
44 virtual int process_loop(double *buffer, int64_t &write_length) { return 1; };
45 virtual int process_loop(double **buffers, int64_t &write_length) { return 1; };
46 int plugin_process_loop(double **buffers, int64_t &write_length);
48 int plugin_start_loop(int64_t start,
49 int64_t end,
50 int64_t buffer_size,
51 int total_buffers);
53 int plugin_get_parameters();
55 // Called by non-realtime client to read audio for processing.
56 // buffer - output wave
57 // channel - channel of the plugin input for multichannel plugin
58 // start_position - start of samples in forward. End of samples in reverse.
59 // Relative to start of EDL. Scaled to sample_rate.
60 // len - number of samples to read
61 int read_samples(double *buffer,
62 int channel,
63 int64_t start_position,
64 int64_t len);
65 int read_samples(double *buffer,
66 int64_t start_position,
67 int64_t len);
69 // Called by realtime plugin to read audio from previous entity
70 // sample_rate - scale of start_position. Provided so the client can get data
71 // at a higher fidelity than provided by the EDL.
72 int read_samples(double *buffer,
73 int channel,
74 int sample_rate,
75 int64_t start_position,
76 int64_t len);
78 // Get the sample rate of the EDL
79 int get_project_samplerate();
80 // Get the requested sample rate
81 int get_samplerate();
83 int64_t local_to_edl(int64_t position);
84 int64_t edl_to_local(int64_t position);
86 void send_render_gui(void *data, int size);
87 void plugin_render_gui(void *data, int size);
88 virtual void render_gui(void *data, int size) {};
90 // point to the start of the buffers
91 ArrayList<float**> input_ptr_master;
92 ArrayList<float**> output_ptr_master;
93 // point to the regions for a single render
94 float **input_ptr_render;
95 float **output_ptr_render;
96 // sample rate of EDL. Used for normalizing keyframes
97 int project_sample_rate;
98 // Local parameters set by non realtime plugin about the file to be generated.
99 // Retrieved by server to set output file format.
100 // In realtime plugins, these are set before every process_buffer as the
101 // requested rates.
102 int sample_rate;
107 #endif
109 // Local Variables:
110 // mode: C++
111 // c-file-style: "linux"
112 // End: