Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

pluginaclient.h

Go to the documentation of this file.
00001 #ifndef PLUGINACLIENT_H
00002 #define PLUGINACLIENT_H
00003 
00004 
00005 
00006 #include "maxbuffers.h"
00007 #include "pluginclient.h"
00008 
00009 class PluginAClient : public PluginClient
00010 {
00011 public:
00012         PluginAClient(PluginServer *server);
00013         virtual ~PluginAClient();
00014         
00015         int get_render_ptrs();
00016         int init_realtime_parameters();
00017 
00018         int is_audio();
00019 // These should return 1 if error or 0 if success.
00020 // Multichannel buffer process for backwards compatibility
00021         virtual int process_realtime(int64_t size, 
00022                 double **input_ptr, 
00023                 double **output_ptr);
00024 // Single channel buffer process for backwards compatibility and transitions
00025         virtual int process_realtime(int64_t size, 
00026                 double *input_ptr, 
00027                 double *output_ptr);
00028 
00029 // Process buffer using pull method.  By default this loads the input into the
00030 // buffer and calls process_realtime with input and output pointing to buffer.
00031 // start_position - requested position relative to sample_rate. Relative
00032 //     to start of EDL.  End of buffer if reverse.
00033 // sample_rate - scale of start_position.
00034         virtual int process_buffer(int64_t size, 
00035                 double **buffer,
00036                 int64_t start_position,
00037                 int sample_rate);
00038         virtual int process_buffer(int64_t size, 
00039                 double *buffer,
00040                 int64_t start_position,
00041                 int sample_rate);
00042 
00043 
00044         virtual int process_loop(double *buffer, int64_t &write_length) { return 1; };
00045         virtual int process_loop(double **buffers, int64_t &write_length) { return 1; };
00046         int plugin_process_loop(double **buffers, int64_t &write_length);
00047 
00048         int plugin_start_loop(int64_t start, 
00049                 int64_t end, 
00050                 int64_t buffer_size, 
00051                 int total_buffers);
00052 
00053         int plugin_get_parameters();
00054 
00055 // Called by non-realtime client to read audio for processing.
00056 // buffer - output wave
00057 // channel - channel of the plugin input for multichannel plugin
00058 // start_position - start of samples in forward.  End of samples in reverse.
00059 //     Relative to start of EDL.  Scaled to sample_rate.
00060 // len - number of samples to read
00061         int read_samples(double *buffer, 
00062                 int channel, 
00063                 int64_t start_position, 
00064                 int64_t len);
00065         int read_samples(double *buffer, 
00066                 int64_t start_position, 
00067                 int64_t len);
00068 
00069 // Called by realtime plugin to read audio from previous entity
00070 // sample_rate - scale of start_position.  Provided so the client can get data
00071 //     at a higher fidelity than provided by the EDL.
00072         int read_samples(double *buffer,
00073                 int channel,
00074                 int sample_rate,
00075                 int64_t start_position,
00076                 int64_t len);
00077 
00078 // Get the sample rate of the EDL
00079         int get_project_samplerate();
00080 // Get the requested sample rate
00081         int get_samplerate();
00082 
00083         int64_t local_to_edl(int64_t position);
00084         int64_t edl_to_local(int64_t position);
00085 
00086         void send_render_gui(void *data, int size);
00087         void plugin_render_gui(void *data, int size);
00088         virtual void render_gui(void *data, int size) {};
00089 
00090 // point to the start of the buffers
00091         ArrayList<float**> input_ptr_master;
00092         ArrayList<float**> output_ptr_master;
00093 // point to the regions for a single render
00094         float **input_ptr_render;
00095         float **output_ptr_render;
00096 // sample rate of EDL.  Used for normalizing keyframes
00097         int project_sample_rate;
00098 // Local parameters set by non realtime plugin about the file to be generated.
00099 // Retrieved by server to set output file format.
00100 // In realtime plugins, these are set before every process_buffer as the
00101 // requested rates.
00102         int sample_rate;
00103 };
00104 
00105 
00106 
00107 #endif

Generated on Sun Jan 8 13:38:58 2006 for Cinelerra-svn by  doxygen 1.4.4