BEAST/BSE - Better Audio System and Sound Engine  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bsebusmodule.genidl.hh
Go to the documentation of this file.
1 
2 /*-------- begin ../sfi/sfidl generated code --------*/
3 
4 
5 
6 #include <bse/bse-internals.hh>
7 
8 
9 /* enum prototypes */
10 
11 
12 /* choice prototypes */
13 
14 
15 /* record prototypes */
16 
17 
18 /* sequence prototypes */
19 
20 
21 /* class prototypes */
22 namespace Bse {
23 class BusModuleBase;
24 class BusModule;
25 #define BSE_TYPE_BUS_MODULE BSE_CXX_DECLARED_CLASS_TYPE (Bse, BusModule)
26 #define BSE_IS_BUS_MODULE(o) (::Bse::CxxBase::instance_is_a (o, BSE_TYPE_BUS_MODULE))
27 
28 
29 /* enum definitions */
30 
31 
32 /* sequence definitions */
33 
34 
35 /* record definitions */
36 
37 
38 /* enum declarations */
39 
40 
41 /* sequence type declarations */
42 
43 
44 /* record type declarations */
45 
46 
47 /* procedure prototypes */
48 
49 
50 /* class definitions */
51 BSE_CXX_DECLARE_CLASS (BusModule);
52 class BusModuleBase : public ::Bse::Effect {
53 public:
54  static inline const unsigned char* pixstream () { return NULL; }
55  static void class_init (::Bse::CxxBaseClass *klass);
56  static inline const char* options () { return ""; }
57  static inline const char* category () { static const char *c = NULL;
58  return c ? c : c = sfi_category_concat ("/Modules", ""); }
59  static inline const char* i18n_category () { static const char *c = NULL;
60  return c ? c : c = sfi_category_concat ("/Modules", ""); }
61  static inline const char* blurb () { return _("Synthesis module used internally by BseBus"); }
62  static inline const char* authors () { return "Tim Janik"; }
63  static inline const char* license () { return _("GNU Lesser General Public License"); }
64  static inline const char* type_name () { return "BseBusModule"; }
65 public:
66  enum {
67  ICHANNEL_AUDIO_IN1,
68  ICHANNEL_AUDIO_IN2,
69  N_ICHANNELS
70  };
71 public:
72  enum {
73  OCHANNEL_AUDIO_OUT1,
74  OCHANNEL_AUDIO_OUT2,
75  N_OCHANNELS
76  };
77 protected:
78  enum BusModulePropertyID {
79  PROP_VOLUME1 = 1,
80  PROP_VOLUME2,
81  };
82 public:
83  /* "transport" structure to configure synthesis modules from properties */
85  typedef BusModulePropertyID IDType;
86  Sfi::Real volume1;
87  Sfi::Real volume2;
88  explicit BusModuleProperties (BusModuleBase *p) :
89  volume1 (p->volume1),
90  volume2 (p->volume2)
91  {
92  }
93  };
94 protected:
95  typedef void AutoUpdateCategory;
96 protected:
97  Sfi::Real volume1;
98  Sfi::Real volume2;
99 public:
100  void get_property (BusModulePropertyID prop_id, ::Bse::Value &value, GParamSpec *pspec)
101  {
102  switch (prop_id) {
103  case PROP_VOLUME1:
104  sfi_value_set_real (&value, volume1);
105  break;
106  case PROP_VOLUME2:
107  sfi_value_set_real (&value, volume2);
108  break;
109  };
110  }
111  void set_property (BusModulePropertyID prop_id, const ::Bse::Value &value, GParamSpec *pspec)
112  {
113  switch (prop_id) {
114  case PROP_VOLUME1:
115  volume1 = sfi_value_get_real (&value);
116  break;
117  case PROP_VOLUME2:
118  volume2 = sfi_value_get_real (&value);
119  break;
120  };
121  property_changed (BusModulePropertyID (prop_id));
122  update_modules();
123  switch (prop_id) {
124  default: ;
125  };
126  }
127  virtual bool editable_property (BusModulePropertyID prop_id, GParamSpec *pspec)
128  {
129  return true;
130  }
131  virtual void get_candidates (BusModulePropertyID prop_id, ::Bse::PropertyCandidatesHandle &pch, GParamSpec *pspec)
132  {
133  }
134  void property_updated (BusModulePropertyID prop_id, guint64 tick_stamp, double prop_value, GParamSpec *pspec)
135  {
136  bool seen_change = false;
137  switch (prop_id) {
138  default: ;
139  };
140  if (seen_change &&
141  property_changed (BusModulePropertyID (prop_id)))
142  update_modules();
143  }
144 private:
145  static struct StaticData {
146  int dummy;
147  } static_data;
148 protected:
149  virtual bool property_changed (BusModulePropertyID) { return false; }
150  virtual ~BusModuleBase ()
151  {
152  }
153 public:
154 };
155 
156 
157 /* choice implementations */
158 
159 
160 /* record implementations */
161 
162 
163 /* sequence implementations */
164 
165 
166 /* class implementations */
167 void
168 BusModuleBase::class_init (::Bse::CxxBaseClass *klass)
169 {
170  klass->set_accessors (::Bse::cxx_get_property_trampoline<BusModuleBase, BusModulePropertyID>,
171  ::Bse::cxx_set_property_trampoline<BusModuleBase, BusModulePropertyID>,
172  ::Bse::cxx_editable_property_trampoline<BusModuleBase, BusModulePropertyID>,
173  ::Bse::cxx_get_candidates_trampoline<BusModuleBase, BusModulePropertyID>,
174  NULL);
175  klass->add_param (PROP_VOLUME1, sfidl_pspec_SfiReal (_("Volume"),"/opt/src/beast/bse/bsebusmodule.idl",730,"volume1","" , "" , 1LL , 0LL , 1000LL , 10LL , ":r:w:S:G:"));
176  klass->add_param (PROP_VOLUME2, sfidl_pspec_SfiReal (_("Volume"),"/opt/src/beast/bse/bsebusmodule.idl",731,"volume2","" , "" , 1LL , 0LL , 1000LL , 10LL , ":r:w:S:G:"));
177  klass->add_ichannel ("audio_in1", _("Audio In1"), _("First audio input"), ICHANNEL_AUDIO_IN1);
178  klass->add_ichannel ("audio_in2", _("Audio In2"), _("Second audio input"), ICHANNEL_AUDIO_IN2);
179  klass->add_ochannel ("audio_out1", _("Audio Out1"), _("First audio output"), OCHANNEL_AUDIO_OUT1);
180  klass->add_ochannel ("audio_out2", _("Audio Out2"), _("Second audio output"), OCHANNEL_AUDIO_OUT2);
181 }
182 
183 
184 /* procedure implementations */
185 
186 
187 /* bsebusmodule.idl type registrations */
188 #define BSE_CXX_REGISTER_ALL_TYPES_FROM_BSEBUSMODULE_IDL() \
189  BSE_CXX_REGISTER_EFFECT (BusModule); \
190  /* bsebusmodule.idl type registrations done */
191 } // Bse
192 
193 /*-------- end ../sfi/sfidl generated code --------*/
194 
195 
Definition: bsebusmodule.genidl.hh:52
Definition: bsecxxvalue.hh:13
Definition: bsebusmodule.genidl.hh:84
Definition: sficxx.hh:168
Definition: bsecxxmodule.hh:92
Definition: bsecxxbase.hh:14