BEAST - Free Software Audio Synthesizer and Tracker  0.9.2
bsesnet.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_SNET_H__
3 #define __BSE_SNET_H__
4 
5 #include <bse/bsesuper.hh>
6 
7 
8 G_BEGIN_DECLS
9 
10 
11 /* --- object type macros --- */
12 #define BSE_TYPE_SNET (BSE_TYPE_ID (BseSNet))
13 #define BSE_SNET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_SNET, BseSNet))
14 #define BSE_SNET_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_SNET, BseSNetClass))
15 #define BSE_IS_SNET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_SNET))
16 #define BSE_IS_SNET_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_SNET))
17 #define BSE_SNET_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_SNET, BseSNetClass))
18 #define BSE_SNET_USER_SYNTH(src) ((BSE_OBJECT_FLAGS (src) & BSE_SNET_FLAG_USER_SYNTH) != 0)
19 
20 typedef enum /*< skip >*/
21 {
22  BSE_SNET_FLAG_USER_SYNTH = 1 << (BSE_SUPER_FLAGS_USHIFT + 0)
23 } BseSNetFlags;
24 #define BSE_SNET_FLAGS_USHIFT (BSE_SUPER_FLAGS_USHIFT + 1)
25 
26 struct BseSNetPort {
27  gchar *name;
28  guint context : 31;
29  guint input : 1;
30  BseModule *src_omodule; /* output */
31  guint src_ostream;
32  BseModule *dest_imodule; /* input */
33  guint dest_istream;
34 };
35 
36 struct BseSNet : BseSuper {
37  SfiRing *sources; /* of type BseSource* */
38  SfiRing *isources; /* internal (protected) sources */
39  GSList *iport_names;
40  GSList *oport_names;
41  GBSearchArray *port_array; /* of type BseSNetPort* */
42  GSList *tmp_context_children;
43  guint port_unregistered_id;
44 };
46 {};
47 
49  BseMidiReceiver *midi_receiver;
50  guint midi_channel;
51  guint voice_id;
52 };
53 
54 guint bse_snet_create_context (BseSNet *snet,
55  BseMidiContext mcontext,
56  BseTrans *trans);
57 guint bse_snet_context_clone_branch (BseSNet *self,
58  guint context,
59  BseSource *context_merger,
60  BseMidiContext mcontext,
61  BseTrans *trans);
62 gboolean bse_snet_context_is_branch (BseSNet *self,
63  guint context_id);
64 void bse_snet_intern_child (BseSNet *self,
65  gpointer child);
66 BseMidiContext bse_snet_get_midi_context (BseSNet *snet,
67  guint context_handle);
68 const gchar* bse_snet_iport_name_register (BseSNet *snet,
69  const gchar *tmpl_name);
70 gboolean bse_snet_iport_name_registered (BseSNet *snet,
71  const gchar *name);
72 void bse_snet_iport_name_unregister (BseSNet *snet,
73  const gchar *name);
74 const gchar* bse_snet_oport_name_register (BseSNet *snet,
75  const gchar *tmpl_name);
76 gboolean bse_snet_oport_name_registered (BseSNet *snet,
77  const gchar *name);
78 void bse_snet_oport_name_unregister (BseSNet *snet,
79  const gchar *name);
80 void bse_snet_set_iport_src (BseSNet *snet,
81  const gchar *port_name,
82  guint snet_context,
83  BseModule *omodule,
84  guint ostream,
85  BseTrans *trans);
86 void bse_snet_set_iport_dest (BseSNet *snet,
87  const gchar *port_name,
88  guint snet_context,
89  BseModule *imodule,
90  guint istream,
91  BseTrans *trans);
92 void bse_snet_set_oport_src (BseSNet *snet,
93  const gchar *port_name,
94  guint snet_context,
95  BseModule *omodule,
96  guint ostream,
97  BseTrans *trans);
98 void bse_snet_set_oport_dest (BseSNet *snet,
99  const gchar *port_name,
100  guint snet_context,
101  BseModule *imodule,
102  guint istream,
103  BseTrans *trans);
104 
105 G_END_DECLS
106 
107 namespace Bse {
108 
109 class SNetImpl : public SuperImpl, public virtual SNetIface {
110 protected:
111  virtual ~SNetImpl ();
112 public:
113  explicit SNetImpl (BseObject*);
114  virtual bool supports_user_synths () override;
115 };
116 
117 } // Bse
118 
119 #endif /* __BSE_SNET_H__ */
virtual bool supports_user_synths() override
See SNet::supports_user_synths()
Definition: bsesnet.cc:963
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:67
Definition: bsesnet.hh:109
Definition: bsesnet.hh:26
Definition: bsesnet.hh:48
Definition: bsesnet.hh:36
Definition: bsesuper.hh:25
Definition: gbsearcharray.hh:37
Definition: bsesuper.hh:31
void bse_snet_intern_child(BseSNet *self, gpointer child)
Definition: bsesnet.cc:94
Definition: bseobject.hh:60
Definition: bsesuper.hh:44
Definition: bsesource.hh:84
Definition: sfiring.hh:23
Definition: bsesnet.hh:45
See also the corresponding IDL class SNet.
Definition: bseserverapi.hh:801