1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
using System;
using System.Runtime.CompilerServices;
namespace PureData
{
public enum ParametersType {None = 0, Float=1, Symbol=2, List=3};
public class pd
{
[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, string met, ParametersType type)
{
RegisterSelector (x, sel, met, (int) type);
}
// TODO
// send stuff to an outlet
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static void ToOutlet (IntPtr x, int outlet, int type /*, ? array of values */);
// 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);
}
}
|