BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
bsebus.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_BUS_H__
3 #define __BSE_BUS_H__
4 
5 #include <bse/bsesubsynth.hh>
6 
7 G_BEGIN_DECLS
8 
9 /* --- object type macros --- */
10 #define BSE_TYPE_BUS (BSE_TYPE_ID (BseBus))
11 #define BSE_BUS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_BUS, BseBus))
12 #define BSE_BUS_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_BUS, BseBusClass))
13 #define BSE_IS_BUS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_BUS))
14 #define BSE_IS_BUS_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_BUS))
15 #define BSE_BUS_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_BUS, BseBusClass))
16 
17 
18 /* --- BseBus source --- */
19 struct BseBus : BseSubSynth {
20  SfiRing *inputs;
21  double left_volume;
22  double right_volume;
23  guint muted : 1;
24  guint synced : 1;
25  guint saved_sync : 1;
26  guint solo_muted : 1;
27  BseSource *summation;
28  BseSource *vin;
29  BseSource *bmodule; /* implicitely vout */
30  guint n_effects; /* # of slots */
31  BseSource **effects; /* slot maybe NULL */
32  SfiRing *bus_outputs; /* maintained by bsebus.[hc] */
33 };
35 {};
36 
37 /* --- API --- */
38 Bse::Error bse_bus_connect (BseBus *self,
39  BseItem *item);
40 Bse::Error bse_bus_connect_unchecked (BseBus *self,
41  BseItem *item);
42 Bse::Error bse_bus_disconnect (BseBus *self,
43  BseItem *item);
44 SfiRing* bse_bus_list_inputs (BseBus *self);
45 SfiRing* bse_bus_list_outputs (BseBus *self);
46 gboolean bse_bus_get_stack (BseBus *self,
47  BseContainer **snet,
48  BseSource **vin,
49  BseSource **vout);
50 Bse::Error bse_bus_insert_slot (BseBus *self,
51  guint slot);
52 Bse::Error bse_bus_delete_slot (BseBus *self,
53  guint slot);
54 Bse::Error bse_bus_replace_effect (BseBus *self,
55  guint slot,
56  const gchar *etype);
57 void bse_bus_change_solo (BseBus *self,
58  gboolean solo_muted);
59 #define bse_bus_create_stack(b) bse_bus_get_stack (b,0,0,0)
60 void bse_bus_or_track_list_output_candidates (BseItem *trackbus,
61  BseIt3mSeq *iseq);
62 void bse_bus_or_track_set_outputs (BseItem *trackbus,
63  BseIt3mSeq *iseq);
64 
65 /* --- channels --- */
66 enum
67 {
68  BSE_BUS_ICHANNEL_LEFT,
69  BSE_BUS_ICHANNEL_RIGHT,
70  BSE_BUS_N_ICHANNELS
71 };
72 enum
73 {
74  BSE_BUS_OCHANNEL_LEFT,
75  BSE_BUS_OCHANNEL_RIGHT,
76  BSE_BUS_N_OCHANNELS
77 };
78 
79 G_END_DECLS
80 
81 namespace Bse {
82 
83 class BusImpl : public SubSynthImpl, public virtual BusIface {
84 protected:
85  virtual ~BusImpl ();
86 public:
87  explicit BusImpl (BseObject*);
88  virtual Error ensure_output () override;
89  virtual Error connect_bus (BusIface &bus) override;
90  virtual Error connect_track (TrackIface &track) override;
91  virtual Error disconnect_bus (BusIface &bus) override;
92  virtual Error disconnect_track (TrackIface &track) override;
93 };
94 
95 } // Bse
96 
97 #endif /* __BSE_BUS_H__ */
See also the corresponding IDL class Bus.
Definition: bseserverapi.hh:1230
Definition: bsecontainer.hh:26
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:88
Definition: bsebus.hh:34
See also the corresponding IDL class Track.
Definition: bseserverapi.hh:1114
virtual Error connect_track(TrackIface &track) override
See Bus::connect_track()
Definition: bsebus.cc:983
Definition: bsebus.hh:19
virtual Error disconnect_track(TrackIface &track) override
See Bus::disconnect_track()
Definition: bsebus.cc:1022
Definition: bsesubsynth.hh:21
Definition: bseobject.hh:61
Definition: bsesubsynth.hh:33
Definition: bsebus.hh:83
Definition: bsesource.hh:84
Definition: sfiring.hh:23
virtual Error ensure_output() override
See Bus::ensure_output()
Definition: bsebus.cc:943
Definition: bseitem.hh:34
Definition: bsesubsynth.hh:14
virtual Error connect_bus(BusIface &bus) override
See Bus::connect_bus()
Definition: bsebus.cc:962
virtual Error disconnect_bus(BusIface &bus) override
See Bus::disconnect_bus()
Definition: bsebus.cc:1004