-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathA_States.pde
182 lines (167 loc) · 4.05 KB
/
A_States.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// these functions are called by draw() depending on the current state
void normalProgram () {
// state normal program.
//
// background
if (img!=null)
background(img);
else
background(0);
//
// show progress bar
buttonProgressFrame.display();
if (!(meta==null))
buttonProgressData.w = map(song.position(), 0, meta.length(), 0, width-24 );
buttonProgressData.display();
//
// show pause button
buttonPause.display();
//
showOtherScreenElements() ;
//
buttonFolder.display();
//
// show song list or show info table
if ( showSongList ) {
//
// show song list
if ( meta.author()!=null )
headline = meta.author() + ", " + meta.album();
else
headline = "";
showListFunction(headline, namesFiles, indexFile);
} // if
else {
// show meta data
showMeta() ;
} // else
//
// song over? go next song (but not if just paused)
try {
if (!song.isPlaying() && !paused)
{
// go To Next Song
command( buttonNext.commandNumber );
}
}
catch (Exception e) {
// do nothing
}
//
if (showMp3Image) {
if (mp3Image!=null) {
image(mp3Image, width-mp3Image.width, height-mp3Image.height);
}
}
//
// yellow mouse over tool tip
checkMouseOver();
//
} // func
void stateFileManagerFunction() {
// file manager
// background
if (imgForFileManager!=null)
background(imgForFileManager);
else
background(0);
fill(255);
if ( !pathGlobal.exists() ) {
folderDoesExist=false;
}
else {
folderDoesExist=true;
}
if (folderDoesExist)
textTab ("No songs found in \n"
+ pathGlobal
+ "\nPlease use \"open folder\" to change folder. "
+ "Please note that \nthe folder itself (not only its subfolders) must contain mp3s.", 20, 20 );
else
textTab ("Folder does not exist:\n"
+ pathGlobal
+ "\nPlease use \"open folder\" to change folder. "
+ "Please note that \nthe folder itself (not only its subfolders) must contain mp3s.", 20, 20 );
buttonFolderUp.display();
buttonHome.display();
buttonPreviousFolder.display();
buttonNextFolder.display();
if (folderDoesExist)
headline="folder contains ";
else
headline="folder does not exist";
showListFunction(headline, namesFolders, -1);
// yellow mouse over tool tip
checkMouseOver();
//
} // func
void stateDrivesFunction() {
// Drives
// background
if (imgForFileManager!=null)
background(imgForFileManager);
else
background(0);
fill(255);
textTab ("Drives \n"
+ "\nPlease use \"open folder\" to change folder. "
+ "Please note that\nthe folder itself (not only its subfolders) must contain mp3s.", 20, 20 );
// showDrivesListFunction();
headline="Drives are";
showListFunction(headline, namesFolders, -1);
buttonHome.display();
buttonPreviousFolder.display();
buttonNextFolder.display();
// yellow mouse over tool tip
checkMouseOver();
statusMsg.statusMsgShow();
//
} // func
//
void showHelp() {
// // the help screen
final int xs = 10; // x start-pos
final int ys = 115; // y start-pos
final int yi = 16; // y line difference
//
int y = ys;
int i = 0;
// background
if (img!=null)
background(img);
else
background(111);
fill(255);
text("Help for song player ", xs, y);
y+=yi*2;
textTab("* Remember to set pathGlobalDefault *", xs, y);
y+=yi*2;
textTab("During a song ***** ", xs, y);
y+=yi;
textTab("H\tfor this help", xs, y);
y+=yi;
textTab("0..9\tsong number ", xs, y);
y+=yi;
textTab("f\tFFT display on/off", xs, y);
y+=yi;
textTab("k\tshow in explorer ", xs, y);
y+=yi;
textTab("I\tImage from MP3 off (shift-i) ", xs, y);
y+=yi;
textTab("i\tImage from MP3 on ", xs, y);
//
y+=yi*2;
textTab("During folder navigation *****", xs, y);
y+=yi;
textTab("Mouse wheel\t scroll", xs, y);
y+=yi;
textTab("cursor key\t scroll", xs, y);
y+=yi;
textTab("Home key\tstart of list", xs, y);
y+=yi;
textTab("End key\tend of list", xs, y);
y+=yi;
textTab("Page up\t parent folder", xs, y);
y+=yi;
}
//