From bfb6cd822a96a770d4b14e92796b10864103a593 Mon Sep 17 00:00:00 2001 From: e2002 Date: Tue, 18 Oct 2022 10:08:42 +0300 Subject: [PATCH] v0.8.02b --- README.md | 4 ++ exsamples/mytheme.h | 5 +- yoRadio/src/core/config.cpp | 59 +++++++++++++----------- yoRadio/src/core/config.h | 3 ++ yoRadio/src/core/display.cpp | 4 +- yoRadio/src/core/options.h | 11 ++++- yoRadio/src/displays/widgets/widgets.cpp | 2 +- 7 files changed, 55 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 341a8a6..ff2d72d 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,10 @@ Work is in progress... --- ## Version history +#### v0.8.02b +- fixed artifacts when displaying the volume level +- changes in mytheme.h . Added colors COLOR_PL_CURRENT, COLOR_PL_CURRENT_BG, COLOR_PL_CURRENT_FILL. Details in [exsamples/mytheme.h](exsamples/mytheme.h) + #### v0.8.01b - fix INITR_MINI160x80 compiling error - fix ENC_INTERNALPULLUP descriotion in exsamples/myoptions.h diff --git a/exsamples/mytheme.h b/exsamples/mytheme.h index b8ac569..3381227 100644 --- a/exsamples/mytheme.h +++ b/exsamples/mytheme.h @@ -19,7 +19,7 @@ //#define COLOR_BACKGROUND 255, 255, 0 /* background */ //#define COLOR_STATION_NAME 0, 0, 0 /* station name */ //#define COLOR_STATION_BG 91, 118, 255 /* station name background */ -//#define COLOR_STATION_FILL 231, 211, 90 /* station name fill background */ +//#define COLOR_STATION_FILL 91, 118, 255 /* station name fill background */ //#define COLOR_SNG_TITLE_1 255, 0, 0 /* first title */ //#define COLOR_SNG_TITLE_2 0, 0, 0 /* second title */ //#define COLOR_WEATHER 255, 0, 216 /* weather string */ @@ -39,6 +39,9 @@ //#define COLOR_DIGITS 100, 100, 255 /* volume / station number */ //#define COLOR_DIVIDER 0, 255, 0 /* divider color (DSP_ST7789, DSP_ILI9341, DSP_ILI9225) */ //#define COLOR_BITRATE 231, 211, 90 /* bitrate */ +//#define COLOR_PL_CURRENT 0, 0, 0 /* playlist current item */ +//#define COLOR_PL_CURRENT_BG 91, 118, 255 /* playlist current item background */ +//#define COLOR_PL_CURRENT_FILL 91, 118, 255 /* playlist current item fill background */ //#define COLOR_PLAYLIST_0 255, 0, 0 /* playlist string 0 */ //#define COLOR_PLAYLIST_1 0, 255, 0 /* playlist string 1 */ //#define COLOR_PLAYLIST_2 255, 0, 255 /* playlist string 2 */ diff --git a/yoRadio/src/core/config.cpp b/yoRadio/src/core/config.cpp index 417b25b..30ecee8 100644 --- a/yoRadio/src/core/config.cpp +++ b/yoRadio/src/core/config.cpp @@ -49,34 +49,37 @@ uint16_t Config::color565(uint8_t r, uint8_t g, uint8_t b) } void Config::loadTheme(){ - theme.background = color565(COLOR_BACKGROUND); - theme.meta = color565(COLOR_STATION_NAME); - theme.metabg = color565(COLOR_STATION_BG); - theme.metafill = color565(COLOR_STATION_FILL); - theme.title1 = color565(COLOR_SNG_TITLE_1); - theme.title2 = color565(COLOR_SNG_TITLE_2); - theme.digit = color565(COLOR_DIGITS); - theme.div = color565(COLOR_DIVIDER); - theme.weather = color565(COLOR_WEATHER); - theme.vumax = color565(COLOR_VU_MAX); - theme.vumin = color565(COLOR_VU_MIN); - theme.clock = color565(COLOR_CLOCK); - theme.seconds = color565(COLOR_SECONDS); - theme.dow = color565(COLOR_DAY_OF_W); - theme.date = color565(COLOR_DATE); - theme.heap = color565(COLOR_HEAP); - theme.buffer = color565(COLOR_BUFFER); - theme.ip = color565(COLOR_IP); - theme.vol = color565(COLOR_VOLUME_VALUE); - theme.rssi = color565(COLOR_RSSI); - theme.bitrate = color565(COLOR_BITRATE); - theme.volbarout = color565(COLOR_VOLBAR_OUT); - theme.volbarin = color565(COLOR_VOLBAR_IN); - theme.playlist[0] = color565(COLOR_PLAYLIST_0); - theme.playlist[1] = color565(COLOR_PLAYLIST_1); - theme.playlist[2] = color565(COLOR_PLAYLIST_2); - theme.playlist[3] = color565(COLOR_PLAYLIST_3); - theme.playlist[4] = color565(COLOR_PLAYLIST_4); + theme.background = color565(COLOR_BACKGROUND); + theme.meta = color565(COLOR_STATION_NAME); + theme.metabg = color565(COLOR_STATION_BG); + theme.metafill = color565(COLOR_STATION_FILL); + theme.title1 = color565(COLOR_SNG_TITLE_1); + theme.title2 = color565(COLOR_SNG_TITLE_2); + theme.digit = color565(COLOR_DIGITS); + theme.div = color565(COLOR_DIVIDER); + theme.weather = color565(COLOR_WEATHER); + theme.vumax = color565(COLOR_VU_MAX); + theme.vumin = color565(COLOR_VU_MIN); + theme.clock = color565(COLOR_CLOCK); + theme.seconds = color565(COLOR_SECONDS); + theme.dow = color565(COLOR_DAY_OF_W); + theme.date = color565(COLOR_DATE); + theme.heap = color565(COLOR_HEAP); + theme.buffer = color565(COLOR_BUFFER); + theme.ip = color565(COLOR_IP); + theme.vol = color565(COLOR_VOLUME_VALUE); + theme.rssi = color565(COLOR_RSSI); + theme.bitrate = color565(COLOR_BITRATE); + theme.volbarout = color565(COLOR_VOLBAR_OUT); + theme.volbarin = color565(COLOR_VOLBAR_IN); + theme.plcurrent = color565(COLOR_PL_CURRENT); + theme.plcurrentbg = color565(COLOR_PL_CURRENT_BG); + theme.plcurrentfill = color565(COLOR_PL_CURRENT_FILL); + theme.playlist[0] = color565(COLOR_PLAYLIST_0); + theme.playlist[1] = color565(COLOR_PLAYLIST_1); + theme.playlist[2] = color565(COLOR_PLAYLIST_2); + theme.playlist[3] = color565(COLOR_PLAYLIST_3); + theme.playlist[4] = color565(COLOR_PLAYLIST_4); } template int Config::eepromWrite(int ee, const T& value) { diff --git a/yoRadio/src/core/config.h b/yoRadio/src/core/config.h index 67bcc94..10f1a48 100644 --- a/yoRadio/src/core/config.h +++ b/yoRadio/src/core/config.h @@ -48,6 +48,9 @@ struct theme_t { uint16_t bitrate; uint16_t volbarout; uint16_t volbarin; + uint16_t plcurrent; + uint16_t plcurrentbg; + uint16_t plcurrentfill; uint16_t playlist[5]; }; struct config_t diff --git a/yoRadio/src/core/display.cpp b/yoRadio/src/core/display.cpp index 15a1191..db5e3fa 100644 --- a/yoRadio/src/core/display.cpp +++ b/yoRadio/src/core/display.cpp @@ -78,13 +78,13 @@ void Display::_buildPager(){ #if DSP_MODEL==DSP_NOKIA5110 _plcurrent.init("*", playlistConf, 0, 1); #else - _plcurrent.init("*", playlistConf, config.theme.meta, config.theme.metabg); + _plcurrent.init("*", playlistConf, config.theme.plcurrent, config.theme.plcurrentbg); #endif #ifndef HIDE_TITLE2 _title2 = new ScrollWidget("*", title2Conf, config.theme.title2, config.theme.background); #endif #if !defined(DSP_LCD) && DSP_MODEL!=DSP_NOKIA5110 - _plbackground = new FillWidget(playlBGConf, config.theme.metafill); + _plbackground = new FillWidget(playlBGConf, config.theme.plcurrentfill); _metabackground = new FillWidget(metaBGConf, config.theme.metafill); #endif #if DSP_MODEL==DSP_NOKIA5110 diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 0c51b6d..cb4b9f9 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -1,7 +1,7 @@ #ifndef options_h #define options_h -#define VERSION "0.8.01b" +#define VERSION "0.8.02b" /******************************************************* DO NOT EDIT THIS FILE. @@ -307,6 +307,15 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti #ifndef COLOR_DIVIDER #define COLOR_DIVIDER 165, 162, 132 #endif +#ifndef COLOR_PL_CURRENT + #define COLOR_PL_CURRENT 0, 0, 0 +#endif +#ifndef COLOR_PL_CURRENT_BG + #define COLOR_PL_CURRENT_BG 231, 211, 90 +#endif +#ifndef COLOR_PL_CURRENT_FILL + #define COLOR_PL_CURRENT_FILL 231, 211, 90 +#endif #ifndef COLOR_PLAYLIST_0 #define COLOR_PLAYLIST_0 115, 115, 115 #endif diff --git a/yoRadio/src/displays/widgets/widgets.cpp b/yoRadio/src/displays/widgets/widgets.cpp index fc29ecb..5b3fadb 100644 --- a/yoRadio/src/displays/widgets/widgets.cpp +++ b/yoRadio/src/displays/widgets/widgets.cpp @@ -258,7 +258,7 @@ void SliderWidget::_draw() { } void SliderWidget::_clear() { - _oldvalwidth = 0; +// _oldvalwidth = 0; dsp.fillRect(_config.left, _config.top, _width, _height, _bgcolor); } /************************