BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
bseprocedure.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_PROCEDURE_H__
3 #define __BSE_PROCEDURE_H__
4 
5 #include <bse/bseparam.hh>
6 
7 G_BEGIN_DECLS
8 
9 /* --- BSE type macros --- */
10 #define BSE_PROCEDURE_TYPE(proc) (G_TYPE_FROM_CLASS (proc))
11 #define BSE_IS_PROCEDURE_CLASS(proc) (G_TYPE_CHECK_CLASS_TYPE ((proc), BSE_TYPE_PROCEDURE))
12 #define BSE_PROCEDURE_NAME(proc) (g_type_name (BSE_PROCEDURE_TYPE (proc)))
13 
14 
15 /* --- limits --- */
16 #define BSE_PROCEDURE_MAX_IN_PARAMS (16)
17 #define BSE_PROCEDURE_MAX_OUT_PARAMS (16)
18 
19 
20 /* --- BseProcedureClass --- */
21 typedef void (*BseProcedureInit) (BseProcedureClass *proc,
22  GParamSpec **in_pspecs,
23  GParamSpec **out_pspecs);
24 typedef Bse::Error (*BseProcedureExec) (BseProcedureClass *procedure,
25  const GValue *in_values,
26  GValue *out_values);
28 {
29  GTypeClass bse_class;
30 
31  /* implementation hint */
32  guint private_id;
33 
34  /* in/out parameters */
35  guint n_in_pspecs;
36  GParamSpec **in_pspecs;
37  guint n_out_pspecs;
38  GParamSpec **out_pspecs;
39  /* keep type references during class lifetime */
40  GTypeClass **class_refs;
41  guint cache_stamp;
42  gpointer cache_next;
43 
44  BseProcedureExec execute;
45 };
46 
47 
48 /* --- notifiers --- */
49 typedef gboolean (*BseProcedureNotify) (gpointer func_data,
50  const gchar *proc_name,
51  Bse::Error exit_status);
52 typedef Bse::Error (*BseProcedureMarshal) (gpointer marshal_data,
53  BseProcedureClass *proc,
54  const GValue *ivalues,
55  GValue *ovalues);
56 
57 
58 /* --- prototypes --- */
59 /* execute procedure, passing n_in_pspecs param values for in
60  * values and n_out_pspecs param value locations for out values
61  */
62 Bse::Error bse_procedure_exec (const gchar *proc_name,
63  ...);
64 Bse::Error bse_procedure_exec_void (const gchar *proc_name,
65  ...);
66 GType bse_procedure_lookup (const gchar *proc_name);
67 Bse::Error bse_procedure_marshal_valist (GType proc_type,
68  const GValue *first_value,
69  BseProcedureMarshal marshal,
70  gpointer marshal_data,
71  gboolean skip_ovalues,
72  va_list var_args);
73 Bse::Error bse_procedure_marshal (GType proc_type,
74  const GValue *ivalues,
75  GValue *ovalues,
76  BseProcedureMarshal marshal,
77  gpointer marshal_data);
78 Bse::Error bse_procedure_collect_input_args (BseProcedureClass *proc,
79  const GValue *first_value,
80  va_list var_args,
81  GValue ivalues[BSE_PROCEDURE_MAX_IN_PARAMS]);
82 Bse::Error bse_procedure_execvl (BseProcedureClass *proc,
83  GSList *in_value_list,
84  GSList *out_value_list,
85  BseProcedureMarshal marshal,
86  gpointer marshal_data);
87 
88 
89 /* --- internal --- */
90 const gchar* bse_procedure_type_register (const gchar *name,
91  BsePlugin *plugin,
92  GType *ret_type);
93 
94 G_END_DECLS
95 
96 #endif /* __BSE_PROCEDURE_H__ */
Definition: bseprocedure.hh:27
Bse::Error bse_procedure_marshal_valist(GType proc_type, const GValue *first_value, BseProcedureMarshal marshal, gpointer marshal_data, gboolean skip_ovalues, va_list var_args)
Definition: bseprocedure.cc:451
Bse::Error bse_procedure_collect_input_args(BseProcedureClass *proc, const GValue *first_value, va_list var_args, GValue ivalues[BSE_PROCEDURE_MAX_IN_PARAMS])
Definition: bseprocedure.cc:483
Definition: bseplugin.hh:18