Lots of code cleanup, removed Panda code, all grizzly, cleaning up mapping
[SugarCubes.git] / _MIDI.pde
index 7673f7ffd87d6cadf3630ed7abfa64efc0e50c7e..18fa5a3437f4153d74fc092fe35c8a1ee0af4984 100644 (file)
--- a/_MIDI.pde
+++ b/_MIDI.pde
@@ -115,7 +115,7 @@ public interface SCMidiInputListener {
   public void onEnabled(SCMidiInput controller, boolean enabled);
 }
 
-public abstract class SCMidiInput extends AbstractScrollItem {
+public abstract class SCMidiInput extends UIScrollList.AbstractItem {
 
   protected boolean enabled = false;
   private final String name;
@@ -863,7 +863,11 @@ class APC40MidiOutput implements LXParameterListener, GridOutput {
   }
 
   private void sendKnob(int i, LXParameter p) {
-    sendKnob(i, (int) (p.getValuef() * 127.));
+    float pv = constrain(p.getValuef(), 0, 1);
+    if (p instanceof LXNormalizedParameter) {
+      pv = ((LXNormalizedParameter)p).getNormalizedf();
+    }
+    sendKnob(i, (int) (pv * 127.));
   }
   
   private void sendKnob(int i, int value) {