Skip to content

Commit

Permalink
v0.7.490
Browse files Browse the repository at this point in the history
  • Loading branch information
e2002 committed Aug 29, 2022
1 parent de97530 commit b574b4a
Show file tree
Hide file tree
Showing 15 changed files with 432 additions and 677 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,24 @@ Work is in progress...

---
## Version history
#### v0.7.490
**!!! 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.**
- fixed playlist break down when saving it
- fixed bug with cropped song titles on single line displays (GC9106, ST7735mini, N5110 etc.)
- netserver - optimization and refactoring
- web interface optimization
- the AUDIOBUFFER_MULTIPLIER parameter is deprecated. New parameter AUDIOBUFFER_MULTIPLIER2. If everything works fine, then it is better not to touch it.
- new setting VS_PATCH_ENABLE (see PS)
- fixing other bugs

_**PS:** A bug was found with the lack of sound on some (not all) green VS1053 boards.
If there is no sound, you need to assign in myoptions_
```
#define VS_PATCH_ENABLE false
```
_On red boards and normally working green boards, nothing else needs to be done._

#### v0.7.414
- fixed non latin long titles of songs error

Expand Down
18 changes: 15 additions & 3 deletions yoRadio/audiohandlers.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void audio_info(const char *info) {
player.mode = STOPPED;
player.stopInfo();
}
if (strstr(info, "not supported") != NULL){
if (strstr(info, "not supported") != NULL || strstr(info, "Account already in use") != NULL){
config.setTitle(info);
netserver.requestOnChange(TITLE, 0);
player.setOutputPins(false);
Expand Down Expand Up @@ -47,20 +47,32 @@ bool printable(const char *info) {
}

void audio_showstation(const char *info) {
DBGVB("[%s] info = %s", __func__, info);
if (strlen(info) > 0) {
bool p = printable(info);
config.setTitle(p?info:"*****");
config.setTitle(p?info:config.station.name);
netserver.requestOnChange(TITLE, 0);
}
}

void audio_showstreamtitle(const char *info) {
DBGVB("[%s] info = %s", __func__, info);
if (strstr(info, "Account already in use") != NULL){
config.setTitle(info);
netserver.requestOnChange(TITLE, 0);
player.setOutputPins(false);
player.setDefaults();
if (player_on_stop_play) player_on_stop_play();
player.mode = STOPPED;
player.stopInfo();
return;
}
if (strlen(info) > 0) {
bool p = printable(info);
#ifdef DEBUG_TITLES
config.setTitle(DEBUG_TITLES);
#else
config.setTitle(p?info:"*****");
config.setTitle(p?info:config.station.name);
#endif
netserver.requestOnChange(TITLE, 0);
}
Expand Down
10 changes: 9 additions & 1 deletion yoRadio/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ bool Config::parseSsid(const char* line, char* ssid, char* pass) {
return true;
}

bool Config::saveWifi(const char* post) {
bool Config::saveWifiFromNextion(const char* post){
File file = SPIFFS.open(SSIDS_PATH, "w");
if (!file) {
return false;
Expand All @@ -455,6 +455,14 @@ bool Config::saveWifi(const char* post) {
}
}

bool Config::saveWifi() {
if (!SPIFFS.exists(TMP_PATH)) return false;
SPIFFS.remove(SSIDS_PATH);
SPIFFS.rename(TMP_PATH, SSIDS_PATH);
ESP.restart();
return true;
}

bool Config::initNetwork() {
File file = SPIFFS.open(SSIDS_PATH, "r");
if (!file || file.isDirectory()) {
Expand Down
3 changes: 2 additions & 1 deletion yoRadio/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class Config {
bool parseSsid(const char* line, char* ssid, char* pass);
void loadStation(uint16_t station);
bool initNetwork();
bool saveWifi(const char* post);
bool saveWifi();
bool saveWifiFromNextion(const char* post);
void setSmartStart(byte ss);
void initPlaylist();
void indexPlaylist();
Expand Down
Binary file modified yoRadio/data/www/script.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions yoRadio/data/www/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ <h2 class="pagetitle">SёTTINGS</h2>
</div>
</div>
<div class="flex-row last">
<input id="file-upload" type="file" accept=".txt, .csv" hidden/>
<div class="button group group_system hidden" data-name="wifiexport">Export</div>
<div class="button hlbutton" data-name="wifiupload">Save &amp; Reboot</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions yoRadio/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ char *split(char *str, const char *delim) {
}

void Display::title() {
DBGVB("call of %s(), config.station.title=%s", __func__, config.station.title);
DBGVB("[%s] config.station.title = %s", __func__, config.station.title);
if (strlen(config.station.title) > 0) {
char tmpbuf[strlen(config.station.title)+1];
strlcpy(tmpbuf, config.station.title, strlen(config.station.title)+1);
Expand All @@ -589,7 +589,7 @@ void Display::title() {
title1.setText(dsp.utf8Rus(tmpbuf, true));
title2.setText(dsp.utf8Rus(stitle, true));
}else{
title1.setText(dsp.utf8Rus(tmpbuf, true));
title1.setText(dsp.utf8Rus(config.station.title, true));
title2.setText(dsp.utf8Rus("", true));
}
#ifdef USE_NEXTION
Expand Down
Loading

0 comments on commit b574b4a

Please sign in to comment.