Skip to content

Commit

Permalink
fix Remnants of a long title. #469
Browse files Browse the repository at this point in the history
  • Loading branch information
schreibfaul1 committed Jul 28, 2024
1 parent b7037a4 commit ab3a071
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 51 deletions.
46 changes: 0 additions & 46 deletions boards/esp32s3-usb.json

This file was deleted.

2 changes: 1 addition & 1 deletion lib/tftLib/src/fonts/Garamond.h
Original file line number Diff line number Diff line change
Expand Up @@ -10837,7 +10837,7 @@ static const lv_font_fmt_txt_cmap_t cmaps_Garamond27[] = {{.range_start = 1,
.range_length = 1327,
.font_height = 27,
.line_height = 32,
.base_line = 3,
.base_line = 8,
.glyph_id_start = 1,
.unicode_list = NULL,
.glyph_id_ofs_list = NULL,
Expand Down
13 changes: 11 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// created: 10.Feb.2022
// updated: 25.Jul 2024
// updated: 28.Jul 2024

#pragma once
#pragma GCC optimize("Os") // optimize for code size
Expand Down Expand Up @@ -747,6 +747,11 @@ class textbox{
uint8_t m_fontSize = 0;
uint8_t m_h_align = TFT_ALIGN_RIGHT;
uint8_t m_v_align = TFT_ALIGN_TOP;
uint8_t m_l_margin = 0; // left margin
uint8_t m_r_margin = 0; // right margin
uint8_t m_t_margin = 0; // top margin
uint8_t m_b_margin = 0; // bottom margin
uint8_t m_d_margin = 0;
uint32_t m_bgColor = 0;
uint32_t m_fgColor = 0;
char* m_text = NULL;
Expand All @@ -772,6 +777,10 @@ class textbox{
m_y = y; // y pos
m_w = w; // width
m_h = h; // high
m_l_margin = 0;
m_r_margin = w / 100;
m_t_margin = 0;
m_b_margin = h / 50;
}
void show(){
m_enabled = true;
Expand Down Expand Up @@ -838,7 +847,7 @@ class textbox{
tft.setBackGoundColor(m_bgColor);
tft.fillRect(m_x, m_y, m_w, m_h, m_bgColor);
if(m_fontSize != 0){ tft.setFont(m_fontSize);}
tft.writeText(m_text, m_x, m_y, m_w, m_h, m_h_align, m_v_align, false, false, m_autoSize);
tft.writeText(m_text, m_x + m_l_margin, m_y + m_t_margin, m_w - m_r_margin, m_h - m_d_margin, m_h_align, m_v_align, false, false, m_autoSize);
tft.setTextColor(txtColor_tmp);
tft.setBackGoundColor(bgColor_tmp);
}
Expand Down
21 changes: 19 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
MiniWebRadio -- Webradio receiver for ESP32

first release on 03/2017 */String Version ="\
Version 3.3b Jul 27/2024 ";
Version 3.3c Jul 28/2024 ";

/* 2.8" color display (320x240px) with controller ILI9341 or HX8347D (SPI) or
3.5" color display (480x320px) with controller ILI9486 or ILI9488 (SPI)
Expand Down Expand Up @@ -2784,7 +2784,7 @@ void loop() {
{ SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "mute increment"); }
audioMute(false);
}
if(r.startsWith("s")) {
if(r.startsWith("rts")) {
char timeStatsBuffer[1024 * 2];
GetRunTimeStats(timeStatsBuffer);
{ SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "task statistics\n\n%s", timeStatsBuffer); }
Expand All @@ -2797,6 +2797,23 @@ void loop() {
if(audioSetTimeOffset(r.toInt())) { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "TimeOffset %li", r.toInt()); }
else { SerialPrintfln("Terminal : " ANSI_ESC_YELLOW "TimeOffset not possible"); }
}
if(r.startsWith("bfi")){ // buffer filled
SerialPrintfln("inBuffer : filled %lu bytes", (long unsigned)audioInbuffFilled());
SerialPrintfln("inBuffer : free %lu bytes", (long unsigned)audioInbuffFree());
}
if(r.startsWith("st")){ // testtext for streamtitle
if(r[2] == '0') strcpy(_streamTitle, "A B C D E F G H I");
if(r[2] == '1') strcpy(_streamTitle, "A B C D E F G H I");
if(r[2] == '2') strcpy(_streamTitle, "A B C D E F G H I J K L");
if(r[2] == '4') strcpy(_streamTitle, "A B C D E F G H I J K J M Q O");
if(r[2] == '5') strcpy(_streamTitle, "A B C D E F G H I K L J M y O P Q R");
if(r[2] == '6') strcpy(_streamTitle, "A B C D E F G H I K L J M g O P Q R S T V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q");
if(r[2] == '7') strcpy(_streamTitle, "A B C D E F G H I K L J M j O P Q R S T U V A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q");
if(r[2] == '8') strcpy(_streamTitle, "A B C D E F G H I K L J M p O P Q R S T U V W A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q");
if(r[2] == '9') strcpy(_streamTitle, "A B C D E F G H I K L J M p O P Q R S T U V W K J Q p O P Q R S T U V W K J Q");
log_i("st: %s", _streamTitle);
_f_newStreamTitle = true;
}
}
}

Expand Down

0 comments on commit ab3a071

Please sign in to comment.