record batch dir path fix, handle yuv in gl masking, sync up maskengine/playback3d...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / pluginaclient.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef PLUGINACLIENT_H
23 #define PLUGINACLIENT_H
24
25
26
27 #include "maxbuffers.h"
28 #include "pluginclient.h"
29 #include "samples.inc"
30
31 class PluginAClient : public PluginClient
32 {
33 public:
34         PluginAClient(PluginServer *server);
35         virtual ~PluginAClient();
36
37         int get_render_ptrs();
38         int init_realtime_parameters();
39
40         int is_audio();
41 // These should return 1 if error or 0 if success.
42 // Multichannel buffer process for backwards compatibility
43         virtual int process_realtime(int64_t size,
44                 Samples **input_ptr,
45                 Samples **output_ptr);
46 // Single channel buffer process for backwards compatibility and transitions
47         virtual int process_realtime(int64_t size,
48                 Samples *input_ptr,
49                 Samples *output_ptr);
50
51 // Process buffer using pull method.  By default this loads the input into the
52 // buffer and calls process_realtime with input and output pointing to buffer.
53 // start_position - requested position relative to sample_rate. Relative
54 //     to start of EDL.  End of buffer if reverse.
55 // sample_rate - scale of start_position.
56         virtual int process_buffer(int64_t size,
57                 Samples **buffer,
58                 int64_t start_position,
59                 int sample_rate);
60         virtual int process_buffer(int64_t size,
61                 Samples *buffer,
62                 int64_t start_position,
63                 int sample_rate);
64
65
66         virtual int process_loop(Samples *buffer, int64_t &write_length) { return 1; };
67         virtual int process_loop(Samples **buffers, int64_t &write_length) { return 1; };
68         int plugin_process_loop(Samples **buffers, int64_t &write_length);
69
70         int plugin_start_loop(int64_t start,
71                 int64_t end,
72                 int64_t buffer_size,
73                 int total_buffers);
74
75         int plugin_get_parameters();
76
77 // Called by non-realtime client to read audio for processing.
78 // buffer - output wave
79 // channel - channel of the plugin input for multichannel plugin
80 // start_position - start of samples in forward.  End of samples in reverse.
81 //     Relative to start of EDL.  Scaled to sample_rate.
82 // len - number of samples to read
83         int read_samples(Samples *buffer,
84                 int channel,
85                 int64_t start_position,
86                 int64_t len);
87         int read_samples(Samples *buffer,
88                 int64_t start_position,
89                 int64_t len);
90
91 // Called by realtime plugin to read audio from previous entity
92 // sample_rate - scale of start_position.  Provided so the client can get data
93 //     at a higher fidelity than provided by the EDL.
94         int read_samples(Samples *buffer,
95                 int channel,
96                 int sample_rate,
97                 int64_t start_position,
98                 int64_t len);
99
100 // Get the sample rate of the EDL
101         int get_project_samplerate();
102 // Get the requested sample rate
103         int get_samplerate();
104
105         int64_t local_to_edl(int64_t position);
106         int64_t edl_to_local(int64_t position);
107         int64_t get_startproject();
108         int64_t get_endproject();
109
110 // point to the start of the buffers
111         ArrayList<float**> input_ptr_master;
112         ArrayList<float**> output_ptr_master;
113 // point to the regions for a single render
114         float **input_ptr_render;
115         float **output_ptr_render;
116 // sample rate of EDL.  Used for normalizing keyframes
117         int project_sample_rate;
118 // Local parameters set by non realtime plugin about the file to be generated.
119 // Retrieved by server to set output file format.
120 // In realtime plugins, these are set before every process_buffer as the
121 // requested rates.
122         int sample_rate;
123 };
124
125
126
127 #endif