more example moving

This commit is contained in:
benfry
2012-04-08 15:59:40 +00:00
parent 1b81affbf0
commit 3b9ebc19f2
52 changed files with 0 additions and 0 deletions
@@ -0,0 +1,18 @@
import processing.sound.*;
Sound s;
void setup() {
// The file, soundtrack.mid, must be copied into the data folder of this sketch
s = new Sound("soundtrack.mid");
softkey("Play");
noLoop();
}
void softkeyPressed(String label) {
if (label.equals("Play")) {
s.play();
softkey("Pause"); // Change the label of the softkey to Pause
} else if (label.equals("Pause")) {
s.pause();
softkey("Play"); // Change the label of the softkey back to Play
}
}