first examples: single object, multitple objects, multiobject-library
This commit is contained in:
parent
5c2b6d2910
commit
b8763a8e4b
15 changed files with 171 additions and 0 deletions
21
tests/multilib/Makefile
Normal file
21
tests/multilib/Makefile
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Makefile to build class 'multilib' for Pure Data.
|
||||||
|
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
|
||||||
|
# settings and rules.
|
||||||
|
|
||||||
|
# library name
|
||||||
|
lib.name = multilib
|
||||||
|
|
||||||
|
make-lib-executable=yes
|
||||||
|
|
||||||
|
# input source file (class name == source file basename)
|
||||||
|
class.sources = multilibA.c multilibB.c
|
||||||
|
|
||||||
|
# glue for building a multi-object library
|
||||||
|
lib.setup.sources = $(lib.name).c
|
||||||
|
|
||||||
|
# all extra files to be included in binary distribution of the library
|
||||||
|
datafiles = multilib-help.pd multilib-meta.pd
|
||||||
|
|
||||||
|
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
|
||||||
|
PDLIBBUILDER_DIR=../..
|
||||||
|
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
|
||||||
7
tests/multilib/multilib-help.pd
Normal file
7
tests/multilib/multilib-help.pd
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X obj 143 125 multilibA;
|
||||||
|
#X obj 223 125 multilibB;
|
||||||
|
#X msg 223 93 12;
|
||||||
|
#X connect 0 0 1 0;
|
||||||
|
#X connect 3 0 2 0;
|
||||||
9
tests/multilib/multilib-meta.pd
Normal file
9
tests/multilib/multilib-meta.pd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#N canvas 966 322 200 200 10;
|
||||||
|
#N canvas 19 51 420 300 META 0;
|
||||||
|
#X text 10 10 META this is a prototype of a libdir meta file;
|
||||||
|
#X text 10 51 AUTHOR IOhannes m zmolnig;
|
||||||
|
#X text 10 110 VERSION 1.0.0;
|
||||||
|
#X text 10 90 LICENSE CC0;
|
||||||
|
#X text 10 70 DESCRIPTION Example "multiple" external.;
|
||||||
|
#X text 10 30 NAME multiple;
|
||||||
|
#X restore 10 10 pd META;
|
||||||
8
tests/multilib/multilib.c
Normal file
8
tests/multilib/multilib.c
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
void multilibA_setup(void);
|
||||||
|
void multilibB_setup(void);
|
||||||
|
|
||||||
|
void multlib_setup(void) {
|
||||||
|
multilibA_setup();
|
||||||
|
multilibB_setup();
|
||||||
|
}
|
||||||
13
tests/multilib/multilibA.c
Normal file
13
tests/multilib/multilibA.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multilibA_class;
|
||||||
|
static void multilibA_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multilibA_new(void) {
|
||||||
|
return pd_new(multilibA_class);
|
||||||
|
}
|
||||||
|
void multilibA_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multilibA_class = class_new(gensym("multilibA"), multilibA_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multilibA_class, multilibA_float);
|
||||||
|
}
|
||||||
13
tests/multilib/multilibB.c
Normal file
13
tests/multilib/multilibB.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multilibB_class;
|
||||||
|
static void multilibB_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multilibB_new(void) {
|
||||||
|
return pd_new(multilibB_class);
|
||||||
|
}
|
||||||
|
void multilibB_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multilibB_class = class_new(gensym("multilibB"), multilibB_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multilibB_class, multilibB_float);
|
||||||
|
}
|
||||||
16
tests/multiple/Makefile
Normal file
16
tests/multiple/Makefile
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Makefile to build class 'multiple' for Pure Data.
|
||||||
|
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
|
||||||
|
# settings and rules.
|
||||||
|
|
||||||
|
# library name
|
||||||
|
lib.name = multiple
|
||||||
|
|
||||||
|
# input source file (class name == source file basename)
|
||||||
|
class.sources = multipleA.c multipleB.c
|
||||||
|
|
||||||
|
# all extra files to be included in binary distribution of the library
|
||||||
|
datafiles = multiple-help.pd multiple-meta.pd
|
||||||
|
|
||||||
|
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
|
||||||
|
PDLIBBUILDER_DIR=../..
|
||||||
|
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
|
||||||
7
tests/multiple/multiple-help.pd
Normal file
7
tests/multiple/multiple-help.pd
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X obj 143 125 multipleA;
|
||||||
|
#X obj 223 125 multipleB;
|
||||||
|
#X msg 223 93 12;
|
||||||
|
#X connect 0 0 1 0;
|
||||||
|
#X connect 3 0 2 0;
|
||||||
9
tests/multiple/multiple-meta.pd
Normal file
9
tests/multiple/multiple-meta.pd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#N canvas 966 322 200 200 10;
|
||||||
|
#N canvas 19 51 420 300 META 0;
|
||||||
|
#X text 10 10 META this is a prototype of a libdir meta file;
|
||||||
|
#X text 10 51 AUTHOR IOhannes m zmolnig;
|
||||||
|
#X text 10 110 VERSION 1.0.0;
|
||||||
|
#X text 10 90 LICENSE CC0;
|
||||||
|
#X text 10 70 DESCRIPTION Example "multiple" external.;
|
||||||
|
#X text 10 30 NAME multiple;
|
||||||
|
#X restore 10 10 pd META;
|
||||||
13
tests/multiple/multipleA.c
Normal file
13
tests/multiple/multipleA.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multipleA_class;
|
||||||
|
static void multipleA_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multipleA_new(void) {
|
||||||
|
return pd_new(multipleA_class);
|
||||||
|
}
|
||||||
|
void multipleA_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multipleA_class = class_new(gensym("multipleA"), multipleA_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multipleA_class, multipleA_float);
|
||||||
|
}
|
||||||
13
tests/multiple/multipleB.c
Normal file
13
tests/multiple/multipleB.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multipleB_class;
|
||||||
|
static void multipleB_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multipleB_new(void) {
|
||||||
|
return pd_new(multipleB_class);
|
||||||
|
}
|
||||||
|
void multipleB_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multipleB_class = class_new(gensym("multipleB"), multipleB_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multipleB_class, multipleB_float);
|
||||||
|
}
|
||||||
16
tests/single/Makefile
Normal file
16
tests/single/Makefile
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Makefile to build class 'single' for Pure Data.
|
||||||
|
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
|
||||||
|
# settings and rules.
|
||||||
|
|
||||||
|
# library name
|
||||||
|
lib.name = single
|
||||||
|
|
||||||
|
# input source file (class name == source file basename)
|
||||||
|
class.sources = single.c
|
||||||
|
|
||||||
|
# all extra files to be included in binary distribution of the library
|
||||||
|
datafiles = single-help.pd single-meta.pd
|
||||||
|
|
||||||
|
# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
|
||||||
|
PDLIBBUILDER_DIR=../..
|
||||||
|
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
|
||||||
4
tests/single/single-help.pd
Normal file
4
tests/single/single-help.pd
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X obj 143 125 test1;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X connect 1 0 0 0;
|
||||||
9
tests/single/single-meta.pd
Normal file
9
tests/single/single-meta.pd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#N canvas 966 322 200 200 10;
|
||||||
|
#N canvas 19 51 420 300 META 0;
|
||||||
|
#X text 10 10 META this is a prototype of a libdir meta file;
|
||||||
|
#X text 10 51 AUTHOR IOhannes m zmolnig;
|
||||||
|
#X text 10 110 VERSION 1.0.0;
|
||||||
|
#X text 10 90 LICENSE CC0;
|
||||||
|
#X text 10 70 DESCRIPTION Example "single" external.;
|
||||||
|
#X text 10 30 NAME single;
|
||||||
|
#X restore 10 10 pd META;
|
||||||
13
tests/single/single.c
Normal file
13
tests/single/single.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*single_class;
|
||||||
|
static void single_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*single_new(void) {
|
||||||
|
return pd_new(single_class);
|
||||||
|
}
|
||||||
|
void single_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
single_class = class_new(gensym("single"), single_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(single_class, single_float);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue