diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2006-01-27 22:50:00 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2006-01-27 22:50:00 +0000 |
commit | 63b691c5179de0649cab2a7981dcf7ac01ec3cc0 (patch) | |
tree | 5ad87ada3ff7f1bfbe7c812674bd04ebaac92748 /pd/pd.cs | |
parent | bde79af1b578321dfc73475e4fdf38a950a5a50c (diff) |
new interface to internal functions
svn path=/trunk/externals/clr/; revision=4506
Diffstat (limited to 'pd/pd.cs')
-rwxr-xr-x | pd/pd.cs | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/pd/pd.cs b/pd/pd.cs deleted file mode 100755 index 1ec0903..0000000 --- a/pd/pd.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System;
-using System.Runtime.CompilerServices; // for extern import
-
-
-
-namespace PureData
-{
- public enum ParametersType {None = 0, Float=1, Symbol=2, List=3, Bang=4};
-
- public class pd
- {
- public delegate void DelegateWithoutArguments();
- public delegate void DelegateFloat(float f);
- public delegate void DelegateString(ref string s);
- public delegate void DelegateArray(Atom [] atoms);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void RegisterSelector (IntPtr x, string sel, string met, int type);
- // function called by the user
- public static void AddSelector(IntPtr x, string sel, DelegateWithoutArguments func)
- {
- RegisterSelector (x, sel, func.Method.Name, (int) ParametersType.None);
- }
- public static void AddSelector(IntPtr x, string sel, DelegateFloat func)
- {
- RegisterSelector (x, sel, func.Method.Name, (int) ParametersType.Float);
- }
- public static void AddSelector(IntPtr x, string sel, DelegateString func)
- {
- RegisterSelector (x, sel, func.Method.Name, (int) ParametersType.Symbol);
- }
- public static void AddSelector(IntPtr x, string sel, DelegateArray func)
- {
- RegisterSelector (x, sel, func.Method.Name, (int) ParametersType.List);
- }
- public static void AddSelector(IntPtr x, DelegateWithoutArguments func)
- {
- RegisterSelector (x, "", func.Method.Name, (int) ParametersType.None);
- }
- public static void AddSelector(IntPtr x, DelegateFloat func)
- {
- RegisterSelector (x, "", func.Method.Name, (int) ParametersType.Float);
- }
- public static void AddSelector(IntPtr x, DelegateString func)
- {
- RegisterSelector (x, "", func.Method.Name, (int) ParametersType.Symbol);
- }
- public static void AddSelector(IntPtr x, DelegateArray func)
- {
- RegisterSelector (x, "", func.Method.Name, (int) ParametersType.List);
- }
-
- // send stuff to an outlet
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void ToOutlet (IntPtr x, int outlet, int atoms_length, Atom [] atoms);
- public static void SendToOutlet (IntPtr x, int outlet, Atom [] atoms)
- {
- ToOutlet (x, outlet, atoms.Length, atoms);
- }
- public static void SendToOutlet (IntPtr x, int outlet, Atom atom)
- {
- Atom [] atoms = new Atom[1];
- atoms[0] = atom;
- ToOutlet (x, outlet, atoms.Length, atoms);
- }
- public static void SendToOutlet (IntPtr x, int outlet, float f)
- {
- Atom [] atoms = new Atom[1];
- atoms[0] = new Atom(f);
- ToOutlet (x, outlet, atoms.Length, atoms);
- }
- public static void SendToOutlet (IntPtr x, int outlet, int i)
- {
- Atom [] atoms = new Atom[1];
- atoms[0] = new Atom((float) i);
- ToOutlet (x, outlet, atoms.Length, atoms);
- }
- public static void SendToOutlet (IntPtr x, int outlet, string s)
- {
- Atom [] atoms = new Atom[1];
- atoms[0] = new Atom(s);
- ToOutlet (x, outlet, atoms.Length, atoms);
- }
-
- // create an outlet
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void CreateOutlet (IntPtr x, int type);
- // function called by the user
- public static void AddOutlet(IntPtr x, ParametersType type)
- {
- CreateOutlet (x, (int) type);
- }
-
- // create an inlet
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static void CreateInlet (IntPtr x, string selector, int type);
- // function called by the user
- public static void AddInlet(IntPtr x, string selector, ParametersType type)
- {
- CreateInlet (x, selector, (int) type);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void PostMessage (string message);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void ErrorMessage (string message);
-
- }
-
-
-
-
-}
|