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