Update of /cvsroot/pure-data/externals/clr/external In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17879/external
Modified Files: External.cs pd.cs Log Message: lists of atoms still not working
Index: External.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/external/External.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** External.cs 12 Jan 2006 09:24:23 -0000 1.1 --- External.cs 12 Jan 2006 11:59:58 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- pd.AddSelector(x, "selStringList", "SelStringList", ParametersType.List); pd.AddSelector(x, "selFloatList", "SelFloatList", ParametersType.List); + pd.AddSelector(x, "selGenericList", "SelGenericList", ParametersType.List); Console.WriteLine("selectors set"); pd.AddOutlet(x, ParametersType.Float); *************** *** 80,89 **** }
! public void SelFloatList(int [] list) { pd.PostMessage("SetStringList received a " + list.Length + " long list"); for (int i = 0; i<list.Length; i++) { ! pd.PostMessage("float " + i + " = " + list[0]); } } --- 81,101 ---- }
! public void SelFloatList(float [] list) { pd.PostMessage("SetStringList received a " + list.Length + " long list"); for (int i = 0; i<list.Length; i++) { ! pd.PostMessage("float " + i + " = " + list[i]); ! } ! } ! ! public void SelGenericList(Atom [] list) ! { ! pd.PostMessage("SetStringList received a " + list.Length + " long list"); ! for (int i = 0; i<list.Length; i++) ! { ! Atom a = (Atom) list[i]; ! pd.PostMessage("list[" + i + "] is type " + a.type + " stringa = " + a.string_value); ! // pd.PostMessage("float " + i + " = " + list[i]); } }
Index: pd.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/external/pd.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pd.cs 12 Jan 2006 09:24:23 -0000 1.1 --- pd.cs 12 Jan 2006 11:59:58 -0000 1.2 *************** *** 1,4 **** using System; ! using System.Runtime.CompilerServices;
namespace PureData --- 1,6 ---- using System; ! using System.Runtime.CompilerServices; // for extern import ! using System.Runtime.InteropServices; // for structures !
namespace PureData *************** *** 47,49 **** --- 49,161 ----
} + + /* + // 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; + union{ + float float_value; + MonoString *string_value; + } stuff; + }; + */ + + public enum AtomType {Null = 0, Float=1, Symbol=2}; + + [StructLayout (LayoutKind.Explicit)] + public struct Atom + { + //[FieldOffset (0)] AtomType type; + [FieldOffset (0)] public int type; + /* union members */ + [FieldOffset (4)] public long string_value; + [FieldOffset (4)] public float float_value; + } + + + + /* + typedef float t_floatarg; + + typedef struct _symbol + { + char *s_name; + struct _class **s_thing; + struct _symbol *s_next; + } t_symbol; + + EXTERN_STRUCT _array; + #define t_array struct _array + + + + #define GP_NONE 0 + #define GP_GLIST 1 + #define GP_ARRAY 2 + + typedef struct _gstub + { + union + { + struct _glist *gs_glist; + struct _array *gs_array; + } gs_un; + int gs_which; + int gs_refcount; + } t_gstub; + + typedef struct _gpointer + { + union + { + struct _scalar *gp_scalar; + union word *gp_w; + } gp_un; + int gp_valid; + t_gstub *gp_stub; + } t_gpointer; + + typedef union word + { + t_float w_float; + t_symbol *w_symbol; + t_gpointer *w_gpointer; + t_array *w_array; + struct _glist *w_list; + int w_index; + } t_word; + + typedef enum + { + A_NULL, + A_FLOAT, + A_SYMBOL, + A_POINTER, + A_SEMI, + A_COMMA, + A_DEFFLOAT, + A_DEFSYM, + A_DOLLAR, + A_DOLLSYM, + A_GIMME, + A_CANT + } t_atomtype; + + #define A_DEFSYMBOL A_DEFSYM + + typedef struct _atom + { + t_atomtype a_type; + union word a_w; + } t_atom; + */ + }