[beast/devel: 12/26] PLUGINS: compile BseMult as C++ resident type
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 12/26] PLUGINS: compile BseMult as C++ resident type
- Date: Tue, 18 Dec 2012 02:44:59 +0000 (UTC)
commit 809b95b118181657238ec0c76a2eb09fb20ea0ca
Author: Tim Janik <timj gnu org>
Date: Tue Dec 18 02:05:49 2012 +0100
PLUGINS: compile BseMult as C++ resident type
plugins/Makefile.am | 5 ++---
plugins/Makefile.plugins | 15 ---------------
plugins/{bsemult.c => bsemult.cc} | 26 ++++++++++----------------
plugins/bsemult.h | 5 +----
po/POTSCAN | 2 +-
5 files changed, 14 insertions(+), 39 deletions(-)
---
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index b1355cc..43d8377 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -35,8 +35,8 @@ SFIDL_INC = --nostdinc -I$(top_srcdir) -I$(top_builddir)
$(SFIDL) --plugin --macro $(<F) $(SFIDL_INC) -I$(top_builddir) $< > $@ || (rm $@ ; exit 1 )
# == C++ Plugins ==
-cxx_plugin_headers = bseadder.h bseatandistort.h bsesimpleadsr.h bsemixer.h
-cxx_plugin_sources = bseadder.cc bseatandistort.cc bsesimpleadsr.cc bsemixer.cc
+cxx_plugin_headers = bseadder.h bseatandistort.h bsesimpleadsr.h bsemixer.h bsemult.h
+cxx_plugin_sources = bseadder.cc bseatandistort.cc bsesimpleadsr.cc bsemixer.cc bsemult.cc
cxx_plugin_extra = bsesimpleadsr-aux.cc
EXTRA_DIST += $(cxx_plugin_headers) $(cxx_plugin_extra)
cxxplugins_FPU_la_SOURCES = $(cxx_plugin_sources)
@@ -57,7 +57,6 @@ UNPORTED = $(strip \
)
cglob_plugins = $(strip \
bseiirfilter.[hc] \
- bsemult.[hc] \
bsesequencer.[hc] \
davxtalstrings.[hc] \
davsyndrum.[hc] \
diff --git a/plugins/Makefile.plugins b/plugins/Makefile.plugins
index 49aca8b..3fc2f09 100644
--- a/plugins/Makefile.plugins
+++ b/plugins/Makefile.plugins
@@ -128,21 +128,6 @@ bseiirfilter_SSE_la_LIBADD = $(bseiirfilter_FPU_la_LIBADD)
bseiirfilter_SSE_la_CFLAGS = $(SSE_PLUGIN_CFLAGS)
-## C Plugin bsemult
-EXTRA_HEADERS += bsemult.h
-$(srcdir)/bsemult.c: bsemult.h
-plugin_FPU_ltlibs += bsemult.FPU.la
-bsemult_FPU_la_SOURCES = bsemult.c
-bsemult_FPU_la_LDFLAGS = -module $(plugins_ldflags)
-bsemult_FPU_la_LIBADD = $(plugins_libs)
-bsemult_FPU_la_CFLAGS = $(FPU_PLUGIN_CFLAGS)
-plugin_SSE_ltlibs += bsemult.SSE.la
-bsemult_SSE_la_SOURCES = $(bsemult_FPU_la_SOURCES)
-bsemult_SSE_la_LDFLAGS = $(bsemult_FPU_la_LDFLAGS)
-bsemult_SSE_la_LIBADD = $(bsemult_FPU_la_LIBADD)
-bsemult_SSE_la_CFLAGS = $(SSE_PLUGIN_CFLAGS)
-
-
## C Plugin bsesequencer
EXTRA_HEADERS += bsesequencer.h
$(srcdir)/bsesequencer.c: bsesequencer.h
diff --git a/plugins/bsemult.c b/plugins/bsemult.cc
similarity index 88%
rename from plugins/bsemult.c
rename to plugins/bsemult.cc
index 5e51fb0..7b9848c 100644
--- a/plugins/bsemult.c
+++ b/plugins/bsemult.cc
@@ -17,25 +17,22 @@
#include "bsemult.h"
#include <bse/bseengine.h>
+#include <bse/bsecxxplugin.hh>
#include <string.h>
/* --- prototypes --- */
static void bse_mult_init (BseMult *mult);
-static void bse_mult_class_init (BseMultClass *class);
+static void bse_mult_class_init (BseMultClass *klass);
static void bse_mult_context_create (BseSource *source,
guint context_handle,
BseTrans *trans);
-
-/* --- Export to BSE --- */
+// == Type Registration ==
#include "./icons/multiply.c"
-BSE_REGISTER_OBJECT (BseMult, BseSource, "/Modules/Routing/Multiply", "",
- "Mult is a channel multiplier for ring-modulating incoming signals",
- multiply_icon,
- bse_mult_class_init, NULL, bse_mult_init);
-BSE_DEFINE_EXPORTS ();
-
+BSE_RESIDENT_TYPE_DEF (BseMult, bse_mult, N_("Routing/Multiply"),
+ "Mult is a channel multiplier for ring-modulating incoming signals",
+ multiply_icon);
/* --- variables --- */
static gpointer parent_class = NULL;
@@ -43,18 +40,15 @@ static gpointer parent_class = NULL;
/* --- functions --- */
static void
-bse_mult_class_init (BseMultClass *class)
+bse_mult_class_init (BseMultClass *klass)
{
- BseObjectClass *object_class;
BseSourceClass *source_class;
guint ichannel, ochannel;
-
+
parent_class = g_type_class_peek (BSE_TYPE_SOURCE);
- object_class = BSE_OBJECT_CLASS (class);
- source_class = BSE_SOURCE_CLASS (class);
-
+ source_class = BSE_SOURCE_CLASS (klass);
source_class->context_create = bse_mult_context_create;
-
+
ichannel = bse_source_class_add_ichannel (source_class, "audio-in1", _("Audio In1"), _("Audio Input 1"));
g_assert (ichannel == BSE_MULT_ICHANNEL_MONO1);
ichannel = bse_source_class_add_ichannel (source_class, "audio-in2", _("Audio In2"), _("Audio Input 2"));
diff --git a/plugins/bsemult.h b/plugins/bsemult.h
index 46f9a45..70e4220 100644
--- a/plugins/bsemult.h
+++ b/plugins/bsemult.h
@@ -27,11 +27,8 @@ extern "C" {
#endif /* __cplusplus */
-
-
-
/* --- object type macros --- */
-#define BSE_TYPE_MULT (BSE_EXPORT_TYPE_ID (BseMult))
+#define BSE_TYPE_MULT (bse_mult_get_type())
#define BSE_MULT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_MULT, BseMult))
#define BSE_MULT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_MULT, BseMultClass))
#define BSE_IS_MULT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_MULT))
diff --git a/po/POTSCAN b/po/POTSCAN
index 440fe4f..cd8ab18 100644
--- a/po/POTSCAN
+++ b/po/POTSCAN
@@ -123,7 +123,7 @@ plugins/bsecontribsampleandhold.idl
# plugins/bsefirfilter.c
plugins/bseiirfilter.c
plugins/bsemixer.cc
-plugins/bsemult.c
+plugins/bsemult.cc
plugins/bsenoise.idl
plugins/bsequantizer.idl
plugins/bsesequencer.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]