diff options
author | Davide Morelli <morellid@users.sourceforge.net> | 2006-01-13 13:02:22 +0000 |
---|---|---|
committer | Davide Morelli <morellid@users.sourceforge.net> | 2006-01-13 13:02:22 +0000 |
commit | 7a0d21c028c073e0ff3c64ab0bd7958e79816d45 (patch) | |
tree | fca1568989f3b71e8d0a3f4bf77e85e6fbce6808 /external | |
parent | 7aa2fe31bf8baa6506e4c792229834b67ebd2207 (diff) |
single atom ok, no luck with arrays
svn path=/trunk/externals/clr/; revision=4399
Diffstat (limited to 'external')
-rwxr-xr-x | external/External.cs | 16 | ||||
-rwxr-xr-x | external/pd.cs | 26 |
2 files changed, 29 insertions, 13 deletions
diff --git a/external/External.cs b/external/External.cs index f09487d..215461c 100755 --- a/external/External.cs +++ b/external/External.cs @@ -41,7 +41,6 @@ namespace PureData -
public void Sel1()
{
pd.PostMessage("Sel1 invoked!");
@@ -92,11 +91,14 @@ namespace PureData public void SelGenericList(Atom a)
{
- Console.WriteLine("a is type " + a.type);
- Console.WriteLine("float = " + a.float_value);
- Console.WriteLine("stringa = " + a.string_value);
+
+ Console.WriteLine("a is type " + a.type);
+ Console.WriteLine("float = " + a.float_value);
+ Console.WriteLine("stringa = " + a.string_value);
+
}
+
/*
public void SelGenericList(Atom [] list)
{
@@ -110,11 +112,9 @@ namespace PureData pd.PostMessage("a is type " + a.type);
pd.PostMessage("float = " + a.float_value);
pd.PostMessage("stringa = " + a.string_value);
-
- }
-
+ }
}
-*/
+*/
public int test(int a)
{
diff --git a/external/pd.cs b/external/pd.cs index 33f7f1f..4f05734 100755 --- a/external/pd.cs +++ b/external/pd.cs @@ -68,17 +68,18 @@ typedef struct atom_simple };
*/
- public enum AtomType {Null = 0, Float=1, Symbol=2};
+ public enum AtomType {Null = 0, Float=1, Symbol=2, List=3};
+
[StructLayout (LayoutKind.Explicit)]
// [StructLayout (LayoutKind.Sequential)]
- public class Atom
+ public class Atom2
{
//[FieldOffset (0)] AtomType type;
//[FieldOffset (0)] public int type;
[FieldOffset (0)]
public int type;
- /* union members */
+
[FieldOffset (4)]
public float float_value;
@@ -87,22 +88,37 @@ typedef struct atom_simple public string string_value;
+ public Atom2()
+ {
+ this.type = 0;
+ this.float_value = 0;
+ this.string_value = "";
+ }
- public Atom(string string_value)
+ public Atom2(string string_value)
{
this.type = 2;
this.float_value = 0;
this.string_value = string_value;
}
- public Atom(float float_value)
+ public Atom2(float float_value)
{
this.type = 1;
this.string_value = "";
this.float_value = float_value;
}
}
+
+ //[StructLayout (LayoutKind.Explicit)]
+ [StructLayout (LayoutKind.Sequential)]
+ public struct Atom
+ {
+ public int type;
+ public float float_value;
+ public string string_value;
+ }
/* typedef float t_floatarg; |