Update of /cvsroot/pure-data/externals/clr/external In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26055/external
Modified Files: External.cs pd.cs Log Message: working on lists of atoms
Index: External.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/external/External.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** External.cs 12 Jan 2006 11:59:58 -0000 1.2 --- External.cs 12 Jan 2006 17:09:45 -0000 1.3 *************** *** 90,93 **** --- 90,102 ---- }
+ + public void SelGenericList(Atom a) + { + Console.WriteLine("a is type " + a.type); + Console.WriteLine("float = " + a.float_value); + Console.WriteLine("stringa = " + a.string_value); + } + + /* public void SelGenericList(Atom [] list) { *************** *** 96,103 **** { Atom a = (Atom) list[i]; ! pd.PostMessage("list[" + i + "] is type " + a.type + " stringa = " + a.string_value); ! // pd.PostMessage("float " + i + " = " + list[i]); } }
public int test(int a) --- 105,119 ---- { Atom a = (Atom) list[i]; ! Console.WriteLine("a is type " + a.type); ! Console.WriteLine("float = " + a.float_value); ! Console.WriteLine("stringa = " + a.string_value); ! pd.PostMessage("a is type " + a.type); ! pd.PostMessage("float = " + a.float_value); ! pd.PostMessage("stringa = " + a.string_value); ! } + } + */
public int test(int a)
Index: pd.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/external/pd.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pd.cs 12 Jan 2006 11:59:58 -0000 1.2 --- pd.cs 12 Jan 2006 17:09:45 -0000 1.3 *************** *** 72,82 ****
[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; }
--- 72,104 ----
[StructLayout (LayoutKind.Explicit)] ! // [StructLayout (LayoutKind.Sequential)] ! public class Atom { //[FieldOffset (0)] AtomType type; ! //[FieldOffset (0)] public int type; ! [FieldOffset (0)] ! public int type; /* union members */ ! [FieldOffset (4)] ! public float float_value; ! ! // [FieldOffset (4)] ! [FieldOffset (8)] ! public string string_value; ! ! ! ! public Atom(string string_value) ! { ! this.type = 2; ! this.float_value = 0; ! this.string_value = string_value; ! } ! public Atom(float float_value) ! { ! this.type = 1; ! this.string_value = ""; ! this.float_value = float_value; ! } }