BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
bseladspa.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_LADSPA_H__
3 #define __BSE_LADSPA_H__
4 
5 #include <bse/bseutils.hh>
6 #include <gmodule.h>
7 
8 G_BEGIN_DECLS
9 
10 /* --- object type macros --- */
11 #define BSE_TYPE_LADSPA_PLUGIN (BSE_TYPE_ID (BseLadspaPlugin))
12 #define BSE_LADSPA_PLUGIN(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPlugin))
13 #define BSE_LADSPA_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPluginClass))
14 #define BSE_IS_LADSPA_PLUGIN(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_LADSPA_PLUGIN))
15 #define BSE_IS_LADSPA_PLUGIN_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_LADSPA_PLUGIN))
16 #define BSE_LADSPA_PLUGIN_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_LADSPA_PLUGIN, BseLadspaPluginClass))
17 
18 
19 /* --- BseLadspaPlugin --- */
20 struct BseLadspaInfo;
21 typedef struct {
22  GType type;
23  BseLadspaInfo *info;
25 struct BseLadspaPlugin : GObject {
26  gchar *fname;
27  GModule *gmodule;
28  guint use_count;
29  guint n_types;
30  BseLadspaTypeInfo *types;
31 };
32 struct BseLadspaPluginClass : GObjectClass
33 {};
34 struct BseLadspaPort {
35  gchar *ident;
36  const gchar *name;
37  gfloat minimum;
38  gfloat default_value;
39  gfloat maximum;
40  guint port_index;
41  guint audio_channel : 1;
42  guint input : 1;
43  guint output : 1;
44  guint boolean : 1;
45  guint integer_stepping : 1;
46  guint rate_relative : 1; /* sample rate relative values */
47  guint frequency : 1; /* provide logarithmic frequency slider */
48  guint logarithmic : 1;
49  guint concert_a : 1; /* default to 440Hz concert A */
50 };
51 struct BseLadspaInfo {
52  gchar *file_path; /* fully qualified file path and name */
53  gchar *ident; /* unique identifier */
54  guint plugin_id; /* unique plugin type ID */
55  const gchar *name; /* descriptive name */
56  const gchar *author;
57  const gchar *copyright;
58  guint broken : 1;
59  guint interactive : 1; /* low-latency request */
60  guint rt_capable : 1; /* hard realtime capability */
61  guint n_cports;
62  BseLadspaPort *cports;
63  guint n_aports;
64  BseLadspaPort *aports;
65  gconstpointer descdata;
66  gpointer (*instantiate) (gconstpointer descdata,
67  gulong sample_rate);
68  void (*connect_port) (gpointer instance,
69  gulong port_index,
70  gfloat *location);
71  void (*activate) (gpointer instance);
72  void (*run) (gpointer instance,
73  gulong n_samples);
74  void (*deactivate) (gpointer instance);
75  void (*cleanup) (gpointer instance);
76 };
77 
78 BseLadspaInfo* bse_ladspa_info_assemble (const gchar *file_path,
79  gconstpointer ladspa_descriptor);
80 void bse_ladspa_info_free (BseLadspaInfo *bli);
81 SfiRing* bse_ladspa_plugin_path_list_files (void);
82 const gchar* bse_ladspa_plugin_check_load (const gchar *file_name);
83 gchar* bse_ladspa_info_port_2str (BseLadspaPort *port);
84 
85 G_END_DECLS
86 
87 #endif /* __BSE_LADSPA_H__ */
Definition: bseladspa.hh:21
Definition: bseladspa.hh:32
Definition: bseladspa.hh:25
Definition: bseladspa.hh:51
Definition: bseladspa.hh:34
Definition: sfiring.hh:23