[beast: 9/26] BSE: bseapi.idl: introduce SubSynth



commit 5bf66b29a261c7c93f1ca24fe4db7d8e25329644
Author: Tim Janik <timj gnu org>
Date:   Wed Jul 1 12:56:07 2015 +0200

    BSE: bseapi.idl: introduce SubSynth

 bse/bseapi.idl     |   21 +++++++++++++++++++++
 bse/bseobject.cc   |    3 +++
 bse/bsesubsynth.cc |   20 ++++++++++++++++----
 bse/bsesubsynth.hh |   22 +++++++++++++++-------
 4 files changed, 55 insertions(+), 11 deletions(-)
---
diff --git a/bse/bseapi.idl b/bse/bseapi.idl
index 713d9c3..1b2f0b5 100644
--- a/bse/bseapi.idl
+++ b/bse/bseapi.idl
@@ -424,6 +424,27 @@ interface SNet : Super {
 interface CSynth : SNet {
 };
 
+/// Synthesizer module for embedding (rerouting input and output) of another synthesizer network (SNet).
+interface SubSynth : Source {
+  // CSynth snet       = Object ("Synthesizer",   "Synthesis network to use as embedded sub network", 
GUISTANDARD ":unprepared");
+  // String in_port_1  = String ("Input Port 1",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_1 = String ("Output Port 1", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_2  = String ("Input Port 2",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_2 = String ("Output Port 2", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_3  = String ("Input Port 3",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_3 = String ("Output Port 3", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_4  = String ("Input Port 4",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_4 = String ("Output Port 4", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_5  = String ("Input Port 5",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_5 = String ("Output Port 5", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_6  = String ("Input Port 6",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_6 = String ("Output Port 6", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_7  = String ("Input Port 7",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_7 = String ("Output Port 7", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+  // String in_port_8  = String ("Input Port 8",  "Output port name to interface from",               
GUISTANDARD ":skip-default");
+  // String out_port_8 = String ("Output Port 8", "Input port name to interface to",                  
GUISTANDARD ":skip-default");
+};
+
 /// Data object containing sequencing information and links to Part objects.
 interface Track : ContextMerger {
   int32 insert_part (int32 tick, Part part);    ///< Insert Part into Track at @a tick, returns the 
corresponding link id.
diff --git a/bse/bseobject.cc b/bse/bseobject.cc
index ea0008b..b48823f 100644
--- a/bse/bseobject.cc
+++ b/bse/bseobject.cc
@@ -921,6 +921,7 @@ bse_object_new (GType object_type, const gchar *first_property_name, ...)
 #include "bsecsynth.hh"
 #include "bsetrack.hh"
 #include "bsecontextmerger.hh"
+#include "bsesubsynth.hh"
 #include "bsesnet.hh"
 #include "bsepart.hh"
 
@@ -956,6 +957,8 @@ bse_object_new_valist (GType object_type, const gchar *first_property_name, va_l
     cxxo = new Bse::ContextMergerImpl (object);
   else if (g_type_is_a (object_type, BSE_TYPE_PART))
     cxxo = new Bse::PartImpl (object);
+  else if (g_type_is_a (object_type, BSE_TYPE_SUB_SYNTH))
+    cxxo = new Bse::SubSynthImpl (object);
   else if (g_type_is_a (object_type, BSE_TYPE_SOURCE))
     cxxo = new Bse::SourceImpl (object);
   else if (g_type_is_a (object_type, BSE_TYPE_ITEM))
diff --git a/bse/bsesubsynth.cc b/bse/bsesubsynth.cc
index 08fc385..eb690cb 100644
--- a/bse/bsesubsynth.cc
+++ b/bse/bsesubsynth.cc
@@ -290,8 +290,7 @@ bse_sub_synth_get_property (GObject    *object,
 }
 
 void
-bse_sub_synth_set_midi_channel (BseSubSynth     *self,
-                                guint            midi_channel)
+bse_sub_synth_set_midi_channel (BseSubSynth *self, uint midi_channel)
 {
   g_return_if_fail (BSE_IS_SUB_SYNTH (self));
 
@@ -299,8 +298,7 @@ bse_sub_synth_set_midi_channel (BseSubSynth     *self,
 }
 
 void
-bse_sub_synth_set_null_shortcut (BseSubSynth *self,
-                                 gboolean     enabled)
+bse_sub_synth_set_null_shortcut (BseSubSynth *self, bool enabled)
 {
   g_return_if_fail (BSE_IS_SUB_SYNTH (self));
 
@@ -536,3 +534,17 @@ bse_sub_synth_class_init (BseSubSynthClass *klass)
       g_free (label);
     }
 }
+
+namespace Bse {
+
+SubSynthImpl::SubSynthImpl (BseObject *bobj) :
+  SourceImpl (bobj)
+{}
+
+SubSynthImpl::~SubSynthImpl ()
+{}
+
+// BseSubSynth *self = as<BseSubSynth*>();
+// other->as<SubSynthIfaceP>();
+
+} // Bse
diff --git a/bse/bsesubsynth.hh b/bse/bsesubsynth.hh
index 3f85003..227c6bb 100644
--- a/bse/bsesubsynth.hh
+++ b/bse/bsesubsynth.hh
@@ -21,14 +21,22 @@ struct BseSubSynth : BseSource {
 struct BseSubSynthClass : BseSourceClass
 {};
 
-/* whether to shortcut inputs with outputs for snet==NULL */
-void    bse_sub_synth_set_null_shortcut  (BseSubSynth     *self,
-                                          gboolean         enabled);
-/* override midi_channel for snet, or if midi_channel==0 inherit from parent */
-void    bse_sub_synth_set_midi_channel   (BseSubSynth     *self,
-                                          guint            midi_channel);
-
+/// Set whether to pass inputs through to outputs if SNet is unset.
+void bse_sub_synth_set_null_shortcut (BseSubSynth *self, bool enabled);
+/// Override the @a midi_channel for the SNet (unset override with midi_channel=0).
+void bse_sub_synth_set_midi_channel  (BseSubSynth *self, uint midi_channel);
 
 G_END_DECLS
 
+namespace Bse {
+
+class SubSynthImpl : public SourceImpl, public virtual SubSynthIface {
+protected:
+  virtual  ~SubSynthImpl ();
+public:
+  explicit  SubSynthImpl (BseObject*);
+};
+
+} // Bse
+
 #endif /* __BSE_SUB_SYNTH_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]