This commit is contained in:
e2002
2024-12-26 09:58:19 +03:00
parent 27e33a1bc8
commit 775590f213
26 changed files with 172 additions and 70 deletions

View File

@@ -55,7 +55,7 @@ const ProgressConfig bootPrgConf PROGMEM = { 90, 14, 4 };
const BitrateConfig fullbitrateConf PROGMEM = {{DSP_WIDTH-TFT_FRAMEWDT-38, 59, 2, WA_LEFT}, 42 };
/* BANDS */ /* { onebandwidth, onebandheight, bandsHspace, bandsVspace, numofbands, fadespeed } */
const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 10 };
const VUBandsConfig bandsConf PROGMEM = { 32, 130, 4, 2, 10, 3 };
/* STRINGS */
const char numtxtFmt[] PROGMEM = "%d";

View File

@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */
if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -101,7 +101,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -148,6 +148,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
_getTimeBounds();
clockRightSpace = (width()-_timewidth-CHARWIDTH*3*2-36)/2;
_clockTime();
if(!config.isScreensaver)
/*if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) */_clockDate();
}
_clockSeconds();

View File

@@ -149,7 +149,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*2*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */
if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
}
void DspCore::_clockDate(){
@@ -157,7 +157,7 @@ void DspCore::_clockDate(){
fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -185,8 +185,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight+21, 32, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*2*2-18, clockTop-clockTimeHeight+21, 32, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -201,7 +201,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}

View File

@@ -81,7 +81,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds);
if(!config.isScreensaver) print(_bufforseconds);
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -95,7 +95,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -123,8 +123,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -139,7 +139,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}

View File

@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */
if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -103,7 +103,7 @@ void DspCore::_clockDate(){
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15);
setTextSize(2);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -131,8 +131,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -147,7 +147,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}

View File

@@ -166,7 +166,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*2+2, clockTimeHeight, config.theme.background);
dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*2+2, clockTimeHeight+2, config.theme.background);
//dsp.fillRect(_timeleft, clockTop-clockTimeHeight, _timewidth+CHARWIDTH*3*2+24, clockTimeHeight+10+CHARHEIGHT, config.theme.background);
}

View File

@@ -146,7 +146,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }

View File

@@ -154,7 +154,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }

View File

@@ -165,7 +165,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }

View File

@@ -88,7 +88,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*3*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */
if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI42pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -102,7 +102,7 @@ void DspCore::_clockDate(){
dsp.fillRect(_olddateleft, clockTop+10, _olddatewidth, CHARHEIGHT, config.theme.background);
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+10);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight, clockTimeHeight+3, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*3*2-18, clockTop-clockTimeHeight+29, 44, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH;
@@ -146,7 +146,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}

View File

@@ -87,7 +87,7 @@ void DspCore::_clockSeconds(){
setTextColor(config.theme.seconds, config.theme.background);
setCursor(width() - 8 - clockRightSpace - CHARWIDTH*4*2, clockTop-clockTimeHeight+1);
sprintf(_bufforseconds, "%02d", network.timeinfo.tm_sec);
print(_bufforseconds); /* print seconds */
if(!config.isScreensaver) print(_bufforseconds); /* print seconds */
setTextSize(1);
setFont(&DS_DIGI56pt7b);
setTextColor((network.timeinfo.tm_sec % 2 == 0) ? config.theme.clock : (CLOCKFONT_MONO?config.theme.clockbg:config.theme.background), config.theme.background);
@@ -102,7 +102,7 @@ void DspCore::_clockDate(){
setTextColor(config.theme.date, config.theme.background);
setCursor(_dateleft, clockTop+15);
setTextSize(2);
print(_dateBuf); /* print date */
if(!config.isScreensaver) print(_dateBuf); /* print date */
strlcpy(_oldDateBuf, _dateBuf, sizeof(_dateBuf));
_olddatewidth = _datewidth;
_olddateleft = _dateleft;
@@ -130,8 +130,8 @@ void DspCore::_clockTime(){
strlcpy(_oldTimeBuf, _timeBuf, sizeof(_timeBuf));
_oldtimewidth = _timewidth;
_oldtimeleft = _timeleft;
drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
if(!config.isScreensaver) drawFastVLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight, clockTimeHeight+4, config.theme.div); /*divider vert*/
if(!config.isScreensaver) drawFastHLine(width()-clockRightSpace-CHARWIDTH*4*2-18, clockTop-clockTimeHeight+37, 59, config.theme.div); /*divider hor*/
sprintf(_buffordate, "%2d %s %d", network.timeinfo.tm_mday,mnths[network.timeinfo.tm_mon], network.timeinfo.tm_year+1900);
strlcpy(_dateBuf, utf8Rus(_buffordate, true), sizeof(_dateBuf));
_datewidth = strlen(_dateBuf) * CHARWIDTH*2;
@@ -146,7 +146,8 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
if(strcmp(_oldTimeBuf, _timeBuf)!=0 || redraw){
_getTimeBounds();
_clockTime();
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
if(!config.isScreensaver)
if(strcmp(_oldDateBuf, _dateBuf)!=0 || redraw) _clockDate();
}
_clockSeconds();
}

View File

@@ -137,7 +137,7 @@ void DspCore::printClock(uint16_t top, uint16_t rightspace, uint16_t timeheight,
}
void DspCore::clearClock(){
dsp.fillRect(_timeleft, clockTop, _timewidth, clockTimeHeight*CHARHEIGHT, config.theme.background);
dsp.fillRect(_timeleft, clockTop, _timewidth+14, clockTimeHeight*CHARHEIGHT, config.theme.background);
}
void DspCore::startWrite(void) { }