From 91a94f0946561a6343f6169b63e538776dca867b Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 8 Mar 2006 01:59:24 +0000 Subject: finally implemented efficient method registering other cleanups and improvements svn path=/trunk/externals/clr/; revision=4657 --- Counter/Counter.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'Counter') diff --git a/Counter/Counter.cs b/Counter/Counter.cs index bf1a9d1..9cb4801 100755 --- a/Counter/Counter.cs +++ b/Counter/Counter.cs @@ -6,10 +6,15 @@ using System; public class Counter: PureData.External { + PureData.Atom[] args; + public Counter(PureData.AtomList args) { Post("Count.ctor "+args.ToString()); + // that's the way to store args (don't just copy an AtomList instance!!) + this.args = (PureData.Atom[])args; + // pd.AddInlet(x, "init", ParametersType.Float); // pd.AddOutlet(x, ParametersType.Float); } @@ -21,6 +26,8 @@ public class Counter: Add(new MethodFloat(obj.MyFloat)); Add(new MethodSymbol(obj.MySymbol)); Add(new MethodList(obj.MyList)); + Add("set",new MethodList(obj.MySet)); + Add(new MethodAnything(obj.MyAnything)); Post("Count.Main"); } @@ -45,7 +52,16 @@ public class Counter: Post("Count-LIST "+l.ToString()); } -/* + protected virtual void MySet(PureData.AtomList l) + { + Post("Count-SET "+l.ToString()); + } + + protected virtual void MyAnything(PureData.Symbol s,PureData.AtomList l) + { + Post("Count-("+s.ToString()+") "+l.ToString()); + } + /* public void SendOut() { pd.SendToOutlet(x, 0, new Atom(curr)); -- cgit v1.2.1