v0.7.414
This commit is contained in:
@@ -317,6 +317,9 @@ Work is in progress...
|
|||||||
|
|
||||||
---
|
---
|
||||||
## Version history
|
## Version history
|
||||||
|
#### v0.7.414
|
||||||
|
- fixed non latin long titles of songs error
|
||||||
|
|
||||||
#### v0.7.402
|
#### v0.7.402
|
||||||
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** \
|
**!!! a [full update](#update-over-web-interface) with Sketch data upload is required. After updating please press CTRL+F5 in browser !!!** \
|
||||||
**Please backup playlist.csv and wifi.csv before updating.**
|
**Please backup playlist.csv and wifi.csv before updating.**
|
||||||
|
|||||||
@@ -57,7 +57,11 @@ void audio_showstation(const char *info) {
|
|||||||
void audio_showstreamtitle(const char *info) {
|
void audio_showstreamtitle(const char *info) {
|
||||||
if (strlen(info) > 0) {
|
if (strlen(info) > 0) {
|
||||||
bool p = printable(info);
|
bool p = printable(info);
|
||||||
|
#ifdef DEBUG_TITLES
|
||||||
|
config.setTitle(DEBUG_TITLES);
|
||||||
|
#else
|
||||||
config.setTitle(p?info:"*****");
|
config.setTitle(p?info:"*****");
|
||||||
|
#endif
|
||||||
netserver.requestOnChange(TITLE, 0);
|
netserver.requestOnChange(TITLE, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ void DBGVB(const char *format, ...) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void u8fix(char *src){
|
||||||
|
char last = src[strlen(src)-1];
|
||||||
|
if ((uint8_t)last >= 0xC2) src[strlen(src)-1]='\0';
|
||||||
|
}
|
||||||
|
|
||||||
void Config::init() {
|
void Config::init() {
|
||||||
EEPROM.begin(EEPROM_SIZE);
|
EEPROM.begin(EEPROM_SIZE);
|
||||||
#if IR_PIN!=255
|
#if IR_PIN!=255
|
||||||
@@ -223,12 +228,14 @@ byte Config::setLastSSID(byte val) {
|
|||||||
void Config::setTitle(const char* title) {
|
void Config::setTitle(const char* title) {
|
||||||
memset(config.station.title, 0, BUFLEN);
|
memset(config.station.title, 0, BUFLEN);
|
||||||
strlcpy(config.station.title, title, BUFLEN);
|
strlcpy(config.station.title, title, BUFLEN);
|
||||||
|
u8fix(config.station.title);
|
||||||
display.putRequest({NEWTITLE, 0});
|
display.putRequest({NEWTITLE, 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::setStation(const char* station) {
|
void Config::setStation(const char* station) {
|
||||||
memset(config.station.name, 0, BUFLEN);
|
memset(config.station.name, 0, BUFLEN);
|
||||||
strlcpy(config.station.name, station, BUFLEN);
|
strlcpy(config.station.name, station, BUFLEN);
|
||||||
|
u8fix(config.station.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::indexPlaylist() {
|
void Config::indexPlaylist() {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#define INDEX_PATH "/data/index.dat"
|
#define INDEX_PATH "/data/index.dat"
|
||||||
|
|
||||||
void DBGVB(const char *format, ...);
|
void DBGVB(const char *format, ...);
|
||||||
|
void u8fix(char *src);
|
||||||
|
|
||||||
struct theme_t {
|
struct theme_t {
|
||||||
uint16_t background;
|
uint16_t background;
|
||||||
|
|||||||
@@ -558,9 +558,6 @@ void Display::station() {
|
|||||||
nextion.newNameset(config.station.name);
|
nextion.newNameset(config.station.name);
|
||||||
nextion.bitrate(config.station.bitrate);
|
nextion.bitrate(config.station.bitrate);
|
||||||
nextion.bitratePic(ICON_NA);
|
nextion.bitratePic(ICON_NA);
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_TITLES
|
|
||||||
meta.setText(dsp.utf8Rus("Utenim adminim veniam FM", true));
|
|
||||||
#endif
|
#endif
|
||||||
//dsp.loop(true);
|
//dsp.loop(true);
|
||||||
//netserver.requestOnChange(STATION, 0);
|
//netserver.requestOnChange(STATION, 0);
|
||||||
@@ -570,44 +567,36 @@ void Display::returnTile() {
|
|||||||
meta.setText(dsp.utf8Rus(config.station.name, true));
|
meta.setText(dsp.utf8Rus(config.station.name, true));
|
||||||
#ifdef USE_NEXTION
|
#ifdef USE_NEXTION
|
||||||
nextion.newNameset(config.station.name);
|
nextion.newNameset(config.station.name);
|
||||||
#endif
|
|
||||||
#ifdef DEBUG_TITLES
|
|
||||||
meta.setText(dsp.utf8Rus("Utenim adminim veniam FM", true));
|
|
||||||
#endif
|
#endif
|
||||||
meta.reset();
|
meta.reset();
|
||||||
//dsp.loop(true);
|
//dsp.loop(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Display::title() {
|
char *split(char *str, const char *delim) {
|
||||||
/*
|
char *dmp = strstr(str, delim);
|
||||||
memset(config.station.title, 0, BUFLEN);
|
if (dmp == NULL) return NULL;
|
||||||
strlcpy(config.station.title, str, BUFLEN);
|
*dmp = '\0';
|
||||||
*/
|
return dmp + strlen(delim);
|
||||||
char ttl[BUFLEN / 2] = { 0 };
|
}
|
||||||
char sng[BUFLEN / 2] = { 0 };
|
|
||||||
if (strlen(config.station.title) > 0) {
|
|
||||||
char* ici;
|
|
||||||
if ((ici = strstr(config.station.title, " - ")) != NULL && TITLE_SIZE2 != 0) {
|
|
||||||
strlcpy(sng, ici + 3, BUFLEN / 2);
|
|
||||||
strlcpy(ttl, config.station.title, strlen(config.station.title) - strlen(ici) + 1);
|
|
||||||
|
|
||||||
} else {
|
void Display::title() {
|
||||||
strlcpy(ttl, config.station.title, BUFLEN / 2);
|
DBGVB("call of %s(), config.station.title=%s", __func__, config.station.title);
|
||||||
sng[0] = '\0';
|
if (strlen(config.station.title) > 0) {
|
||||||
|
char tmpbuf[strlen(config.station.title)+1];
|
||||||
|
strlcpy(tmpbuf, config.station.title, strlen(config.station.title)+1);
|
||||||
|
char *stitle = split(tmpbuf, " - ");
|
||||||
|
if(stitle && TITLE_SIZE2 != 0){
|
||||||
|
title1.setText(dsp.utf8Rus(tmpbuf, true));
|
||||||
|
title2.setText(dsp.utf8Rus(stitle, true));
|
||||||
|
}else{
|
||||||
|
title1.setText(dsp.utf8Rus(tmpbuf, true));
|
||||||
|
title2.setText(dsp.utf8Rus("", true));
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_TITLES
|
|
||||||
strlcpy(ttl, "Duis aute irure dolor in reprehenderit in voluptate velit", BUFLEN / 2);
|
|
||||||
strlcpy(sng, "Excepteur sint occaecat cupidatat non proident", BUFLEN / 2);
|
|
||||||
#endif
|
|
||||||
title1.setText(dsp.utf8Rus(ttl, true));
|
|
||||||
if (TITLE_SIZE2 != 0) title2.setText(dsp.utf8Rus(sng, true));
|
|
||||||
#ifdef USE_NEXTION
|
#ifdef USE_NEXTION
|
||||||
nextion.newTitle(config.station.title);
|
nextion.newTitle(config.station.title);
|
||||||
#endif
|
#endif
|
||||||
//dsp.loop(true);
|
|
||||||
if (player_on_track_change) player_on_track_change();
|
if (player_on_track_change) player_on_track_change();
|
||||||
}
|
}
|
||||||
//netserver.requestOnChange(TITLE, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Display::heap() {
|
void Display::heap() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef options_h
|
#ifndef options_h
|
||||||
#define options_h
|
#define options_h
|
||||||
|
|
||||||
#define VERSION "0.7.402"
|
#define VERSION "0.7.414"
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
DO NOT EDIT THIS FILE.
|
DO NOT EDIT THIS FILE.
|
||||||
|
|||||||
Reference in New Issue
Block a user