/*
* CINELERRA
* Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#ifndef PLUGINCLIENT_H
// Base class inherited by all the different types of plugins.
-#define BCASTDIR "~/.bcast5/"
#define MAX_FRAME_BUFFER 1024
class PluginClient;
class PluginClientWindow : public BC_Window
{
public:
- PluginClientWindow(PluginClient *client,
+ PluginClientWindow(PluginClient *client,
int w,
int h,
int min_w,
int min_h,
int allow_resize);
- PluginClientWindow(const char *title,
+ PluginClientWindow(const char *title,
int x,
int y,
int w,
int min_h,
int allow_resize);
virtual ~PluginClientWindow();
-
+
virtual int translation_event();
virtual int close_event();
-
+ virtual void done_event(int result) {}
+
PluginClient *client;
};
PluginClientThread(PluginClient *client);
~PluginClientThread();
void run();
-
+
friend class PluginClient;
BC_WindowBase* get_window();
PluginClient* get_client();
- BC_WindowBase *window;
+ PluginClientWindow *window;
PluginClient *client;
private:
friend class PluginClientThread;
friend class PluginClientWindow;
-
+
// Queries for the plugin server.
virtual int is_realtime();
virtual int is_audio();
// For realtime plugins give the requested framerate.
virtual double get_framerate();
virtual int delete_nonrealtime_parameters();
- virtual int start_plugin(); // run a non realtime plugin
virtual int get_parameters(); // get information from user before non realtime processing
virtual int64_t get_in_buffers(int64_t recommended_size); // return desired size for input buffers
virtual int64_t get_out_buffers(int64_t recommended_size); // return desired size for output buffers
virtual void update_gui();
virtual void save_data(KeyFrame *keyframe) {}; // write the plugin settings to text in text format
virtual void read_data(KeyFrame *keyframe) {}; // read the plugin settings from the text
- int send_hide_gui(); // should be sent when the GUI recieves a close event from the user
+ int send_hide_gui(); // should be sent when the GUI receives a close event from the user
// Destroys the window but not the thread pointer.
void hide_gui();
virtual int plugin_process_loop(VFrame **buffers, int64_t &write_length) { return 1; };
virtual int plugin_process_loop(Samples **buffers, int64_t &write_length) { return 1; };
// get parameters depending on video or audio
- virtual int init_realtime_parameters();
+ virtual int init_realtime_parameters();
// release objects which are required after playback stops
virtual void render_stop() {};
int get_gui_status();
// Get the directory for plugins
char* get_plugin_dir();
-// Return keyframe objects. The position in the resulting object
+// Return keyframe objects. The position in the resulting object
// is relative to the EDL rate. This is the only way to avoid copying the
// data for every frame.
// If the result is the default keyframe, the keyframe's position is 0.
-// position - relative to EDL rate or local rate to allow simple
+// position - relative to EDL rate or local rate to allow simple
// passing of get_source_position.
// If -1 the tracking position in the edl is used.
// is_local - if 1, the position is converted to the EDL rate.
// When this plugin is adjusted, propogate parameters back to EDL and virtual
// console. This gets a keyframe from the EDL, with the position set to the
// EDL tracking position.
- int send_configure_change();
+ int send_configure_change();
// Called from process_buffer
// rate. For others it's the start of the EDL selection in the EDL rate.
int64_t get_source_start();
-// Convert the position relative to the requested rate to the position
+// Convert the position relative to the requested rate to the position
// relative to the EDL rate. If the argument is < 0, it is not changed.
// Used for interpreting keyframes.
virtual int64_t local_to_edl(int64_t position);
// Non realtime operations for signal processors.
- virtual int plugin_start_loop(int64_t start,
- int64_t end,
- int64_t buffer_size,
+ virtual int plugin_start_loop(int64_t start,
+ int64_t end,
+ int64_t buffer_size,
int total_buffers);
int plugin_stop_loop();
int plugin_process_loop();
int get_project_samplerate();
// get framerate of EDL
double get_project_framerate();
+// get asset path
+ const char *get_source_path();
// Total number of processors - 1
int get_project_smp();
int get_aspect_ratio(float &aspect_w, float &aspect_h);
// Extension of plugin_run for derived plugins
virtual int plugin_command_derived(int plugin_command) { return 0; };
int plugin_get_range();
- int plugin_init_realtime(int realtime_priority,
+ int plugin_init_realtime(int realtime_priority,
int total_in_buffers,
int buffer_size);
// communication convenience routines for the base class
- int stop_gui_client();
+ int stop_gui_client();
int save_data_client();
int load_data_client();
int set_string_client(char *string); // set the string identifying the plugin
// ================================= Buffers ===============================
// number of double buffers for each channel
- ArrayList<int> double_buffers_in;
+ ArrayList<int> double_buffers_in;
ArrayList<int> double_buffers_out;
// When arming buffers need to know the offsets in all the buffers and which
// double buffers for each channel before rendering.
int show_initially; // set to show a realtime plugin initially
// range in project for processing
- int64_t start, end;
+ int64_t start, end;
int interactive; // for the progress bar plugin
int success;
int total_out_buffers; // total send buffers allocated by the server
- int total_in_buffers; // total recieve buffers allocated by the server
+ int total_in_buffers; // total receive buffers allocated by the server
int wr, rd; // File permissions for fileio plugins.
// These give the largest fragment the plugin is expected to handle.
// size of a send buffer to the server
- int64_t out_buffer_size;
-// size of a recieve buffer from the server
- int64_t in_buffer_size;
+ int64_t out_buffer_size;
+// size of a receive buffer from the server
+ int64_t in_buffer_size;
// it's the transition length. Relative to the requested rate.
int64_t total_len;
// Total number of processors available - 1
- int smp;
+ int smp;
PluginServer *server;
BC_Hash *defaults;
PluginClientThread *thread;