Fix preset dirtying and lights update on DPat
[SugarCubes.git] / _MIDI.pde
index 9a3ce5cb29f21266e69247ab6d9a2e087084f6af..79c3860e487aa74489806029fa34eebe65bc1dd1 100644 (file)
--- a/_MIDI.pde
+++ b/_MIDI.pde
@@ -703,9 +703,13 @@ class APC40MidiOutput implements LXParameter.Listener, GridOutput {
     while (i < 12) {
       sendKnob(i++, 0);
     }
-    for (int row = 0; row < 7; ++row) {
-      for (int col = 0; col < 8; ++col) {
-        setGridState(row, col, 0);
+    if (focusedPattern instanceof DPat) {
+      ((DPat)focusedPattern).updateLights();
+    } else {
+      for (int row = 0; row < 7; ++row) {
+        for (int col = 0; col < 8; ++col) {
+          setGridState(row, col, 0);
+        }
       }
     }
   }