[beast: 23/49] BSE: bseapi.idl: introduce Part



commit ccfab1ddc8f279116ef29b288a50a15698953ccc
Author: Tim Janik <timj gnu org>
Date:   Tue Jun 23 02:16:45 2015 +0200

    BSE: bseapi.idl: introduce Part

 bse/bseapi.idl   |    4 ++++
 bse/bseobject.cc |    3 +++
 bse/bsepart.cc   |   14 ++++++++++++++
 bse/bsepart.hh   |   12 ++++++++++++
 4 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/bse/bseapi.idl b/bse/bseapi.idl
index 3837f41..223f06e 100644
--- a/bse/bseapi.idl
+++ b/bse/bseapi.idl
@@ -119,6 +119,10 @@ interface Item : Object {
   Item common_ancestor (Item other);    ///< Find a common container (parent or grand-parent) of two items 
if any.
 };
 
+/// Data object containing piano notes and effects.
+interface Part : Item {
+};
+
 /// Base type for synthesis objects with input or output streams.
 interface Source : Item {
   Source ichannel_get_osource (int32 input_channel, int32 input_joint); ///< Retrieve output module 
connected to a specific joint of an input channel.
diff --git a/bse/bseobject.cc b/bse/bseobject.cc
index ab14625..32232ca 100644
--- a/bse/bseobject.cc
+++ b/bse/bseobject.cc
@@ -918,6 +918,7 @@ bse_object_new (GType object_type, const gchar *first_property_name, ...)
 #include "bseserver.hh"
 #include "bseproject.hh"
 #include "bsesnet.hh"
+#include "bsepart.hh"
 
 GObject*
 bse_object_new_valist (GType object_type, const gchar *first_property_name, va_list var_args)
@@ -941,6 +942,8 @@ bse_object_new_valist (GType object_type, const gchar *first_property_name, va_l
     cxxo = new Bse::SuperImpl (object);
   else if (g_type_is_a (object_type, BSE_TYPE_CONTAINER))
     cxxo = new Bse::ContainerImpl (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_SOURCE))
     cxxo = new Bse::SourceImpl (object);
   else if (g_type_is_a (object_type, BSE_TYPE_ITEM))
diff --git a/bse/bsepart.cc b/bse/bsepart.cc
index ecfb09f..d69d4f0 100644
--- a/bse/bsepart.cc
+++ b/bse/bsepart.cc
@@ -2107,3 +2107,17 @@ bse_part_note_channel_destroy (BsePartNoteChannel *self)
   g_bsearch_array_free (self->bsa, &note_channel_bsc);
   self->bsa = NULL;
 }
+
+namespace Bse {
+
+PartImpl::PartImpl (BseObject *bobj) :
+  ItemImpl (bobj)
+{}
+
+PartImpl::~PartImpl ()
+{}
+
+// BsePart *self = as<BsePart*>();
+// shared_ptr_cast<PartIface> (opart->as<PartIface*>());
+
+} // Bse
diff --git a/bse/bsepart.hh b/bse/bsepart.hh
index dce9e5b..e79f48e 100644
--- a/bse/bsepart.hh
+++ b/bse/bsepart.hh
@@ -267,4 +267,16 @@ void              bse_part_note_channel_destroy       (BsePartNoteChannel *self)
 
 G_END_DECLS
 
+namespace Bse {
+
+class PartImpl : public ItemImpl, public virtual PartIface {
+protected:
+  virtual             ~PartImpl           ();
+public:
+  explicit             PartImpl           (BseObject*);
+};
+
+} // Bse
+
+
 #endif /* __BSE_PART_H__ */


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