BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __BSE_LADSPA_H__ 00003 #define __BSE_LADSPA_H__ 00004 00005 #include <bse/bseutils.hh> 00006 #include <gmodule.h> 00007 00008 G_BEGIN_DECLS 00009 00010 /* --- object type macros --- */ 00011 #define BSE_TYPE_LADSPA_PLUGIN (BSE_TYPE_ID (BseLadspaPlugin)) 00012 #define BSE_LADSPA_PLUGIN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPlugin)) 00013 #define BSE_LADSPA_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPluginClass)) 00014 #define BSE_IS_LADSPA_PLUGIN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_LADSPA_PLUGIN)) 00015 #define BSE_IS_LADSPA_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_LADSPA_PLUGIN)) 00016 #define BSE_LADSPA_PLUGIN_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPluginClass)) 00017 00018 00019 /* --- BseLadspaPlugin --- */ 00020 struct BseLadspaInfo; 00021 typedef struct { 00022 GType type; 00023 BseLadspaInfo *info; 00024 } BseLadspaTypeInfo; 00025 struct BseLadspaPlugin : GObject { 00026 gchar *fname; 00027 GModule *gmodule; 00028 guint use_count; 00029 guint n_types; 00030 BseLadspaTypeInfo *types; 00031 }; 00032 struct BseLadspaPluginClass : GObjectClass 00033 {}; 00034 struct BseLadspaPort { 00035 gchar *ident; 00036 const gchar *name; 00037 gfloat minimum; 00038 gfloat default_value; 00039 gfloat maximum; 00040 guint port_index; 00041 guint audio_channel : 1; 00042 guint input : 1; 00043 guint output : 1; 00044 guint boolean : 1; 00045 guint integer_stepping : 1; 00046 guint rate_relative : 1; /* sample rate relative values */ 00047 guint frequency : 1; /* provide logarithmic frequency slider */ 00048 guint logarithmic : 1; 00049 guint concert_a : 1; /* default to 440Hz concert A */ 00050 }; 00051 struct BseLadspaInfo { 00052 gchar *file_path; /* fully qualified file path and name */ 00053 gchar *ident; /* unique identifier */ 00054 guint plugin_id; /* unique plugin type ID */ 00055 const gchar *name; /* descriptive name */ 00056 const gchar *author; 00057 const gchar *copyright; 00058 guint broken : 1; 00059 guint interactive : 1; /* low-latency request */ 00060 guint rt_capable : 1; /* hard realtime capability */ 00061 guint n_cports; 00062 BseLadspaPort *cports; 00063 guint n_aports; 00064 BseLadspaPort *aports; 00065 gconstpointer descdata; 00066 gpointer (*instantiate) (gconstpointer descdata, 00067 gulong sample_rate); 00068 void (*connect_port) (gpointer instance, 00069 gulong port_index, 00070 gfloat *location); 00071 void (*activate) (gpointer instance); 00072 void (*run) (gpointer instance, 00073 gulong n_samples); 00074 void (*deactivate) (gpointer instance); 00075 void (*cleanup) (gpointer instance); 00076 }; 00077 00078 BseLadspaInfo* bse_ladspa_info_assemble (const gchar *file_path, 00079 gconstpointer ladspa_descriptor); 00080 void bse_ladspa_info_free (BseLadspaInfo *bli); 00081 SfiRing* bse_ladspa_plugin_path_list_files (void); 00082 const gchar* bse_ladspa_plugin_check_load (const gchar *file_name); 00083 gchar* bse_ladspa_info_port_2str (BseLadspaPort *port); 00084 00085 G_END_DECLS 00086 00087 #endif /* __BSE_LADSPA_H__ */