aboutsummaryrefslogtreecommitdiff
path: root/external/Counter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'external/Counter.cs')
-rwxr-xr-xexternal/Counter.cs112
1 files changed, 67 insertions, 45 deletions
diff --git a/external/Counter.cs b/external/Counter.cs
index 7dc8289..32f9409 100755
--- a/external/Counter.cs
+++ b/external/Counter.cs
@@ -1,52 +1,74 @@
using System;
-namespace PureData
+/// <summary>
+/// Descrizione di riepilogo per Counter.
+/// </summary>
+public class Counter:
+ PureData.External
{
- /// <summary>
- /// Descrizione di riepilogo per Counter.
- /// </summary>
- public class Counter
+ public Counter()
{
- private IntPtr x;
-
- int curr = 0;
-
- public Counter()
- {
- curr = 0;
- }
-
- public Counter(float f)
- {
- curr = (int) f;
- }
-
- // this function MUST exist
- public void SetUp()
- {
- pd.AddSelector(x, "init", new pd.DelegateFloat(Init));
- pd.AddSelector(x, new pd.DelegateWithoutArguments(SendOut));
- pd.AddSelector(x, new pd.DelegateFloat(Sum));
- pd.AddInlet(x, "init", ParametersType.Float);
- pd.AddOutlet(x, ParametersType.Float);
-
- }
-
- public void Init(float f)
- {
- curr = (int) f;
- }
-
- public void SendOut()
- {
- pd.SendToOutlet(x, 0, new Atom(curr));
- }
-
- public void Sum(float f)
- {
- curr += (int) f;
- pd.SendToOutlet(x, 0, new Atom(curr));
- }
+ Post("Count");
+// EventFloat += new MethodFloat(MyFloat);
+ }
+
+ public Counter(PureData.Atom[] args)
+ {
+ Post("Count with args");
+
+// pd.AddInlet(x, "init", ParametersType.Float);
+// pd.AddOutlet(x, ParametersType.Float);
+ }
+
+ // this function MUST exist
+ public static void Main()
+ {
+ Post("Count.Main");
}
+
+/*
+ public void MyBang()
+ {
+ Post("Count-BANG");
+ }
+
+ public void MyFloat(float f)
+ {
+ Post(String.Format("Count-FLOAT {0}",f));
+ }
+*/
+ protected override void MethodBang()
+ {
+ Post("Count-BANG");
+ }
+
+ protected override void MethodFloat(float f)
+ {
+ Post("Count-FLOAT "+f.ToString());
+ }
+
+ protected override void MethodSymbol(PureData.Symbol s)
+ {
+ Post("Count-SYMBOL "+s.ToString());
+ }
+
+ /*
+ public void Init(float f)
+ {
+ curr = (int) f;
+ }
+
+ public void SendOut()
+ {
+ pd.SendToOutlet(x, 0, new Atom(curr));
+ }
+
+ public void Sum(float f)
+ {
+ curr += (int) f;
+ pd.SendToOutlet(x, 0, new Atom(curr));
+ }
+
+*/
}