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