#include "edl.inc"
#include "floatauto.inc"
#include "floatautos.inc"
+#include "garbage.h"
#include "keyframe.inc"
#include "ladspa.h"
#include "mainprogress.inc"
#include "mwindow.inc"
#include "plugin.inc"
#include "pluginaclientlad.inc"
+#include "pluginfclient.inc"
#include "pluginclient.inc"
#include "pluginserver.inc"
#include "preferences.inc"
#include <dlfcn.h>
-
-
-class PluginObj
-{
+class PluginObj : public Garbage {
void *dlobj;
public:
- PluginObj() { dlobj = 0; }
- ~PluginObj() {}
- PluginObj(PluginObj &that) { dlobj = 0; }
-// dl interface
- void *load_obj() { return dlobj; }
- void *load_obj(const char *path) { return dlobj = dlopen(path, RTLD_NOW); }
- static void unload_obj(void *dlp) { if( dlp ) dlclose(dlp); }
- void unload_obj() { unload_obj(dlobj); }
+
+ void *load(const char *dlp) { return dlobj = dlopen(dlp, RTLD_NOW); }
+ void *load(const char *plugin_dir, const char *path);
+ void unload(void *obj) { dlclose(obj); }
void *load_sym(const char *sym) { return dlsym(dlobj, sym); }
const char *load_error() { return dlerror(); }
+ void *obj() { return dlobj; }
+
+ PluginObj() : Garbage("PluginObj:Garbage") { dlobj = 0; }
+ ~PluginObj() { if( dlobj ) unload(dlobj); }
};
-class PluginServer : public PluginObj
+class PluginServer
{
+ PluginObj *plugin_obj;
+ int load_obj();
+ const char *load_error();
+ void *get_sym(const char *sym);
+
int reset_parameters();
+ void init();
int cleanup_plugin();
// Base class created by client
PluginClient* (*new_plugin)(PluginServer*);
// LAD support
- int is_lad;
int lad_index;
LADSPA_Descriptor_Function lad_descriptor_function;
const LADSPA_Descriptor *lad_descriptor;
int use_opengl;
+// FFMPEG support
+ const char *ff_name;
// Driver for opengl calls.
VideoDevice *vdevice;
public:
PluginServer();
- PluginServer(char *path, MWindow *mwindow=0);
+ PluginServer(MWindow *mwindow, char *path, int type);
PluginServer(PluginServer &);
virtual ~PluginServer();
-
friend class PluginAClientLAD;
friend class PluginAClientConfig;
friend class PluginAClientWindow;
+ friend class PluginFClient;
+ friend class PluginFAClient;
+ friend class PluginFVClient;
+ friend class PluginFClientConfig;
+ friend class PluginFClientWindow;
+
// open a plugin and wait for commands
// Get information for plugindb if master.
#define PLUGINSERVER_IS_LAD 2
EDL *edl, Plugin *plugin);
// close the plugin
int close_plugin();
- void delete_this();
- char *get_plugin_png_path(char *png_path);
+ int get_theme_png_path(char *png_path, const char *theme_dir);
+ int get_theme_png_path(char *png_path, Theme *theme);
+ int get_plugin_png_path(char *png_path);
void dump(FILE *fp=stdout);
// Release any objects which are required after playback stops.
void render_stop();
// Write entry into plugin table
void write_table(FILE *fp, int idx);
- static char *table_quoted_field(char *&sp);
+ static int scan_table(char *text, int &type, char *path, char *title);
int read_table(char *text);
// queries
void set_title(const char *string);
// Get picon png vframe image
VFrame *get_picon();
VFrame *get_plugin_images();
+
// ladspa
void set_lad_index(int i);
int get_lad_index();
int is_ladspa();
+// ffmpeg
+ int is_ffmpeg();
+ PluginClient *new_ffmpeg_plugin();
// =============================== for realtime plugins
// save configuration of plugin
void save_data(KeyFrame *keyframe);
double get_framerate(); // get framerate produced by plugin
int get_project_samplerate(); // get samplerate of project data before processing
double get_project_framerate(); // get framerate of project data before processing
- int set_path(char *path); // required first
- char* get_path();
+ void set_path(const char *path); // required first
+ char *get_path();
int get_synthesis();
void get_defaults_path(char *path);
void save_defaults();
int64_t get_written_samples(); // after samples are written, get the number written
int64_t get_written_frames(); // after frames are written, get the number written
+// client origin
+ int plugin_type;
// buffers
int64_t out_buffer_size; // size of a send buffer to the plugin