BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 00002 /*-------- begin ../sfi/sfidl generated code --------*/ 00003 00004 00005 00006 #include <bse/bsecxxplugin.hh> 00007 00008 00009 /* enum prototypes */ 00010 00011 00012 /* choice prototypes */ 00013 00014 00015 /* record prototypes */ 00016 00017 00018 /* sequence prototypes */ 00019 00020 00021 /* class prototypes */ 00022 namespace Bse { 00023 class BusModuleBase; 00024 class BusModule; 00025 #define BSE_TYPE_BUS_MODULE BSE_CXX_DECLARED_CLASS_TYPE (Bse, BusModule) 00026 #define BSE_IS_BUS_MODULE(o) (::Bse::CxxBase::instance_is_a (o, BSE_TYPE_BUS_MODULE)) 00027 00028 00029 /* enum definitions */ 00030 00031 00032 /* sequence definitions */ 00033 00034 00035 /* record definitions */ 00036 00037 00038 /* enum declarations */ 00039 00040 00041 /* sequence type declarations */ 00042 00043 00044 /* record type declarations */ 00045 00046 00047 /* procedure prototypes */ 00048 00049 00050 /* class definitions */ 00051 BSE_CXX_DECLARE_CLASS (BusModule); 00052 class BusModuleBase : public ::Bse::Effect { 00053 public: 00054 static inline const unsigned char* pixstream () { return NULL; } 00055 static void class_init (::Bse::CxxBaseClass *klass); 00056 static inline const char* options () { return ""; } 00057 static inline const char* category () { static const char *c = NULL; 00058 return c ? c : c = sfi_category_concat ("/Modules", ""); } 00059 static inline const char* i18n_category () { static const char *c = NULL; 00060 return c ? c : c = sfi_category_concat ("/Modules", ""); } 00061 static inline const char* blurb () { return _("Synthesis module used internally by BseBus"); } 00062 static inline const char* authors () { return "Tim Janik"; } 00063 static inline const char* license () { return _("GNU Lesser General Public License"); } 00064 static inline const char* type_name () { return "BseBusModule"; } 00065 public: 00066 enum { 00067 ICHANNEL_AUDIO_IN1, 00068 ICHANNEL_AUDIO_IN2, 00069 N_ICHANNELS 00070 }; 00071 public: 00072 enum { 00073 OCHANNEL_AUDIO_OUT1, 00074 OCHANNEL_AUDIO_OUT2, 00075 N_OCHANNELS 00076 }; 00077 protected: 00078 enum BusModulePropertyID { 00079 PROP_VOLUME1 = 1, 00080 PROP_VOLUME2, 00081 }; 00082 public: 00083 /* "transport" structure to configure synthesis modules from properties */ 00084 struct BusModuleProperties { 00085 typedef BusModulePropertyID IDType; 00086 Sfi::Real volume1; 00087 Sfi::Real volume2; 00088 explicit BusModuleProperties (BusModuleBase *p) : 00089 volume1 (p->volume1), 00090 volume2 (p->volume2) 00091 { 00092 } 00093 }; 00094 protected: 00095 typedef void AutoUpdateCategory; 00096 protected: 00097 Sfi::Real volume1; 00098 Sfi::Real volume2; 00099 public: 00100 void get_property (BusModulePropertyID prop_id, ::Bse::Value &value, GParamSpec *pspec) 00101 { 00102 switch (prop_id) { 00103 case PROP_VOLUME1: 00104 sfi_value_set_real (&value, volume1); 00105 break; 00106 case PROP_VOLUME2: 00107 sfi_value_set_real (&value, volume2); 00108 break; 00109 }; 00110 } 00111 void set_property (BusModulePropertyID prop_id, const ::Bse::Value &value, GParamSpec *pspec) 00112 { 00113 switch (prop_id) { 00114 case PROP_VOLUME1: 00115 volume1 = sfi_value_get_real (&value); 00116 break; 00117 case PROP_VOLUME2: 00118 volume2 = sfi_value_get_real (&value); 00119 break; 00120 }; 00121 property_changed (BusModulePropertyID (prop_id)); 00122 update_modules(); 00123 switch (prop_id) { 00124 default: ; 00125 }; 00126 } 00127 virtual bool editable_property (BusModulePropertyID prop_id, GParamSpec *pspec) 00128 { 00129 return true; 00130 } 00131 virtual void get_candidates (BusModulePropertyID prop_id, ::Bse::PropertyCandidatesHandle &pch, GParamSpec *pspec) 00132 { 00133 } 00134 void property_updated (BusModulePropertyID prop_id, guint64 tick_stamp, double prop_value, GParamSpec *pspec) 00135 { 00136 bool seen_change = false; 00137 switch (prop_id) { 00138 default: ; 00139 }; 00140 if (seen_change && 00141 property_changed (BusModulePropertyID (prop_id))) 00142 update_modules(); 00143 } 00144 private: 00145 static struct StaticData { 00146 int dummy; 00147 } static_data; 00148 protected: 00149 virtual bool property_changed (BusModulePropertyID) { return false; } 00150 virtual ~BusModuleBase () 00151 { 00152 } 00153 public: 00154 }; 00155 00156 00157 /* choice implementations */ 00158 00159 00160 /* record implementations */ 00161 00162 00163 /* sequence implementations */ 00164 00165 00166 /* class implementations */ 00167 void 00168 BusModuleBase::class_init (::Bse::CxxBaseClass *klass) 00169 { 00170 klass->set_accessors (::Bse::cxx_get_property_trampoline<BusModuleBase, BusModulePropertyID>, 00171 ::Bse::cxx_set_property_trampoline<BusModuleBase, BusModulePropertyID>, 00172 ::Bse::cxx_editable_property_trampoline<BusModuleBase, BusModulePropertyID>, 00173 ::Bse::cxx_get_candidates_trampoline<BusModuleBase, BusModulePropertyID>, 00174 NULL); 00175 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:")); 00176 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:")); 00177 klass->add_ichannel ("audio_in1", _("Audio In1"), _("First audio input"), ICHANNEL_AUDIO_IN1); 00178 klass->add_ichannel ("audio_in2", _("Audio In2"), _("Second audio input"), ICHANNEL_AUDIO_IN2); 00179 klass->add_ochannel ("audio_out1", _("Audio Out1"), _("First audio output"), OCHANNEL_AUDIO_OUT1); 00180 klass->add_ochannel ("audio_out2", _("Audio Out2"), _("Second audio output"), OCHANNEL_AUDIO_OUT2); 00181 } 00182 00183 00184 /* procedure implementations */ 00185 00186 00187 /* bsebusmodule.idl type registrations */ 00188 #define BSE_CXX_REGISTER_ALL_TYPES_FROM_BSEBUSMODULE_IDL() \ 00189 BSE_CXX_REGISTER_EFFECT (BusModule); \ 00190 /* bsebusmodule.idl type registrations done */ 00191 } // Bse 00192 00193 /*-------- end ../sfi/sfidl generated code --------*/ 00194 00195