[beast] BSE: compile bsemidicontroller as C++ source



commit f2c60634f4938e8b1c09e0cc18e15a1601a86781
Author: Stefan Westerfeld <stefan space twc de>
Date:   Fri Aug 5 16:37:45 2011 +0200

    BSE: compile bsemidicontroller as C++ source

 bse/Makefile.am                                   |    2 +-
 bse/{bsemidicontroller.c => bsemidicontroller.cc} |   55 +++++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)
---
diff --git a/bse/Makefile.am b/bse/Makefile.am
index e148535..31bee8c 100644
--- a/bse/Makefile.am
+++ b/bse/Makefile.am
@@ -73,7 +73,7 @@ bse_sources = $(strip \
 	bsedatapocket.cc	bseeditablesample.cc	bseenums.cc			bsegconfig.cc \
 	bseglobals.cc		bseglue.cc		bseitem.cc			bsejanitor.cc \
 	bsemain.cc		bsemath.cc		bsemathsignal.cc		bseladspa.cc \
-	bsemidicontroller.c	bsemididevice.c 	bsedevice.cc 			\
+	bsemidicontroller.cc	bsemididevice.c 	bsedevice.cc 			\
 	bsemididevice-null.c	bsemididevice-oss.c	bsemidievent.c			bsemidinotifier.c \
 	bsemidireceiver.cc	bsemidisynth.c		bseobject.c			bsepart.c \
 	bsepcminput.c		bsepcmoutput.c		bseparam.c			bseparasite.c \
diff --git a/bse/bsemidicontroller.c b/bse/bsemidicontroller.cc
similarity index 88%
rename from bse/bsemidicontroller.c
rename to bse/bsemidicontroller.cc
index ee4e84b..4dd4f1c 100644
--- a/bse/bsemidicontroller.c
+++ b/bse/bsemidicontroller.cc
@@ -20,6 +20,7 @@
 #include "bsemidireceiver.h"
 #include "bsesnet.h"
 #include "bseengine.h"
+#include "bsecxxplugin.hh"
 
 
 
@@ -37,26 +38,26 @@ enum
 
 /* --- prototypes --- */
 static void bse_midi_controller_init            (BseMidiController      *self);
-static void bse_midi_controller_class_init      (BseMidiControllerClass *class);
+static void bse_midi_controller_class_init      (BseMidiControllerClass *klass);
 static void bse_midi_controller_set_property    (GObject                *object,
-                                                 guint                   param_id,
+                                                 uint                    param_id,
                                                  const GValue           *value,
                                                  GParamSpec             *pspec);
 static void bse_midi_controller_get_property    (GObject                *object,
-                                                 guint                   param_id,
+                                                 uint                    param_id,
                                                  GValue                 *value,
                                                  GParamSpec             *pspec);
 static void bse_midi_controller_context_create  (BseSource              *source,
-                                                 guint                   instance_id,
+                                                 uint                    instance_id,
                                                  BseTrans               *trans);
 static void bse_midi_controller_context_connect (BseSource              *source,
-                                                 guint                   instance_id,
+                                                 uint                    instance_id,
                                                  BseTrans               *trans);
 static void bse_midi_controller_update_modules  (BseMidiController      *self);
 
 
 /* --- variables --- */
-static gpointer		 parent_class = NULL;
+static void *parent_class = NULL;
 
 
 /* --- functions --- */
@@ -87,14 +88,14 @@ BSE_BUILTIN_TYPE (BseMidiController)
 }
 
 static void
-bse_midi_controller_class_init (BseMidiControllerClass *class)
+bse_midi_controller_class_init (BseMidiControllerClass *klass)
 {
-  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-  BseObjectClass *object_class = BSE_OBJECT_CLASS (class);
-  BseSourceClass *source_class = BSE_SOURCE_CLASS (class);
-  guint ochannel_id;
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
+  BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
+  uint ochannel_id;
   
-  parent_class = g_type_class_peek_parent (class);
+  parent_class = g_type_class_peek_parent (klass);
   
   gobject_class->set_property = bse_midi_controller_set_property;
   gobject_class->get_property = bse_midi_controller_get_property;
@@ -155,7 +156,7 @@ bse_midi_controller_init (BseMidiController *self)
 
 static void
 bse_midi_controller_set_property (GObject      *object,
-                                  guint         param_id,
+                                  uint          param_id,
                                   const GValue *value,
                                   GParamSpec   *pspec)
 {
@@ -168,19 +169,19 @@ bse_midi_controller_set_property (GObject      *object,
       bse_midi_controller_update_modules (self);
       break;
     case PROP_CONTROL_1:
-      self->controls[0] = g_value_get_enum (value);
+      self->controls[0] = BseMidiSignalType (g_value_get_enum (value));
       bse_midi_controller_update_modules (self);
       break;
     case PROP_CONTROL_2:
-      self->controls[1] = g_value_get_enum (value);
+      self->controls[1] = BseMidiSignalType (g_value_get_enum (value));
       bse_midi_controller_update_modules (self);
       break;
     case PROP_CONTROL_3:
-      self->controls[2] = g_value_get_enum (value);
+      self->controls[2] = BseMidiSignalType (g_value_get_enum (value));
       bse_midi_controller_update_modules (self);
       break;
     case PROP_CONTROL_4:
-      self->controls[3] = g_value_get_enum (value);
+      self->controls[3] = BseMidiSignalType (g_value_get_enum (value));
       bse_midi_controller_update_modules (self);
       break;
     default:
@@ -191,7 +192,7 @@ bse_midi_controller_set_property (GObject      *object,
 
 static void
 bse_midi_controller_get_property (GObject    *object,
-                                  guint       param_id,
+                                  uint        param_id,
                                   GValue     *value,
                                   GParamSpec *pspec)
 {
@@ -222,15 +223,15 @@ bse_midi_controller_get_property (GObject    *object,
 
 typedef struct {
   BseMidiReceiver *midi_receiver;
-  guint            midi_channel;
-  guint            default_channel;
+  uint             midi_channel;
+  uint             default_channel;
   BseModule       *control_module;
 } ModuleData;
 
 static void
-module_data_free (gpointer data)
+module_data_free (void *data)
 {
-  ModuleData *mdata = data;
+  ModuleData *mdata = (ModuleData*) data;
   BseTrans *trans = bse_trans_open ();
   
   bse_midi_receiver_discard_control_module (mdata->midi_receiver, mdata->control_module, trans);
@@ -240,7 +241,7 @@ module_data_free (gpointer data)
 
 static void
 bse_midi_controller_context_create (BseSource *source,
-                                    guint      context_handle,
+                                    uint       context_handle,
                                     BseTrans  *trans)
 {
   BseMidiController *self = BSE_MIDI_CONTROLLER (source);
@@ -270,11 +271,11 @@ bse_midi_controller_context_create (BseSource *source,
 
 static void
 bse_midi_controller_context_connect (BseSource *source,
-                                     guint      context_handle,
+                                     uint       context_handle,
                                      BseTrans  *trans)
 {
   BseModule *module = bse_source_get_context_omodule (source, context_handle);
-  ModuleData *mdata = module->user_data;
+  ModuleData *mdata = (ModuleData*) module->user_data;
   
   /* connect module to midi control uplink */
   bse_trans_add (trans, bse_job_connect (mdata->control_module, 0, module, 0));
@@ -293,7 +294,7 @@ bse_midi_controller_update_modules (BseMidiController *self)
     {
       BseSource *source = BSE_SOURCE (self);
       BseTrans *trans = bse_trans_open ();
-      guint *cids, n, i;
+      uint *cids, n, i;
       
       /* forall contexts */
       cids = bse_source_context_ids (source, &n);
@@ -302,7 +303,7 @@ bse_midi_controller_update_modules (BseMidiController *self)
       for (i = 0; i < n; i++)
 	{
 	  BseModule *module = bse_source_get_context_omodule (source, cids[i]);
-	  ModuleData *mdata = module->user_data;
+	  ModuleData *mdata = (ModuleData*) module->user_data;
 	  
 	  /* disconnect from old module */
 	  bse_trans_add (trans, bse_job_disconnect (module, 0));



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