Update of /cvsroot/pure-data/externals/clr/PureData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24368/clr/PureData
Modified Files: PureData.cs Log Message: added inlet and outlet functions added send functions practically ready to work with!
Index: PureData.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/PureData/PureData.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PureData.cs 8 Mar 2006 01:59:24 -0000 1.2 --- PureData.cs 8 Mar 2006 16:48:28 -0000 1.3 *************** *** 13,16 **** --- 13,67 ---- [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static string SymEval(void *sym); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void AddInlet(void *obj,Symbol sel,Symbol to_sel); + + // map to data member + // \NOTE don't know if this is really safe since f must stay at its place (but it should, no?) + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void AddInlet(void *obj,ref float f); + + // map to data member + // \NOTE don't know if this is really safe since s must stay at its place (but it should, no?) + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void AddInlet(void *obj,ref Symbol s); + + // map to data member + // \NOTE don't know if this is really safe since s must stay at its place (but it should, no?) + // [MethodImplAttribute (MethodImplOptions.InternalCall)] + // internal extern static void AddInlet(void *obj,ref Pointer f); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void AddInlet(void *obj); // create proxy inlet + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void AddOutlet(void *obj,Symbol type); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,float f); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,Symbol s); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,Pointer p); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,Atom a); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,Symbol s,AtomList l); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Outlet(void *obj,int n,Symbol s,Atom[] l); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Bind(void *obj,Symbol dst); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void Unbind(void *obj,Symbol dst); }
*************** *** 23,26 **** --- 74,87 ---- // --------------------------------------------------------------------------
+ protected readonly static Symbol s__ = new Symbol(""); + protected readonly static Symbol s_bang = new Symbol("bang"); + protected readonly static Symbol s_float = new Symbol("float"); + protected readonly static Symbol s_symbol = new Symbol("symbol"); + protected readonly static Symbol s_pointer = new Symbol("pointer"); + protected readonly static Symbol s_list = new Symbol("list"); + protected readonly static Symbol s_anything = new Symbol("anything"); + + // -------------------------------------------------------------------------- + [MethodImplAttribute (MethodImplOptions.InternalCall)] protected extern static void Post(string message); *************** *** 66,69 **** --- 127,184 ---- [MethodImplAttribute (MethodImplOptions.InternalCall)] protected extern static void Add(MethodAnything m); + + // -------------------------------------------------------------------------- + + protected void AddInlet(Symbol sel,Symbol to_sel) { Internal.AddInlet(ptr,sel,to_sel); } + protected void AddInlet(ref float f) { Internal.AddInlet(ptr,ref f); } + protected void AddInlet(ref Symbol s) { Internal.AddInlet(ptr,ref s); } + // protected void AddInlet(ref Pointer p) { Internal.AddInlet(ptr,ref p); } // map to data member + protected void AddInlet() { Internal.AddInlet(ptr); } // create proxy inlet + + // -------------------------------------------------------------------------- + + protected void AddOutlet(Symbol type) { Internal.AddOutlet(ptr,type); } + + protected void AddOutletBang() { AddOutlet(s_bang); } + protected void AddOutletFloat() { AddOutlet(s_float); } + protected void AddOutletSymbol() { AddOutlet(s_symbol); } + protected void AddOutletPointer() { AddOutlet(s_pointer); } + protected void AddOutletList() { AddOutlet(s_list); } + protected void AddOutletAnything() { AddOutlet(s_anything); } + + // -------------------------------------------------------------------------- + + protected void Outlet(int n) { Internal.Outlet(ptr,n); } + protected void Outlet(int n,float f) { Internal.Outlet(ptr,n,f); } + protected void Outlet(int n,Symbol s) { Internal.Outlet(ptr,n,s); } + protected void Outlet(int n,Pointer p) { Internal.Outlet(ptr,n,p); } + protected void Outlet(int n,Atom a) { Internal.Outlet(ptr,n,a); } + protected void Outlet(int n,AtomList l) { Internal.Outlet(ptr,n,s_list,l); } + protected void Outlet(int n,Atom[] l) { Internal.Outlet(ptr,n,s_list,l); } + protected void Outlet(int n,Symbol s,AtomList l) { Internal.Outlet(ptr,n,s,l); } + protected void Outlet(int n,Symbol s,Atom[] l) { Internal.Outlet(ptr,n,s,l); } + + // -------------------------------------------------------------------------- + + // bind to symbol + protected void Bind(Symbol sym) { Internal.Bind(ptr,sym); } + protected void Unbind(Symbol sym) { Internal.Unbind(ptr,sym); } + + // send to receiver symbol + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Send(Symbol sym,Atom a); + + protected static void Send(Symbol sym) { Send(sym,s_bang,null); } + protected static void Send(Symbol sym,float f) { Send(sym,new Atom(f)); } + protected static void Send(Symbol sym,Symbol s) { Send(sym,new Atom(s)); } + protected static void Send(Symbol sym,Pointer p) { Send(sym,new Atom(p)); } + protected static void Send(Symbol sym,AtomList l) { Send(sym,s_list,l); } + protected static void Send(Symbol sym,Atom[] l) { Send(sym,s_list,l); } + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Send(Symbol sym,Symbol s,AtomList l); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Send(Symbol sym,Symbol s,Atom[] l); } }