v0.4.297
This commit is contained in:
@@ -14,26 +14,38 @@ void audio_bitrate(const char *info)
|
||||
netserver.requestOnChange(BITRATE, 0);
|
||||
}
|
||||
|
||||
bool printable(const char *info) {
|
||||
bool p = true;
|
||||
for (int c = 0; c < strlen(info); c++)
|
||||
{
|
||||
if ((uint8_t)info[c] > 0x7e || (uint8_t)info[c] < 0x20) p = false;
|
||||
}
|
||||
if (!p) p = (uint8_t)info[0] >= 0xC2 && (uint8_t)info[1] >= 0x80 && (uint8_t)info[1] <= 0xBF;
|
||||
return p;
|
||||
}
|
||||
|
||||
void audio_showstation(const char *info) {
|
||||
if (strlen(info) > 0) {
|
||||
display.title(info);
|
||||
bool p = printable(info);
|
||||
display.title(p?info:"*****");
|
||||
if (player.requesToStart) {
|
||||
telnet.info();
|
||||
player.requesToStart = false;
|
||||
} else {
|
||||
telnet.printf("##CLI.ICY0#: %s\n", info);
|
||||
telnet.printf("##CLI.ICY0#: %s\n", p?info:"*****");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void audio_showstreamtitle(const char *info) {
|
||||
if (strlen(info) > 0) {
|
||||
display.title(info);
|
||||
bool p = printable(info);
|
||||
display.title(p?info:"*****");
|
||||
if (player.requesToStart) {
|
||||
telnet.info();
|
||||
player.requesToStart = false;
|
||||
} else {
|
||||
telnet.printf("##CLI.META#: %s\n> ", info);
|
||||
telnet.printf("##CLI.META#: %s\n> ", p?info:"*****");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user