Update of /cvsroot/pure-data/externals/clr/PureData In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16855/clr/PureData
Modified Files: PureData.cs Log Message: implemented proxy objects and other stuff cleaned up the code
Index: PureData.cs =================================================================== RCS file: /cvsroot/pure-data/externals/clr/PureData/PureData.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PureData.cs 8 Mar 2006 17:37:25 -0000 1.4 --- PureData.cs 9 Mar 2006 01:48:21 -0000 1.5 *************** *** 14,41 **** 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); --- 14,47 ---- 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 [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static void AddInlet(void *obj,ref float f);
// map to data member [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static void AddInlet(void *obj,ref Symbol s);
// map to data member // [MethodImplAttribute (MethodImplOptions.InternalCall)] // internal extern static void AddInlet(void *obj,ref Pointer f);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! internal extern static void AddInlet(void *obj,Symbol type); // create proxy inlet (typed) ! ! [MethodImplAttribute (MethodImplOptions.InternalCall)] ! internal extern static void AddInlet(void *obj); // create proxy inlet (anything) ! ! // --------------------------------------------------------------------------
[MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static void AddOutlet(void *obj,Symbol type);
+ // -------------------------------------------------------------------------- + [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static void Outlet(void *obj,int n); *************** *** 59,62 **** --- 65,70 ---- 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); *************** *** 77,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");
// -------------------------------------------------------------------------- --- 85,95 ---- // --------------------------------------------------------------------------
! protected readonly static Symbol _ = new Symbol(""); ! protected readonly static Symbol _bang = new Symbol("bang"); ! protected readonly static Symbol _float = new Symbol("float"); ! protected readonly static Symbol _symbol = new Symbol("symbol"); ! protected readonly static Symbol _pointer = new Symbol("pointer"); ! protected readonly static Symbol _list = new Symbol("list"); ! protected readonly static Symbol _anything = new Symbol("anything");
// -------------------------------------------------------------------------- *************** *** 90,101 **** protected extern static void Post(string message);
[MethodImplAttribute (MethodImplOptions.InternalCall)] protected extern static void PostError(string message);
! [MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void PostBug(string message);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void PostVerbose(string message);
// -------------------------------------------------------------------------- --- 98,121 ---- protected extern static void Post(string message);
+ protected static void Post(string format,object arg0) { Post(String.Format(format,arg0)); } + protected static void Post(string format,object arg0,object arg1) { Post(String.Format(format,arg0,arg1)); } + protected static void Post(string format,object arg0,object arg1,object arg2) { Post(String.Format(format,arg0,arg1,arg2)); } + protected static void Post(string format,params object[] args) { Post(String.Format(format,args)); } + [MethodImplAttribute (MethodImplOptions.InternalCall)] protected extern static void PostError(string message);
! protected static void PostError(string format,object arg0) { PostError(String.Format(format,arg0)); } ! protected static void PostError(string format,object arg0,object arg1) { PostError(String.Format(format,arg0,arg1)); } ! protected static void PostError(string format,object arg0,object arg1,object arg2) { PostError(String.Format(format,arg0,arg1,arg2)); } ! protected static void PostError(string format,params object[] args) { PostError(String.Format(format,args)); }
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void PostVerbose(int lvl,string message); ! ! protected static void PostVerbose(int lvl,string format,object arg0) { PostVerbose(lvl,String.Format(format,arg0)); } ! protected static void PostVerbose(int lvl,string format,object arg0,object arg1) { PostVerbose(lvl,String.Format(format,arg0,arg1)); } ! protected static void PostVerbose(int lvl,string format,object arg0,object arg1,object arg2) { PostVerbose(lvl,String.Format(format,arg0,arg1,arg2)); } ! protected static void PostVerbose(int lvl,string format,params object[] args) { PostVerbose(lvl,String.Format(format,args)); }
// -------------------------------------------------------------------------- *************** *** 106,141 **** protected delegate void MethodPointer(Pointer p); protected delegate void MethodList(AtomList lst); ! protected delegate void MethodAnything(Symbol tag,AtomList lst);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(MethodBang m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(MethodFloat m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(MethodSymbol m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(MethodPointer m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(MethodList m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void Add(Symbol sel,MethodList m);
! protected static void Add(string sel,MethodList m) { Add(new Symbol(sel),m); }
[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
// -------------------------------------------------------------------------- --- 126,164 ---- protected delegate void MethodPointer(Pointer p); protected delegate void MethodList(AtomList lst); ! protected delegate void MethodAnything(int inlet,Symbol tag,AtomList lst); ! ! // --------------------------------------------------------------------------
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodBang m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodFloat m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodSymbol m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodPointer m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodList m);
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,Symbol sel,MethodAnything m);
! protected static void AddMethod(int inlet,string sel,MethodAnything m) { AddMethod(inlet,new Symbol(sel),m); }
[MethodImplAttribute (MethodImplOptions.InternalCall)] ! protected extern static void AddMethod(int inlet,MethodAnything m);
// --------------------------------------------------------------------------
! protected void AddInlet(ref float f) { Internal.AddInlet(ptr,ref f); } // map to data member ! protected void AddInlet(ref Symbol s) { Internal.AddInlet(ptr,ref s); } // map to data member // protected void AddInlet(ref Pointer p) { Internal.AddInlet(ptr,ref p); } // map to data member ! // protected void AddInlet(Symbol type) { Internal.AddInlet(ptr,type); } // create typed inlet ! protected void AddInlet() { Internal.AddInlet(ptr); } // create inlet responding to any message ! protected void AddInlet(Symbol sel,Symbol to_sel) { Internal.AddInlet(ptr,sel,to_sel); } // redirect messages to defined selector
// -------------------------------------------------------------------------- *************** *** 143,152 **** 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); }
// -------------------------------------------------------------------------- --- 166,175 ---- protected void AddOutlet(Symbol type) { Internal.AddOutlet(ptr,type); }
! protected void AddOutletBang() { AddOutlet(_bang); } ! protected void AddOutletFloat() { AddOutlet(_float); } ! protected void AddOutletSymbol() { AddOutlet(_symbol); } ! protected void AddOutletPointer() { AddOutlet(_pointer); } ! protected void AddOutletList() { AddOutlet(_list); } ! protected void AddOutletAnything() { AddOutlet(_anything); }
// -------------------------------------------------------------------------- *************** *** 157,162 **** 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); } --- 180,185 ---- 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,_list,l); } ! protected void Outlet(int n,Atom[] l) { Internal.Outlet(ptr,n,_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); } *************** *** 172,181 **** 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)] --- 195,204 ---- protected extern static void Send(Symbol sym,Atom a);
! protected static void Send(Symbol sym) { Send(sym,_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,_list,l); } ! protected static void Send(Symbol sym,Atom[] l) { Send(sym,_list,l); }
[MethodImplAttribute (MethodImplOptions.InternalCall)]