summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-06-16 20:33:30 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-06-16 20:33:30 +0000
commit9a550524af741e247805801754116e0bb2cba7ba (patch)
tree2a7700e55bc803ca5121f66b2f90228eb841ad73
parente097b5fd62bcbd4469ee31544c77bab4902cbe05 (diff)
downloadrockbox-9a550524af741e247805801754116e0bb2cba7ba.tar.gz
rockbox-9a550524af741e247805801754116e0bb2cba7ba.zip
Make RTC tags display hyphens instead of nothing on non-rtc targets. This makes WPSs that use RTC tags look decent again with the new separated RTC tag style
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13639 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c26
-rw-r--r--apps/gui/gwps.h2
-rw-r--r--apps/gui/wps_debug.c2
-rw-r--r--apps/gui/wps_parser.c42
4 files changed, 49 insertions, 23 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 2e8f7841c0..a66c1aa4b5 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1162,6 +1162,32 @@ static char *get_token_value(struct gui_wps *gwps,
1162 *intval = tm->tm_wday + 1; 1162 *intval = tm->tm_wday + 1;
1163 snprintf(buf, buf_size, "%1d", tm->tm_wday); 1163 snprintf(buf, buf_size, "%1d", tm->tm_wday);
1164 return buf; 1164 return buf;
1165#else
1166 case WPS_TOKEN_RTC_DAY_OF_MONTH:
1167 case WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED:
1168 case WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED:
1169 case WPS_TOKEN_RTC_HOUR_24:
1170 case WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED:
1171 case WPS_TOKEN_RTC_HOUR_12:
1172 case WPS_TOKEN_RTC_MONTH:
1173 case WPS_TOKEN_RTC_MINUTE:
1174 case WPS_TOKEN_RTC_SECOND:
1175 case WPS_TOKEN_RTC_AM_PM_UPPER:
1176 case WPS_TOKEN_RTC_AM_PM_LOWER:
1177 case WPS_TOKEN_RTC_YEAR_2_DIGITS:
1178 strncpy(buf, "--", buf_size);
1179 return buf;
1180 case WPS_TOKEN_RTC_YEAR_4_DIGITS:
1181 strncpy(buf, "----", buf_size);
1182 return buf;
1183 case WPS_TOKEN_RTC_WEEKDAY_NAME:
1184 case WPS_TOKEN_RTC_MONTH_NAME:
1185 strncpy(buf, "---", buf_size);
1186 return buf;
1187 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON:
1188 case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN:
1189 strncpy(buf, "-", buf_size);
1190 return buf;
1165#endif 1191#endif
1166 1192
1167#ifdef HAVE_LCD_CHARCELLS 1193#ifdef HAVE_LCD_CHARCELLS
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 26a800cbbd..cafcf135bc 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -128,7 +128,6 @@ enum wps_token_type {
128 WPS_TOKEN_CROSSFADE, 128 WPS_TOKEN_CROSSFADE,
129#endif 129#endif
130 130
131#if CONFIG_RTC
132 /* Time */ 131 /* Time */
133 132
134 /* The begin/end values allow us to know if a token is an RTC one. 133 /* The begin/end values allow us to know if a token is an RTC one.
@@ -155,7 +154,6 @@ enum wps_token_type {
155 WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN, 154 WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN,
156 155
157 WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */ 156 WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */
158#endif
159 157
160 /* Conditional */ 158 /* Conditional */
161 WPS_TOKEN_CONDITIONAL, 159 WPS_TOKEN_CONDITIONAL,
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c
index ae542785ae..935384faba 100644
--- a/apps/gui/wps_debug.c
+++ b/apps/gui/wps_debug.c
@@ -148,7 +148,6 @@ static void dump_wps_tokens(struct wps_data *data)
148 snprintf(buf, sizeof(buf), "mode playback"); 148 snprintf(buf, sizeof(buf), "mode playback");
149 break; 149 break;
150 150
151#if CONFIG_RTC
152 case WPS_TOKEN_RTC_DAY_OF_MONTH: 151 case WPS_TOKEN_RTC_DAY_OF_MONTH:
153 snprintf(buf, sizeof(buf), "rtc: day of month (01..31)"); 152 snprintf(buf, sizeof(buf), "rtc: day of month (01..31)");
154 break; 153 break;
@@ -208,7 +207,6 @@ static void dump_wps_tokens(struct wps_data *data)
208 snprintf(buf, sizeof(buf), 207 snprintf(buf, sizeof(buf),
209 "rtc: day of week (0..6); 0 is Sunday"); 208 "rtc: day of week (0..6); 0 is Sunday");
210 break; 209 break;
211#endif
212 210
213#if (CONFIG_CODEC == SWCODEC) 211#if (CONFIG_CODEC == SWCODEC)
214 case WPS_TOKEN_CROSSFADE: 212 case WPS_TOKEN_CROSSFADE:
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 6b1f666474..cb930bc74c 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -126,6 +126,12 @@ static int parse_image_load(const char *wps_bufptr,
126 struct wps_token *token, struct wps_data *wps_data); 126 struct wps_token *token, struct wps_data *wps_data);
127#endif /*HAVE_LCD_BITMAP */ 127#endif /*HAVE_LCD_BITMAP */
128 128
129#ifdef CONFIG_RTC
130#define WPS_RTC_REFRESH WPS_REFRESH_DYNAMIC
131#else
132#define WPS_RTC_REFRESH WPS_REFRESH_STATIC
133#endif
134
129/* array of available tags - those with more characters have to go first 135/* array of available tags - those with more characters have to go first
130 (e.g. "xl" and "xd" before "x"). It needs to end with the unknown token. */ 136 (e.g. "xl" and "xd" before "x"). It needs to end with the unknown token. */
131static const struct wps_tag all_tags[] = { 137static const struct wps_tag all_tags[] = {
@@ -145,25 +151,23 @@ static const struct wps_tag all_tags[] = {
145 { WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL }, 151 { WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL },
146#endif 152#endif
147 153
148#if CONFIG_RTC 154 { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL },
149 { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_REFRESH_DYNAMIC, NULL }, 155 { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL },
150 { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_REFRESH_DYNAMIC, NULL }, 156 { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL },
151 { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_REFRESH_DYNAMIC, NULL }, 157 { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL },
152 { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_REFRESH_DYNAMIC, NULL }, 158 { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL },
153 { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_REFRESH_DYNAMIC, NULL }, 159 { WPS_TOKEN_RTC_HOUR_12, "cl", WPS_RTC_REFRESH, NULL },
154 { WPS_TOKEN_RTC_HOUR_12, "cl", WPS_REFRESH_DYNAMIC, NULL }, 160 { WPS_TOKEN_RTC_MONTH, "cm", WPS_RTC_REFRESH, NULL },
155 { WPS_TOKEN_RTC_MONTH, "cm", WPS_REFRESH_DYNAMIC, NULL }, 161 { WPS_TOKEN_RTC_MINUTE, "cM", WPS_RTC_REFRESH, NULL },
156 { WPS_TOKEN_RTC_MINUTE, "cM", WPS_REFRESH_DYNAMIC, NULL }, 162 { WPS_TOKEN_RTC_SECOND, "cS", WPS_RTC_REFRESH, NULL },
157 { WPS_TOKEN_RTC_SECOND, "cS", WPS_REFRESH_DYNAMIC, NULL }, 163 { WPS_TOKEN_RTC_YEAR_2_DIGITS, "cy", WPS_RTC_REFRESH, NULL },
158 { WPS_TOKEN_RTC_YEAR_2_DIGITS, "cy", WPS_REFRESH_DYNAMIC, NULL }, 164 { WPS_TOKEN_RTC_YEAR_4_DIGITS, "cY", WPS_RTC_REFRESH, NULL },
159 { WPS_TOKEN_RTC_YEAR_4_DIGITS, "cY", WPS_REFRESH_DYNAMIC, NULL }, 165 { WPS_TOKEN_RTC_AM_PM_UPPER, "cP", WPS_RTC_REFRESH, NULL },
160 { WPS_TOKEN_RTC_AM_PM_UPPER, "cP", WPS_REFRESH_DYNAMIC, NULL }, 166 { WPS_TOKEN_RTC_AM_PM_LOWER, "cp", WPS_RTC_REFRESH, NULL },
161 { WPS_TOKEN_RTC_AM_PM_LOWER, "cp", WPS_REFRESH_DYNAMIC, NULL }, 167 { WPS_TOKEN_RTC_WEEKDAY_NAME, "ca", WPS_RTC_REFRESH, NULL },
162 { WPS_TOKEN_RTC_WEEKDAY_NAME, "ca", WPS_REFRESH_DYNAMIC, NULL }, 168 { WPS_TOKEN_RTC_MONTH_NAME, "cb", WPS_RTC_REFRESH, NULL },
163 { WPS_TOKEN_RTC_MONTH_NAME, "cb", WPS_REFRESH_DYNAMIC, NULL }, 169 { WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON, "cu", WPS_RTC_REFRESH, NULL },
164 { WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON, "cu", WPS_REFRESH_DYNAMIC, NULL }, 170 { WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN, "cw", WPS_RTC_REFRESH, NULL },
165 { WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN, "cw", WPS_REFRESH_DYNAMIC, NULL },
166#endif
167 171
168 /* current file */ 172 /* current file */
169 { WPS_TOKEN_FILE_BITRATE, "fb", WPS_REFRESH_STATIC, NULL }, 173 { WPS_TOKEN_FILE_BITRATE, "fb", WPS_REFRESH_STATIC, NULL },