diff options
Diffstat (limited to 'apps/gui/wps_debug.c')
-rw-r--r-- | apps/gui/wps_debug.c | 232 |
1 files changed, 113 insertions, 119 deletions
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index bcb05e0902..0e2b151551 100644 --- a/apps/gui/wps_debug.c +++ b/apps/gui/wps_debug.c | |||
@@ -24,107 +24,122 @@ | |||
24 | #include "gwps.h" | 24 | #include "gwps.h" |
25 | #include "debug.h" | 25 | #include "debug.h" |
26 | 26 | ||
27 | static char *next_str(bool next) { | ||
28 | return next ? "next" : ""; | ||
29 | } | ||
30 | |||
27 | void dump_wps_tokens(struct wps_data *data) | 31 | void dump_wps_tokens(struct wps_data *data) |
28 | { | 32 | { |
33 | struct wps_token *token; | ||
29 | int i, j; | 34 | int i, j; |
30 | int indent = 0; | 35 | int indent = 0; |
31 | char buf[64]; | 36 | char buf[64]; |
32 | bool next; | 37 | bool next; |
33 | 38 | ||
34 | /* Dump parsed WPS */ | 39 | if (data->num_tokens > WPS_MAX_TOKENS) { |
35 | for(i = 0; i < data->num_tokens && i < WPS_MAX_TOKENS; i++) { | 40 | DEBUGF("Number of tokens is too high (%d)!!!\n", data->num_tokens); |
41 | return; | ||
42 | } | ||
36 | 43 | ||
37 | next = data->tokens[i].next; | 44 | /* Dump parsed WPS */ |
45 | for (i = 0, token = data->tokens; i < data->num_tokens; i++, token++) { | ||
46 | next = token->next; | ||
38 | 47 | ||
39 | switch(data->tokens[i].type) { | 48 | switch(token->type) { |
40 | case WPS_TOKEN_UNKNOWN: | 49 | case WPS_TOKEN_UNKNOWN: |
41 | snprintf(buf, sizeof(buf), "Unknown token"); | 50 | snprintf(buf, sizeof(buf), "Unknown token"); |
42 | break; | 51 | break; |
43 | case WPS_TOKEN_CHARACTER: | 52 | case WPS_TOKEN_CHARACTER: |
44 | snprintf(buf, sizeof(buf), "Character '%c'", | 53 | snprintf(buf, sizeof(buf), "Character '%c'", |
45 | data->tokens[i].value.c); | 54 | token->value.c); |
46 | break; | 55 | break; |
47 | 56 | ||
48 | case WPS_TOKEN_STRING: | 57 | case WPS_TOKEN_STRING: |
49 | snprintf(buf, sizeof(buf), "String '%s'", | 58 | snprintf(buf, sizeof(buf), "String '%s'", |
50 | data->strings[data->tokens[i].value.i]); | 59 | data->strings[token->value.i]); |
51 | break; | ||
52 | |||
53 | case WPS_TOKEN_EOL: | ||
54 | snprintf(buf, sizeof(buf), "%s", "EOL"); | ||
55 | break; | 60 | break; |
56 | 61 | ||
57 | #ifdef HAVE_LCD_BITMAP | 62 | #ifdef HAVE_LCD_BITMAP |
58 | case WPS_TOKEN_ALIGN_LEFT: | 63 | case WPS_TOKEN_ALIGN_LEFT: |
59 | snprintf(buf, sizeof(buf), "%s", "align left"); | 64 | snprintf(buf, sizeof(buf), "align left"); |
60 | break; | 65 | break; |
61 | 66 | ||
62 | case WPS_TOKEN_ALIGN_CENTER: | 67 | case WPS_TOKEN_ALIGN_CENTER: |
63 | snprintf(buf, sizeof(buf), "%s", "align center"); | 68 | snprintf(buf, sizeof(buf), "align center"); |
64 | break; | 69 | break; |
65 | 70 | ||
66 | case WPS_TOKEN_ALIGN_RIGHT: | 71 | case WPS_TOKEN_ALIGN_RIGHT: |
67 | snprintf(buf, sizeof(buf), "%s", "align right"); | 72 | snprintf(buf, sizeof(buf), "align right"); |
68 | break; | 73 | break; |
69 | #endif | 74 | #endif |
70 | 75 | ||
76 | case WPS_TOKEN_SUBLINE_TIMEOUT: | ||
77 | snprintf(buf, sizeof(buf), "subline timeout value: %d", | ||
78 | token->value.i); | ||
79 | break; | ||
80 | |||
71 | case WPS_TOKEN_CONDITIONAL: | 81 | case WPS_TOKEN_CONDITIONAL: |
72 | snprintf(buf, sizeof(buf), "%s, %d options", "conditional", | 82 | snprintf(buf, sizeof(buf), "conditional, %d options", |
73 | data->tokens[i].value.i); | 83 | token->value.i); |
74 | break; | 84 | break; |
75 | 85 | ||
76 | case WPS_TOKEN_CONDITIONAL_START: | 86 | case WPS_TOKEN_CONDITIONAL_START: |
77 | snprintf(buf, sizeof(buf), "%s, next cond: %d", | 87 | snprintf(buf, sizeof(buf), "conditional start, next cond: %d", |
78 | "conditional start", data->tokens[i].value.i); | 88 | token->value.i); |
79 | indent++; | 89 | indent++; |
80 | break; | 90 | break; |
81 | 91 | ||
82 | case WPS_TOKEN_CONDITIONAL_OPTION: | 92 | case WPS_TOKEN_CONDITIONAL_OPTION: |
83 | snprintf(buf, sizeof(buf), "%s, next cond: %d", | 93 | snprintf(buf, sizeof(buf), "conditional option, next cond: %d", |
84 | "conditional option", data->tokens[i].value.i); | 94 | token->value.i); |
85 | break; | 95 | break; |
86 | 96 | ||
87 | case WPS_TOKEN_CONDITIONAL_END: | 97 | case WPS_TOKEN_CONDITIONAL_END: |
88 | snprintf(buf, sizeof(buf), "%s", "conditional end"); | 98 | snprintf(buf, sizeof(buf), "conditional end"); |
89 | indent--; | 99 | indent--; |
90 | break; | 100 | break; |
91 | 101 | ||
92 | #ifdef HAVE_LCD_BITMAP | 102 | #ifdef HAVE_LCD_BITMAP |
93 | case WPS_TOKEN_IMAGE_PRELOAD: | 103 | case WPS_TOKEN_IMAGE_PRELOAD: |
94 | snprintf(buf, sizeof(buf), "%s", "preload image"); | 104 | snprintf(buf, sizeof(buf), "preload image"); |
95 | break; | 105 | break; |
96 | 106 | ||
97 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: | 107 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: |
98 | snprintf(buf, sizeof(buf), "%s %d", "display preloaded image", | 108 | snprintf(buf, sizeof(buf), "display preloaded image %d", |
99 | data->tokens[i].value.i); | 109 | token->value.i); |
100 | break; | 110 | break; |
101 | 111 | ||
102 | case WPS_TOKEN_IMAGE_DISPLAY: | 112 | case WPS_TOKEN_IMAGE_DISPLAY: |
103 | snprintf(buf, sizeof(buf), "%s", "display image"); | 113 | snprintf(buf, sizeof(buf), "display image"); |
104 | break; | 114 | break; |
105 | #endif | 115 | #endif |
106 | 116 | ||
107 | #ifdef HAS_BUTTON_HOLD | 117 | #ifdef HAS_BUTTON_HOLD |
108 | case WPS_TOKEN_MAIN_HOLD: | 118 | case WPS_TOKEN_MAIN_HOLD: |
109 | snprintf(buf, sizeof(buf), "%s", "mode hold"); | 119 | snprintf(buf, sizeof(buf), "mode hold"); |
110 | break; | 120 | break; |
111 | #endif | 121 | #endif |
112 | 122 | ||
113 | #ifdef HAS_REMOTE_BUTTON_HOLD | 123 | #ifdef HAS_REMOTE_BUTTON_HOLD |
114 | case WPS_TOKEN_REMOTE_HOLD: | 124 | case WPS_TOKEN_REMOTE_HOLD: |
115 | snprintf(buf, sizeof(buf), "%s", "mode remote hold"); | 125 | snprintf(buf, sizeof(buf), "mode remote hold"); |
116 | break; | 126 | break; |
117 | #endif | 127 | #endif |
118 | 128 | ||
119 | case WPS_TOKEN_REPEAT_MODE: | 129 | case WPS_TOKEN_REPEAT_MODE: |
120 | snprintf(buf, sizeof(buf), "%s", "mode repeat"); | 130 | snprintf(buf, sizeof(buf), "mode repeat"); |
121 | break; | 131 | break; |
122 | 132 | ||
123 | case WPS_TOKEN_PLAYBACK_STATUS: | 133 | case WPS_TOKEN_PLAYBACK_STATUS: |
124 | snprintf(buf, sizeof(buf), "%s", "mode playback"); | 134 | snprintf(buf, sizeof(buf), "mode playback"); |
125 | break; | 135 | break; |
126 | 136 | ||
127 | #if CONFIG_RTC | 137 | #if CONFIG_RTC |
138 | case WPS_TOKEN_RTC: | ||
139 | snprintf(buf, sizeof(buf), "real-time clock", | ||
140 | token->value.c); | ||
141 | break; | ||
142 | |||
128 | case WPS_TOKEN_RTC_DAY_OF_MONTH: | 143 | case WPS_TOKEN_RTC_DAY_OF_MONTH: |
129 | case WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: | 144 | case WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: |
130 | case WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: | 145 | case WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: |
@@ -142,199 +157,159 @@ void dump_wps_tokens(struct wps_data *data) | |||
142 | case WPS_TOKEN_RTC_MONTH_NAME: | 157 | case WPS_TOKEN_RTC_MONTH_NAME: |
143 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON: | 158 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON: |
144 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN: | 159 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN: |
145 | case WPS_TOKEN_RTC: | 160 | snprintf(buf, sizeof(buf), "real-time clock tag: %c", |
146 | snprintf(buf, sizeof(buf), "%s %c", "real-time clock tag:", | 161 | token->value.c); |
147 | data->tokens[i].value.c); | ||
148 | break; | 162 | break; |
149 | #endif | 163 | #endif |
150 | 164 | ||
151 | #ifdef HAVE_LCD_BITMAP | 165 | #ifdef HAVE_LCD_BITMAP |
152 | case WPS_TOKEN_IMAGE_BACKDROP: | 166 | case WPS_TOKEN_IMAGE_BACKDROP: |
153 | snprintf(buf, sizeof(buf), "%s", "backdrop image"); | 167 | snprintf(buf, sizeof(buf), "backdrop image"); |
154 | break; | 168 | break; |
155 | 169 | ||
156 | case WPS_TOKEN_IMAGE_PROGRESS_BAR: | 170 | case WPS_TOKEN_IMAGE_PROGRESS_BAR: |
157 | snprintf(buf, sizeof(buf), "%s", "progressbar bitmap"); | 171 | snprintf(buf, sizeof(buf), "progressbar bitmap"); |
158 | break; | ||
159 | |||
160 | |||
161 | case WPS_TOKEN_STATUSBAR_ENABLED: | ||
162 | snprintf(buf, sizeof(buf), "%s", "statusbar enable"); | ||
163 | break; | ||
164 | |||
165 | case WPS_TOKEN_STATUSBAR_DISABLED: | ||
166 | snprintf(buf, sizeof(buf), "%s", "statusbar disable"); | ||
167 | break; | 172 | break; |
168 | 173 | ||
169 | case WPS_TOKEN_PEAKMETER: | 174 | case WPS_TOKEN_PEAKMETER: |
170 | snprintf(buf, sizeof(buf), "%s", "peakmeter"); | 175 | snprintf(buf, sizeof(buf), "peakmeter"); |
171 | break; | 176 | break; |
172 | #endif | 177 | #endif |
173 | 178 | ||
174 | case WPS_TOKEN_PROGRESSBAR: | 179 | case WPS_TOKEN_PROGRESSBAR: |
175 | snprintf(buf, sizeof(buf), "%s", "progressbar"); | 180 | snprintf(buf, sizeof(buf), "progressbar"); |
176 | break; | 181 | break; |
177 | 182 | ||
178 | #ifdef HAVE_LCD_CHARCELLS | 183 | #ifdef HAVE_LCD_CHARCELLS |
179 | case WPS_TOKEN_PLAYER_PROGRESSBAR: | 184 | case WPS_TOKEN_PLAYER_PROGRESSBAR: |
180 | snprintf(buf, sizeof(buf), "%s", "full line progressbar"); | 185 | snprintf(buf, sizeof(buf), "full line progressbar"); |
181 | break; | 186 | break; |
182 | #endif | 187 | #endif |
183 | 188 | ||
184 | case WPS_TOKEN_TRACK_TIME_ELAPSED: | 189 | case WPS_TOKEN_TRACK_TIME_ELAPSED: |
185 | snprintf(buf, sizeof(buf), "%s", "time elapsed in track"); | 190 | snprintf(buf, sizeof(buf), "time elapsed in track"); |
186 | break; | 191 | break; |
187 | 192 | ||
188 | case WPS_TOKEN_PLAYLIST_ENTRIES: | 193 | case WPS_TOKEN_PLAYLIST_ENTRIES: |
189 | snprintf(buf, sizeof(buf), "%s", "number of entries in playlist"); | 194 | snprintf(buf, sizeof(buf), "number of entries in playlist"); |
190 | break; | 195 | break; |
191 | 196 | ||
192 | case WPS_TOKEN_PLAYLIST_NAME: | 197 | case WPS_TOKEN_PLAYLIST_NAME: |
193 | snprintf(buf, sizeof(buf), "%s", "playlist name"); | 198 | snprintf(buf, sizeof(buf), "playlist name"); |
194 | break; | 199 | break; |
195 | 200 | ||
196 | case WPS_TOKEN_PLAYLIST_POSITION: | 201 | case WPS_TOKEN_PLAYLIST_POSITION: |
197 | snprintf(buf, sizeof(buf), "%s", "position in playlist"); | 202 | snprintf(buf, sizeof(buf), "position in playlist"); |
198 | break; | 203 | break; |
199 | 204 | ||
200 | case WPS_TOKEN_TRACK_TIME_REMAINING: | 205 | case WPS_TOKEN_TRACK_TIME_REMAINING: |
201 | snprintf(buf, sizeof(buf), "%s", "time remaining in track"); | 206 | snprintf(buf, sizeof(buf), "time remaining in track"); |
202 | break; | 207 | break; |
203 | 208 | ||
204 | case WPS_TOKEN_PLAYLIST_SHUFFLE: | 209 | case WPS_TOKEN_PLAYLIST_SHUFFLE: |
205 | snprintf(buf, sizeof(buf), "%s", "playlist shuffle mode"); | 210 | snprintf(buf, sizeof(buf), "playlist shuffle mode"); |
206 | break; | 211 | break; |
207 | 212 | ||
208 | case WPS_TOKEN_TRACK_LENGTH: | 213 | case WPS_TOKEN_TRACK_LENGTH: |
209 | snprintf(buf, sizeof(buf), "%s", "track length"); | 214 | snprintf(buf, sizeof(buf), "track length"); |
210 | break; | 215 | break; |
211 | 216 | ||
212 | case WPS_TOKEN_VOLUME: | 217 | case WPS_TOKEN_VOLUME: |
213 | snprintf(buf, sizeof(buf), "%s", "volume"); | 218 | snprintf(buf, sizeof(buf), "volume"); |
214 | break; | 219 | break; |
215 | 220 | ||
216 | case WPS_TOKEN_METADATA_ARTIST: | 221 | case WPS_TOKEN_METADATA_ARTIST: |
217 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 222 | snprintf(buf, sizeof(buf), "%strack artist", next_str(next)); |
218 | "track artist"); | ||
219 | break; | 223 | break; |
220 | 224 | ||
221 | case WPS_TOKEN_METADATA_COMPOSER: | 225 | case WPS_TOKEN_METADATA_COMPOSER: |
222 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 226 | snprintf(buf, sizeof(buf), "%strack composer", next_str(next)); |
223 | "track composer"); | ||
224 | break; | 227 | break; |
225 | 228 | ||
226 | case WPS_TOKEN_METADATA_ALBUM: | 229 | case WPS_TOKEN_METADATA_ALBUM: |
227 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 230 | snprintf(buf, sizeof(buf), "%strack album", next_str(next)); |
228 | "track album"); | ||
229 | break; | 231 | break; |
230 | 232 | ||
231 | case WPS_TOKEN_METADATA_GENRE: | 233 | case WPS_TOKEN_METADATA_GENRE: |
232 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 234 | snprintf(buf, sizeof(buf), "%strack genre", next_str(next)); |
233 | "track genre"); | ||
234 | break; | 235 | break; |
235 | 236 | ||
236 | case WPS_TOKEN_METADATA_TRACK_NUMBER: | 237 | case WPS_TOKEN_METADATA_TRACK_NUMBER: |
237 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 238 | snprintf(buf, sizeof(buf), "%strack number", next_str(next)); |
238 | "track number"); | ||
239 | break; | 239 | break; |
240 | 240 | ||
241 | case WPS_TOKEN_METADATA_TRACK_TITLE: | 241 | case WPS_TOKEN_METADATA_TRACK_TITLE: |
242 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 242 | snprintf(buf, sizeof(buf), "%strack title", next_str(next)); |
243 | "track title"); | ||
244 | break; | 243 | break; |
245 | 244 | ||
246 | case WPS_TOKEN_METADATA_VERSION: | 245 | case WPS_TOKEN_METADATA_VERSION: |
247 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 246 | snprintf(buf, sizeof(buf), "%strack ID3 version", next_str(next)); |
248 | "track ID3 version"); | ||
249 | break; | 247 | break; |
250 | 248 | ||
251 | case WPS_TOKEN_METADATA_YEAR: | 249 | case WPS_TOKEN_METADATA_YEAR: |
252 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 250 | snprintf(buf, sizeof(buf), "%strack year", next_str(next)); |
253 | "track year"); | ||
254 | break; | 251 | break; |
255 | 252 | ||
256 | case WPS_TOKEN_BATTERY_PERCENT: | 253 | case WPS_TOKEN_BATTERY_PERCENT: |
257 | snprintf(buf, sizeof(buf), "%s", "battery percentage"); | 254 | snprintf(buf, sizeof(buf), "battery percentage"); |
258 | break; | 255 | break; |
259 | 256 | ||
260 | case WPS_TOKEN_BATTERY_VOLTS: | 257 | case WPS_TOKEN_BATTERY_VOLTS: |
261 | snprintf(buf, sizeof(buf), "%s", "battery voltage"); | 258 | snprintf(buf, sizeof(buf), "battery voltage"); |
262 | break; | 259 | break; |
263 | 260 | ||
264 | case WPS_TOKEN_BATTERY_TIME: | 261 | case WPS_TOKEN_BATTERY_TIME: |
265 | snprintf(buf, sizeof(buf), "%s", "battery time left"); | 262 | snprintf(buf, sizeof(buf), "battery time left"); |
266 | break; | 263 | break; |
267 | 264 | ||
268 | case WPS_TOKEN_BATTERY_CHARGER_CONNECTED: | 265 | case WPS_TOKEN_BATTERY_CHARGER_CONNECTED: |
269 | snprintf(buf, sizeof(buf), "%s", "battery charger connected"); | 266 | snprintf(buf, sizeof(buf), "battery charger connected"); |
270 | break; | 267 | break; |
271 | 268 | ||
272 | case WPS_TOKEN_BATTERY_CHARGING: | 269 | case WPS_TOKEN_BATTERY_CHARGING: |
273 | snprintf(buf, sizeof(buf), "%s", "battery charging"); | 270 | snprintf(buf, sizeof(buf), "battery charging"); |
274 | break; | 271 | break; |
275 | 272 | ||
276 | case WPS_TOKEN_FILE_BITRATE: | 273 | case WPS_TOKEN_FILE_BITRATE: |
277 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 274 | snprintf(buf, sizeof(buf), "%sfile bitrate", next_str(next)); |
278 | "file bitrate"); | ||
279 | break; | 275 | break; |
280 | 276 | ||
281 | case WPS_TOKEN_FILE_CODEC: | 277 | case WPS_TOKEN_FILE_CODEC: |
282 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 278 | snprintf(buf, sizeof(buf), "%sfile codec", next_str(next)); |
283 | "file codec"); | ||
284 | break; | 279 | break; |
285 | 280 | ||
286 | case WPS_TOKEN_FILE_FREQUENCY: | 281 | case WPS_TOKEN_FILE_FREQUENCY: |
287 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 282 | snprintf(buf, sizeof(buf), "%sfile audio frequency", next_str(next)); |
288 | "file audio frequency"); | ||
289 | break; | 283 | break; |
290 | 284 | ||
291 | case WPS_TOKEN_FILE_NAME: | 285 | case WPS_TOKEN_FILE_NAME: |
292 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 286 | snprintf(buf, sizeof(buf), "%sfile name", next_str(next)); |
293 | "file name"); | ||
294 | break; | 287 | break; |
295 | 288 | ||
296 | case WPS_TOKEN_FILE_NAME_WITH_EXTENSION: | 289 | case WPS_TOKEN_FILE_NAME_WITH_EXTENSION: |
297 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 290 | snprintf(buf, sizeof(buf), "%sfile name with extension", next_str(next)); |
298 | "file name with extension"); | ||
299 | break; | 291 | break; |
300 | 292 | ||
301 | case WPS_TOKEN_FILE_PATH: | 293 | case WPS_TOKEN_FILE_PATH: |
302 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 294 | snprintf(buf, sizeof(buf), "%sfile path", next_str(next)); |
303 | "file path"); | ||
304 | break; | 295 | break; |
305 | 296 | ||
306 | case WPS_TOKEN_FILE_SIZE: | 297 | case WPS_TOKEN_FILE_SIZE: |
307 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 298 | snprintf(buf, sizeof(buf), "%sfile size", next_str(next)); |
308 | "file size"); | ||
309 | break; | 299 | break; |
310 | 300 | ||
311 | case WPS_TOKEN_FILE_VBR: | 301 | case WPS_TOKEN_FILE_VBR: |
312 | snprintf(buf, sizeof(buf), "%s%s", next ? "next " : "", | 302 | snprintf(buf, sizeof(buf), "%sfile is vbr", next_str(next)); |
313 | "file is vbr"); | ||
314 | break; | 303 | break; |
315 | 304 | ||
316 | case WPS_TOKEN_FILE_DIRECTORY: | 305 | case WPS_TOKEN_FILE_DIRECTORY: |
317 | snprintf(buf, sizeof(buf), "%s%s: %d", next ? "next " : "", | 306 | snprintf(buf, sizeof(buf), "%sfile directory, level: %d", next_str(next), |
318 | "file directory, level", | 307 | token->value.i); |
319 | data->tokens[i].value.i); | ||
320 | break; | ||
321 | |||
322 | case WPS_TOKEN_SCROLL: | ||
323 | snprintf(buf, sizeof(buf), "%s", "scrolling line"); | ||
324 | break; | ||
325 | |||
326 | case WPS_TOKEN_SUBLINE_TIMEOUT: | ||
327 | snprintf(buf, sizeof(buf), "%s: %d", "subline timeout value", | ||
328 | data->tokens[i].value.i); | ||
329 | break; | ||
330 | |||
331 | case WPS_TOKEN_SUBLINE_SEPARATOR: | ||
332 | snprintf(buf, sizeof(buf), "%s", "subline separator"); | ||
333 | break; | 308 | break; |
334 | 309 | ||
335 | default: | 310 | default: |
336 | snprintf(buf, sizeof(buf), "%s (code: %d)", "FIXME", | 311 | snprintf(buf, sizeof(buf), "FIXME (code: %d)", |
337 | data->tokens[i].type); | 312 | token->type); |
338 | break; | 313 | break; |
339 | } | 314 | } |
340 | 315 | ||
@@ -342,24 +317,43 @@ void dump_wps_tokens(struct wps_data *data) | |||
342 | DEBUGF("\t"); | 317 | DEBUGF("\t"); |
343 | } | 318 | } |
344 | 319 | ||
345 | DEBUGF("[%03d] = %s\n", i, buf); | 320 | DEBUGF("[%3d] = (%2d) %s\n", i, token->type, buf); |
346 | } | 321 | } |
347 | DEBUGF("\n"); | 322 | DEBUGF("\n"); |
348 | } | 323 | } |
349 | 324 | ||
350 | void print_line_info(struct wps_data *data) | 325 | void print_line_info(struct wps_data *data) |
351 | { | 326 | { |
352 | int line, subline; | 327 | int i, j; |
328 | struct wps_line *line; | ||
329 | struct wps_subline *subline; | ||
353 | 330 | ||
354 | DEBUGF("line/subline start indexes :\n"); | 331 | DEBUGF("Number of lines : %d\n", data->num_lines); |
355 | for (line = 0; line < data->num_lines; line++) | 332 | DEBUGF("Number of sublines: %d\n", data->num_sublines); |
333 | DEBUGF("Number of tokens : %d\n", data->num_tokens); | ||
334 | DEBUGF("\n"); | ||
335 | |||
336 | for (i = 0, line = data->lines; i < data->num_lines; i++,line++) | ||
356 | { | 337 | { |
357 | DEBUGF("%2d. ", line); | 338 | DEBUGF("Line %2d (num_sublines=%d, first_subline=%d)\n", |
358 | for (subline = 0; subline < data->num_sublines[line]; subline++) | 339 | i, line->num_sublines, line->first_subline_idx); |
340 | |||
341 | for (j = 0, subline = data->sublines + line->first_subline_idx; | ||
342 | j < line->num_sublines; j++, subline++) | ||
359 | { | 343 | { |
360 | DEBUGF("%3d ", data->format_lines[line][subline]); | 344 | DEBUGF(" Subline %d: first_token=%3d, last_token=%3d", |
345 | j, subline->first_token_idx, | ||
346 | wps_last_token_index(data, i, j)); | ||
347 | |||
348 | if (subline->line_type & WPS_REFRESH_SCROLL) | ||
349 | DEBUGF(", scrolled"); | ||
350 | else if (subline->line_type & WPS_REFRESH_PLAYER_PROGRESS) | ||
351 | DEBUGF(", progressbar"); | ||
352 | else if (subline->line_type & WPS_REFRESH_PEAK_METER) | ||
353 | DEBUGF(", peakmeter"); | ||
354 | |||
355 | DEBUGF("\n"); | ||
361 | } | 356 | } |
362 | DEBUGF("\n"); | ||
363 | } | 357 | } |
364 | 358 | ||
365 | DEBUGF("\n"); | 359 | DEBUGF("\n"); |
@@ -367,21 +361,21 @@ void print_line_info(struct wps_data *data) | |||
367 | 361 | ||
368 | void print_wps_strings(struct wps_data *data) | 362 | void print_wps_strings(struct wps_data *data) |
369 | { | 363 | { |
370 | DEBUGF("strings :\n"); | 364 | DEBUGF("Strings:\n"); |
371 | int i, len = 0; | 365 | int i, len = 0; |
372 | for (i=0; i < data->num_strings; i++) | 366 | for (i=0; i < data->num_strings; i++) |
373 | { | 367 | { |
374 | len += strlen(data->strings[i]); | 368 | len += strlen(data->strings[i]); |
375 | DEBUGF("%2d: '%s'\n", i, data->strings[i]); | 369 | DEBUGF("%2d: '%s'\n", i, data->strings[i]); |
376 | } | 370 | } |
377 | DEBUGF("total length : %d\n", len); | 371 | DEBUGF("Total length: %d\n", len); |
378 | DEBUGF("\n"); | 372 | DEBUGF("\n"); |
379 | } | 373 | } |
380 | 374 | ||
381 | #ifdef HAVE_LCD_BITMAP | 375 | #ifdef HAVE_LCD_BITMAP |
382 | void print_img_cond_indexes(struct wps_data *data) | 376 | void print_img_cond_indexes(struct wps_data *data) |
383 | { | 377 | { |
384 | DEBUGF("image conditional indexes :\n"); | 378 | DEBUGF("Image conditional indexes:\n"); |
385 | int i; | 379 | int i; |
386 | for (i=0; i < MAX_IMAGES; i++) | 380 | for (i=0; i < MAX_IMAGES; i++) |
387 | { | 381 | { |