mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
fix hires display - release
This commit is contained in:
@@ -808,6 +808,8 @@ static void grfa_handler(u8_t *data, int len) {
|
||||
artwork.y = htons(pkt->y);
|
||||
} else if (artwork.size) GDS_ClearWindow(display, artwork.x, artwork.y, -1, -1, GDS_COLOR_BLACK);
|
||||
|
||||
LOG_INFO("gfra en:%u x:%hu, y:%hu", artwork.enable, artwork.x, artwork.y);
|
||||
|
||||
// done in any case
|
||||
return;
|
||||
}
|
||||
@@ -1042,8 +1044,8 @@ static void visu_handler( u8_t *data, int len) {
|
||||
|
||||
// little trick to clean the taller screens when switching visu
|
||||
if (visu.row >= displayer.height) GDS_ClearExt(display, false, true, visu.col, visu.row, visu.col + visu.width - 1, visu.row + visu.height - 1);
|
||||
|
||||
if (visu.mode) {
|
||||
|
||||
if ((visu.mode = pkt->which) != 0) {
|
||||
// these will be overidden if necessary
|
||||
visu.col = visu.border = 0;
|
||||
visu.rotate = false;
|
||||
@@ -1065,13 +1067,27 @@ static void visu_handler( u8_t *data, int len) {
|
||||
bars = htonl(pkt->bars);
|
||||
visu.spectrum_scale = htonl(pkt->spectrum_scale) / 100.;
|
||||
} else {
|
||||
// full screen visu, try to use bottom screen if available
|
||||
// full screen visu, try to optimize orientation/shape
|
||||
visu.width = htonl(pkt->full.width);
|
||||
visu.height = GDS_GetHeight(display) > displayer.height ? GDS_GetHeight(display) - displayer.height : GDS_GetHeight(display);
|
||||
visu.row = GDS_GetHeight(display) - visu.height;
|
||||
visu.height = GDS_GetHeight(display);
|
||||
|
||||
// try to estimate if we should rotate visu
|
||||
if (visu.height > displayer.height && visu.height > 2*visu.width) visu.rotate = true;
|
||||
// do we have enough height to play with layout
|
||||
if (GDS_GetHeight(display) > displayer.height) {
|
||||
// by default, use up to the bottom of the display
|
||||
visu.height -= displayer.height;
|
||||
visu.row = displayer.height;
|
||||
|
||||
if (artwork.enable && artwork.y) {
|
||||
// server sets width to artwork X offset to tell us to rotate
|
||||
if (visu.width != artwork.x) {
|
||||
visu.height = artwork.y - displayer.height;
|
||||
if (visu.height <= 0) {
|
||||
visu.height = displayer.height;
|
||||
LOG_WARN("No room left for visualizer, disable it or increase artwork offset %d", artwork.y);
|
||||
}
|
||||
} else visu.rotate = true;
|
||||
}
|
||||
} else visu.row = 0;
|
||||
|
||||
// is this spectrum or analogue/digital
|
||||
if ((visu.mode & ~VISU_ESP32) == VISU_SPECTRUM) {
|
||||
@@ -1094,9 +1110,10 @@ static void visu_handler( u8_t *data, int len) {
|
||||
visu.style = htonl(pkt->classical_vu.style);
|
||||
if (visu.style) visu.row = visu.height - VU_HEIGHT;
|
||||
}
|
||||
if (bars > MAX_BARS) bars = MAX_BARS;
|
||||
}
|
||||
|
||||
if (bars > MAX_BARS) bars = MAX_BARS;
|
||||
|
||||
// for rotate, swap width & height
|
||||
if (visu.rotate) visu_fit(bars, visu.height, visu.width);
|
||||
else visu_fit(bars, visu.width, visu.height);
|
||||
|
||||
Reference in New Issue
Block a user