diff options
author | Ben Basha <benbasha@rockbox.org> | 2006-02-01 15:34:25 +0000 |
---|---|---|
committer | Ben Basha <benbasha@rockbox.org> | 2006-02-01 15:34:25 +0000 |
commit | 6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15 (patch) | |
tree | c626979b70e8c1a950fdce56f73b90a2d635e2c1 /apps | |
parent | 8ab7c38bac954b9201c717a4d0df1d86a8f847c5 (diff) | |
download | rockbox-6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15.tar.gz rockbox-6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15.zip |
WPS tag update for Progress Bar to allow resizing and screen placing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8523 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/gwps-common.c | 27 | ||||
-rw-r--r-- | apps/gui/gwps.h | 3 |
2 files changed, 28 insertions, 2 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index d6d765f418..ca839a9bfa 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -510,6 +510,26 @@ static char* get_tag(struct wps_data* wps_data, | |||
510 | wps_data->full_line_progressbar=0; | 510 | wps_data->full_line_progressbar=0; |
511 | return buf; | 511 | return buf; |
512 | #else | 512 | #else |
513 | char *p=strchr(tag, '|'); | ||
514 | if (p) { | ||
515 | wps_data->progress_height=atoi(++p); | ||
516 | p=strchr(p, '|'); | ||
517 | if (p) { | ||
518 | wps_data->progress_start=atoi(++p); | ||
519 | p=strchr(p, '|'); | ||
520 | if (p) | ||
521 | wps_data->progress_end=atoi(++p); | ||
522 | else | ||
523 | wps_data->progress_end=NULL; | ||
524 | }else { | ||
525 | wps_data->progress_start=0; | ||
526 | wps_data->progress_end=NULL; | ||
527 | } | ||
528 | }else { | ||
529 | wps_data->progress_height=6; | ||
530 | wps_data->progress_start=0; | ||
531 | wps_data->progress_end=NULL; | ||
532 | } | ||
513 | return "\x01"; | 533 | return "\x01"; |
514 | #endif | 534 | #endif |
515 | case 'f': /* full-line progress bar */ | 535 | case 'f': /* full-line progress bar */ |
@@ -1449,9 +1469,12 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, | |||
1449 | /* progress */ | 1469 | /* progress */ |
1450 | if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) | 1470 | if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) |
1451 | { | 1471 | { |
1452 | #define PROGRESS_BAR_HEIGHT 6 /* this should probably be defined elsewhere; config-*.h perhaps? */ | ||
1453 | int sby = i*h + offset + (h > 7 ? (h - 6) / 2 : 1); | 1472 | int sby = i*h + offset + (h > 7 ? (h - 6) / 2 : 1); |
1454 | gui_scrollbar_draw(display, 0, sby, display->width, | 1473 | #define PROGRESS_BAR_HEIGHT gwps->data->progress_height /* this should probably be defined elsewhere; config-*.h perhaps? */ |
1474 | if (!gwps->data->progress_end) | ||
1475 | gwps->data->progress_end=gwps->display->width; | ||
1476 | gui_scrollbar_draw(display, gwps->data->progress_start, sby, | ||
1477 | gwps->data->progress_end-gwps->data->progress_start, | ||
1455 | PROGRESS_BAR_HEIGHT, | 1478 | PROGRESS_BAR_HEIGHT, |
1456 | state->id3->length?state->id3->length:1, 0, | 1479 | state->id3->length?state->id3->length:1, 0, |
1457 | state->id3->length?state->id3->elapsed + state->ff_rewind_count:0, | 1480 | state->id3->length?state->id3->elapsed + state->ff_rewind_count:0, |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 8cd4c8f63e..7cb1cde7eb 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -309,6 +309,9 @@ struct wps_data | |||
309 | unsigned short time_mult[WPS_MAX_LINES][WPS_MAX_SUBLINES]; | 309 | unsigned short time_mult[WPS_MAX_LINES][WPS_MAX_SUBLINES]; |
310 | long subline_expire_time[WPS_MAX_LINES]; | 310 | long subline_expire_time[WPS_MAX_LINES]; |
311 | int curr_subline[WPS_MAX_LINES]; | 311 | int curr_subline[WPS_MAX_LINES]; |
312 | int progress_height; | ||
313 | int progress_start; | ||
314 | int progress_end; | ||
312 | bool wps_loaded; | 315 | bool wps_loaded; |
313 | bool peak_meter_enabled; | 316 | bool peak_meter_enabled; |
314 | }; | 317 | }; |