1 #ifndef PLUGINACLIENT_H
2 #define PLUGINACLIENT_H
6 #include "maxbuffers.h"
7 #include "pluginclient.h"
9 class PluginAClient
: public PluginClient
12 PluginAClient(PluginServer
*server
);
13 virtual ~PluginAClient();
15 int get_render_ptrs();
16 int init_realtime_parameters();
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
,
24 // Single channel buffer process for backwards compatibility and transitions
25 virtual int process_realtime(int64_t size
,
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
,
36 int64_t start_position
,
38 virtual int process_buffer(int64_t size
,
40 int64_t start_position
,
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
,
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
,
63 int64_t start_position
,
65 int read_samples(double *buffer
,
66 int64_t start_position
,
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
,
75 int64_t start_position
,
78 // Get the sample rate of the EDL
79 int get_project_samplerate();
80 // Get the requested sample rate
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