mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
more example moving
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user