Push and pop modes
[kaka/cakelight.git] / src / kaka / cakelight / CakeLight.java
index 822e2ab..cd59362 100644 (file)
@@ -28,7 +28,7 @@ public class CakeLight {
     }
 
     public void cleanup() {
-        while (popMode());
+        while (popMode() != null);
     }
 
     public void pushMode(Mode mode) {
@@ -41,16 +41,16 @@ public class CakeLight {
         // TODO: create a composite fading mode of top of stack and new mode
     }
 
-    public boolean popMode() {
+    public Mode popMode() {
         if (!modes.isEmpty()) {
             Mode mode = modes.pop();
             stopMode(mode);
             if (!modes.isEmpty()) {
                 resumeMode(modes.peek());
             }
-            return true;
+            return mode;
         }
-        return false;
+        return null;
         // TODO: create a composite fading mode of popped mode and top of stack, unless doing cleanup
     }