From ae198fa7592e7bf801f3678b11a854c5a4e6d04d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 11 Sep 2012 14:31:04 +0200 Subject: moved value scaling functions from NanoEvent into "GenEvent" base class so it can be used for other controller events as well --- lib/NanoEvent.ck | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) (limited to 'lib/NanoEvent.ck') diff --git a/lib/NanoEvent.ck b/lib/NanoEvent.ck index 57a89e3..1ae9c59 100644 --- a/lib/NanoEvent.ck +++ b/lib/NanoEvent.ck @@ -1,11 +1,11 @@ /* * nanoKONTROL event class */ -public class NanoEvent extends Event { +public class NanoEvent extends GenEvent { /* map channel (0-15) to scene name */ - static string @__channelToScene[]; /* pseudo-private */ + static string @__channelToScene[]; /* pseudo-private */ /* map scene name and control id (0-255) to control name */ - static string @__controlToName[][]; /* pseudo-private */ + static string @__controlToName[][]; /* pseudo-private */ class Port extends Step { fun void @@ -40,7 +40,6 @@ public class NanoEvent extends Event { string scene; string control; int CCId; - float value; fun int isScene(string s) @@ -64,39 +63,6 @@ public class NanoEvent extends Event { return p; } - fun float - getFloat() - { - return value; - } - fun float - getFloat(float max) - { - return max*value; - } - fun float - getFloat(float min, float max) - { - return min + (max - min)*value; - } - - fun dur - getDur(dur max) - { - return max*value; - } - fun dur - getDur(dur min, dur max) - { - return min + (max - min)*value; - } - - fun int - getBool() - { - return value $ int; - } - fun void __midi_loop() /* pseudo-private */ { @@ -140,6 +106,7 @@ public class NanoEvent extends Event { broadcast(); } } + /* not reached */ } spork ~ __midi_loop(); -- cgit v1.2.3