diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-08 01:59:24 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-08 01:59:24 +0000 |
commit | 91a94f0946561a6343f6169b63e538776dca867b (patch) | |
tree | 3690a5b0269ce80b8900c88cc004a3b1a4ddaa72 /Counter | |
parent | 88ae96ff82ddc836a822a55aef17ea66ca06ac65 (diff) |
finally implemented efficient method registering
other cleanups and improvements
svn path=/trunk/externals/clr/; revision=4657
Diffstat (limited to 'Counter')
-rwxr-xr-x | Counter/Counter.cs | 18 |
1 files changed, 17 insertions, 1 deletions
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)); |