updated 'p'
more straightforward que generation.
This commit is contained in:
parent
410b42c303
commit
0e0157db06
1 changed files with 263 additions and 258 deletions
|
|
@ -90,8 +90,10 @@ Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
||||||
// q list
|
// q list
|
||||||
std::vector<Note> qlist;
|
std::vector<Note> qlist;
|
||||||
void init_qlist() {
|
void init_qlist() {
|
||||||
qlist.push_back(Note(10000, 1, 0, 1, 0, 0, 0, 0, 0));
|
qlist.push_back(Note(1444, 12, 0, 1, 0, 0, 0, 0, 0));
|
||||||
qlist.push_back(Note(10000, 1, 0, 0, 0, 0, 0, 0, 0));
|
qlist.push_back(Note(1444, 12, 0, 0, 0, 0, 0, 0, 0));
|
||||||
|
qlist.push_back(Note(1444, 14, 0, 1, 0, 0, 0, 0, 0));
|
||||||
|
qlist.push_back(Note(1444, 14, 0, 0, 0, 0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
//buttons
|
//buttons
|
||||||
|
|
@ -224,9 +226,9 @@ void screen() {
|
||||||
//+ fancy stuff
|
//+ fancy stuff
|
||||||
screen_req_notify_task.restart();
|
screen_req_notify_task.restart();
|
||||||
|
|
||||||
//+ automatically increase 'song_request'
|
// //+ automatically increase 'song_request'
|
||||||
qselect = qselect + 1;
|
// qselect = qselect + 1;
|
||||||
if (qselect > (qlist.size() - 1)) qselect = 0;
|
// if (qselect > (qlist.size() - 1)) qselect = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//clear screen + a
|
//clear screen + a
|
||||||
|
|
@ -251,36 +253,39 @@ void screen() {
|
||||||
|
|
||||||
//line3 - msg. ready to be sent now.
|
//line3 - msg. ready to be sent now.
|
||||||
display.setCursor(0, line);
|
display.setCursor(0, line);
|
||||||
|
display.setTextSize(2);
|
||||||
display.printf(":Q: %05d %03d %03d %01d", (int)qlist[qselect].id, (int)qlist[qselect].pitch, (int)qlist[qselect].velocity, (int)qlist[qselect].onoff);
|
display.printf(":Q: %05d %03d %03d %01d", (int)qlist[qselect].id, (int)qlist[qselect].pitch, (int)qlist[qselect].velocity, (int)qlist[qselect].onoff);
|
||||||
line += line_step;
|
line += line_step;
|
||||||
|
|
||||||
//line4 - big file name display
|
// //line4 - big file name display
|
||||||
display.setCursor(0, line);
|
// display.setCursor(0, line);
|
||||||
display.setTextSize(2);
|
// display.setTextSize(2);
|
||||||
//
|
// //
|
||||||
char filename[14] = "/NNN.mp3 >";
|
// char filename[14] = "/NNN.mp3 >";
|
||||||
int note = qlist[qselect].pitch;
|
// int note = qlist[qselect].pitch;
|
||||||
int nnn = (note % 1000); // 0~999
|
// int nnn = (note % 1000); // 0~999
|
||||||
int nn = (note % 100); // 0~99
|
// int nn = (note % 100); // 0~99
|
||||||
filename[1] = '0' + (nnn / 100); // N__.MP3
|
// filename[1] = '0' + (nnn / 100); // N__.MP3
|
||||||
filename[2] = '0' + (nn / 10); // _N_.MP3
|
// filename[2] = '0' + (nn / 10); // _N_.MP3
|
||||||
filename[3] = '0' + (nn % 10); // __N.MP3
|
// filename[3] = '0' + (nn % 10); // __N.MP3
|
||||||
//
|
// //
|
||||||
if (qlist[qselect].onoff == 0) {
|
// if (qlist[qselect].onoff == 0) {
|
||||||
filename[9] = 'x';
|
// filename[9] = 'x';
|
||||||
}
|
// }
|
||||||
display.println(filename);
|
// display.println(filename);
|
||||||
line += line_step;
|
// line += line_step;
|
||||||
display.setTextSize(1);
|
// display.setTextSize(1);
|
||||||
line += 8;
|
// line += 8;
|
||||||
|
|
||||||
// //alternative line3+4 - full msg. dump (DEBUG/MONITORING)
|
// //alternative line3+4 - full msg. dump (DEBUG/MONITORING)
|
||||||
// display.setCursor(0, line);
|
// display.setCursor(0, line);
|
||||||
// display.println(":Q: " + qlist[qselect].to_string());
|
// display.println(":Q: " + qlist[qselect].to_string());
|
||||||
// line += line_step;
|
line += line_step;
|
||||||
|
line += line_step;
|
||||||
|
|
||||||
//line5 - song req. tx. notify. (GEN_NOTE_REQ)
|
//line5 - song req. tx. notify. (GEN_NOTE_REQ)
|
||||||
display.setCursor(0, line);
|
display.setCursor(0, line);
|
||||||
|
display.setTextSize(1);
|
||||||
if (req_notify) {
|
if (req_notify) {
|
||||||
display.setCursor(25, line);
|
display.setCursor(25, line);
|
||||||
display.println("~~ d[+=+]b ~~ >>>");
|
display.println("~~ d[+=+]b ~~ >>>");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue