Update of /cvsroot/pure-data/externals/clr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879
Modified Files: clr.c makefile test-clr.pd Log Message: lists of atoms still not working
Index: test-clr.pd =================================================================== RCS file: /cvsroot/pure-data/externals/clr/test-clr.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test-clr.pd 12 Jan 2006 09:22:35 -0000 1.1 --- test-clr.pd 12 Jan 2006 11:59:58 -0000 1.2 *************** *** 1,3 **** ! #N canvas 0 0 726 474 12; #X obj 97 383 clr; #X obj 105 80 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --- 1,3 ---- ! #N canvas 0 0 734 482 12; #X obj 97 383 clr; #X obj 105 80 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 *************** *** 19,24 **** #X obj 71 429 print a; #X msg 239 297 selStringList abba baab caac dede; - #X msg 248 360 selFloatList 1 2 3 4; #X msg 240 319 selStringList ego filose; #X connect 0 0 14 0; #X connect 1 0 0 0; --- 19,26 ---- #X obj 71 429 print a; #X msg 239 297 selStringList abba baab caac dede; #X msg 240 319 selStringList ego filose; + #X msg 239 342 selFloatList 1.1 2.2 3.3 4.4; + #X msg 239 364 selFloatList 0.001 1000; + #X msg 239 387 selGenericList 0.001 abaco 1000; #X connect 0 0 14 0; #X connect 1 0 0 0; *************** *** 37,38 **** --- 39,42 ---- #X connect 16 0 0 0; #X connect 17 0 0 0; + #X connect 18 0 0 0; + #X connect 19 0 0 0;
Index: makefile =================================================================== RCS file: /cvsroot/pure-data/externals/clr/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** makefile 12 Jan 2006 09:22:35 -0000 1.1 --- makefile 12 Jan 2006 11:59:58 -0000 1.2 *************** *** 21,26 **** LINUXINCLUDE = -I../../src -I$PDPATH
! MONOSRC = -ID:/Davide/cygwin/tmp/build_deps/include -ID:/Davide/cygwin/tmp/build_deps/include/glib-2.0 -ID:/Davide/cygwin/tmp/build_deps/lib/glib-2.0/include -ID:/Davide/cygwin/home/Davide/mono/include ! MONOLIB = -LD:/Davide/cygwin/tmp/build_deps/lib -LD:/Davide/cygwin/home/Davide/mono/lib -lmono -lm -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv
.c.dll: --- 21,26 ---- LINUXINCLUDE = -I../../src -I$PDPATH
! MONOSRC = -IC:/cygwin/tmp/build_deps/include -IC:/cygwin/tmp/build_deps/include/glib-2.0 -IC:/cygwin/tmp/build_deps/lib/glib-2.0/include -IC:/cygwin/home/Davide/mono/include ! MONOLIB = -LC:/cygwin/tmp/build_deps/lib -LC:/cygwin/home/Davide/mono/lib -lmono -lm -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv
.c.dll:
Index: clr.c =================================================================== RCS file: /cvsroot/pure-data/externals/clr/clr.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** clr.c 12 Jan 2006 09:22:35 -0000 1.1 --- clr.c 12 Jan 2006 11:59:58 -0000 1.2 *************** *** 39,45 **** { t_outlet *outlet_pointer; ! // selectorList *next; // next element of the list };
static t_class *clr_class;
--- 39,64 ---- { t_outlet *outlet_pointer; ! // outletList *next; // next element of the list };
+ // simplyfied atom + typedef struct atom_simple atom_simple; + typedef enum + { + A_S_NULL=0, + A_S_FLOAT=1, + A_S_SYMBOL=2, + } t_atomtype_simple; + typedef struct atom_simple + { + //t_atomtype_simple a_type; + int a_type; + union{ + float float_value; + MonoString *string_value; + } stuff; + }; + + static t_class *clr_class;
*************** *** 56,59 **** --- 75,79 ---- int n;
+ // TODO: dynamic memory allocation selectorList selectors[MAX_SELECTORS]; outletList outlets[MAX_OUTLETS]; *************** *** 238,242 **** { // I've found the selector! - printf("selector %s, func %s\n", sl->s_name, x->selectors[i].sel); if (x->selectors[i].func) { --- 258,261 ---- *************** *** 272,299 **** MonoString *strmono; t_symbol *strsymbol; char *str; MonoArray * arystr; ! int j; ! printf("preparo l'array\n"); ! arystr = mono_array_new (x->domain, mono_get_string_class (), argc); for (j=0; j<argc; j++) { ! int * ftmp = malloc(sizeof(int)); ! *ftmp = j; ! strsymbol = atom_getsymbol(argv+j); ! MonoString *arg = mono_string_new (x->domain, strsymbol->s_name); ! mono_array_set (arystr, MonoString *, j, arg); // gpointer //mono_array_set (arystr, gint32 , j, ftmp);
- } args[0] = arystr; //args[0] = strings; - printf("mando a mono\n"); mono_runtime_invoke (x->selectors[i].func, x->obj, args, NULL); - printf("ho mandatao a mono\n"); break; } --- 291,338 ---- MonoString *strmono; t_symbol *strsymbol; + float ftmp; char *str; MonoArray * arystr; ! int j; arystr = mono_array_new (x->domain, mono_get_string_class (), argc); for (j=0; j<argc; j++) { ! atom_simple *atmp = malloc(sizeof(atom_simple)); ! switch ((argv+j)->a_type) ! { ! case A_FLOAT: ! post("setting type float in position %i", j); ! atmp->a_type = 1; ! ftmp = atom_getfloat(argv+j); ! atmp->stuff.float_value = ftmp; ! break; ! case A_SYMBOL: ! post("setting type symbol in position %i", j); ! atmp->a_type = 2; ! strsymbol = atom_getsymbol(argv+j); ! atmp->stuff.string_value = mono_string_new (x->domain, strsymbol->s_name); ! break; ! default: ! post("setting type null in position %i", j); ! atmp->a_type = 0; ! } ! ! mono_array_set (arystr, atom_simple *, j, atmp); ! //int * ftmp = malloc(sizeof(int)); ! //*ftmp = j; ! //float ftmp = atom_getfloat(argv+j); ! //strsymbol = atom_getsymbol(argv+j); ! //MonoString *arg = mono_string_new (x->domain, strsymbol->s_name); ! //mono_array_set (arystr, MonoString *, j, arg); // gpointer + + //mono_array_set (arystr, gint32 , j, *ftmp); //mono_array_set (arystr, gint32 , j, ftmp);
} args[0] = arystr; //args[0] = strings; mono_runtime_invoke (x->selectors[i].func, x->obj, args, NULL); break; }