-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEquanPlugin.pde
50 lines (39 loc) · 1.15 KB
/
EquanPlugin.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public abstract class EquanPlugin {
int w; // width
int h; // height
int d; // depth
PGraphics c; // canvas of dimensions w x (h*d)
boolean needsFadeIn = true;
public EquanPlugin(int wd, int ht, int dp) {
this.c = createGraphics(wd, ht*dp, JAVA2D);
c.beginDraw();
c.background(0);
c.endDraw();
this.w = wd;
this.h = ht;
this.d = dp;
}
synchronized void draw() {
// c is about to be scraped for pixels; do what you will.
}
synchronized void finish() {
// This plugin is being turned off; stop any threads.
}
synchronized void mouseClicked() {
}
synchronized void noteOn(int channel, int pitch, int velocity, int tentacleX, int tentacleZ) {
}
synchronized void noteOff(int channel, int pitch, int velocity, int tentacleX, int tentacleZ) {
}
String randomVideo() {
//if (true) return "videos/1617358.mp4";
java.io.File folder = new java.io.File(dataPath("videos"));
String[] filenames = folder.list();
while (true) {
String f = filenames[int(random(filenames.length))];
if (!f.equals(".DS_Store")) {
return "videos/" + f;
}
}
}
}