summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index b03bdb013d..efe9f5228a 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -968,10 +968,10 @@ static int parse_albumart_load(const char *wps_bufptr,
968 return skip_end_of_line(wps_bufptr); 968 return skip_end_of_line(wps_bufptr);
969 969
970 /* reset albumart info in wps */ 970 /* reset albumart info in wps */
971 aa->albumart_max_width = -1; 971 aa->width = -1;
972 aa->albumart_max_height = -1; 972 aa->height = -1;
973 aa->albumart_xalign = WPS_ALBUMART_ALIGN_CENTER; /* default */ 973 aa->xalign = WPS_ALBUMART_ALIGN_CENTER; /* default */
974 aa->albumart_yalign = WPS_ALBUMART_ALIGN_CENTER; /* default */ 974 aa->yalign = WPS_ALBUMART_ALIGN_CENTER; /* default */
975 aa->vp = &curr_vp->vp; 975 aa->vp = &curr_vp->vp;
976 976
977 /* format: %Cl|x|y|[[l|c|r]mwidth]|[[t|c|b]mheight]| */ 977 /* format: %Cl|x|y|[[l|c|r]mwidth]|[[t|c|b]mheight]| */
@@ -983,7 +983,7 @@ static int parse_albumart_load(const char *wps_bufptr,
983 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */ 983 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */
984 984
985 _pos = wps_bufptr + 1; 985 _pos = wps_bufptr + 1;
986 _pos = parse_list("dd", NULL, '|', _pos, &aa->albumart_x, &aa->albumart_y); 986 _pos = parse_list("dd", NULL, '|', _pos, &aa->x, &aa->y);
987 987
988 if (!_pos || _pos > newline || *_pos != '|') 988 if (!_pos || _pos > newline || *_pos != '|')
989 return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate 989 return WPS_ERROR_INVALID_PARAM; /* malformed token: no | after y coordinate
@@ -1000,16 +1000,16 @@ static int parse_albumart_load(const char *wps_bufptr,
1000 case 'l': 1000 case 'l':
1001 case 'L': 1001 case 'L':
1002 case '+': 1002 case '+':
1003 aa->albumart_xalign = WPS_ALBUMART_ALIGN_LEFT; 1003 aa->xalign = WPS_ALBUMART_ALIGN_LEFT;
1004 break; 1004 break;
1005 case 'c': 1005 case 'c':
1006 case 'C': 1006 case 'C':
1007 aa->albumart_xalign = WPS_ALBUMART_ALIGN_CENTER; 1007 aa->xalign = WPS_ALBUMART_ALIGN_CENTER;
1008 break; 1008 break;
1009 case 'r': 1009 case 'r':
1010 case 'R': 1010 case 'R':
1011 case '-': 1011 case '-':
1012 aa->albumart_xalign = WPS_ALBUMART_ALIGN_RIGHT; 1012 aa->xalign = WPS_ALBUMART_ALIGN_RIGHT;
1013 break; 1013 break;
1014 case 'd': 1014 case 'd':
1015 case 'D': 1015 case 'D':
@@ -1030,7 +1030,7 @@ static int parse_albumart_load(const char *wps_bufptr,
1030 if (!isdigit(*_pos)) /* malformed token: e.g. %Cl|7|59|# */ 1030 if (!isdigit(*_pos)) /* malformed token: e.g. %Cl|7|59|# */
1031 return WPS_ERROR_INVALID_PARAM; 1031 return WPS_ERROR_INVALID_PARAM;
1032 1032
1033 aa->albumart_max_width = atoi(_pos); 1033 aa->width = atoi(_pos);
1034 1034
1035 _pos = strchr(_pos, '|'); 1035 _pos = strchr(_pos, '|');
1036 if (!_pos || _pos > newline) 1036 if (!_pos || _pos > newline)
@@ -1049,16 +1049,16 @@ static int parse_albumart_load(const char *wps_bufptr,
1049 case 't': 1049 case 't':
1050 case 'T': 1050 case 'T':
1051 case '-': 1051 case '-':
1052 aa->albumart_yalign = WPS_ALBUMART_ALIGN_TOP; 1052 aa->yalign = WPS_ALBUMART_ALIGN_TOP;
1053 break; 1053 break;
1054 case 'c': 1054 case 'c':
1055 case 'C': 1055 case 'C':
1056 aa->albumart_yalign = WPS_ALBUMART_ALIGN_CENTER; 1056 aa->yalign = WPS_ALBUMART_ALIGN_CENTER;
1057 break; 1057 break;
1058 case 'b': 1058 case 'b':
1059 case 'B': 1059 case 'B':
1060 case '+': 1060 case '+':
1061 aa->albumart_yalign = WPS_ALBUMART_ALIGN_BOTTOM; 1061 aa->yalign = WPS_ALBUMART_ALIGN_BOTTOM;
1062 break; 1062 break;
1063 case 'd': 1063 case 'd':
1064 case 'D': 1064 case 'D':
@@ -1079,7 +1079,7 @@ static int parse_albumart_load(const char *wps_bufptr,
1079 if (!isdigit(*_pos)) 1079 if (!isdigit(*_pos))
1080 return WPS_ERROR_INVALID_PARAM; /* malformed token e.g. %Cl|7|59|200|@ */ 1080 return WPS_ERROR_INVALID_PARAM; /* malformed token e.g. %Cl|7|59|200|@ */
1081 1081
1082 aa->albumart_max_height = atoi(_pos); 1082 aa->height = atoi(_pos);
1083 1083
1084 _pos = strchr(_pos, '|'); 1084 _pos = strchr(_pos, '|');
1085 if (!_pos || _pos > newline) 1085 if (!_pos || _pos > newline)
@@ -1088,17 +1088,17 @@ static int parse_albumart_load(const char *wps_bufptr,
1088 } 1088 }
1089 1089
1090 /* if we got here, we parsed everything ok .. ! */ 1090 /* if we got here, we parsed everything ok .. ! */
1091 if (aa->albumart_max_width < 0) 1091 if (aa->width < 0)
1092 aa->albumart_max_width = 0; 1092 aa->width = 0;
1093 else if (aa->albumart_max_width > LCD_WIDTH) 1093 else if (aa->width > LCD_WIDTH)
1094 aa->albumart_max_width = LCD_WIDTH; 1094 aa->width = LCD_WIDTH;
1095 1095
1096 if (aa->albumart_max_height < 0) 1096 if (aa->height < 0)
1097 aa->albumart_max_height = 0; 1097 aa->height = 0;
1098 else if (aa->albumart_max_height > LCD_HEIGHT) 1098 else if (aa->height > LCD_HEIGHT)
1099 aa->albumart_max_height = LCD_HEIGHT; 1099 aa->height = LCD_HEIGHT;
1100 1100
1101 aa->wps_uses_albumart = WPS_ALBUMART_LOAD; 1101 aa->state = WPS_ALBUMART_LOAD;
1102 aa->draw = false; 1102 aa->draw = false;
1103 wps_data->albumart = aa; 1103 wps_data->albumart = aa;
1104 1104
@@ -1671,12 +1671,12 @@ bool skin_data_load(struct wps_data *wps_data,
1671 int status; 1671 int status;
1672 struct mp3entry *curtrack; 1672 struct mp3entry *curtrack;
1673 long offset; 1673 long offset;
1674 struct skin_albumart old_aa = {.wps_uses_albumart = WPS_ALBUMART_NONE}; 1674 struct skin_albumart old_aa = {.state = WPS_ALBUMART_NONE};
1675 if (wps_data->albumart) 1675 if (wps_data->albumart)
1676 { 1676 {
1677 old_aa.wps_uses_albumart = wps_data->albumart->wps_uses_albumart; 1677 old_aa.state = wps_data->albumart->state;
1678 old_aa.albumart_max_height = wps_data->albumart->albumart_max_height; 1678 old_aa.height = wps_data->albumart->height;
1679 old_aa.albumart_max_width = wps_data->albumart->albumart_max_width; 1679 old_aa.width = wps_data->albumart->width;
1680 } 1680 }
1681#endif 1681#endif
1682 1682
@@ -1796,10 +1796,10 @@ bool skin_data_load(struct wps_data *wps_data,
1796 if (status & AUDIO_STATUS_PLAY) 1796 if (status & AUDIO_STATUS_PLAY)
1797 { 1797 {
1798 struct skin_albumart *aa = wps_data->albumart; 1798 struct skin_albumart *aa = wps_data->albumart;
1799 if (aa && ((aa->wps_uses_albumart && !old_aa.wps_uses_albumart) || 1799 if (aa && ((aa->state && !old_aa.state) ||
1800 (aa->wps_uses_albumart && 1800 (aa->state &&
1801 (((old_aa.albumart_max_height != aa->albumart_max_height) || 1801 (((old_aa.height != aa->height) ||
1802 (old_aa.albumart_max_width != aa->albumart_max_width)))))) 1802 (old_aa.width != aa->width))))))
1803 { 1803 {
1804 curtrack = audio_current_track(); 1804 curtrack = audio_current_track();
1805 offset = curtrack->offset; 1805 offset = curtrack->offset;