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.zip rockbox-6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15.tar.gz rockbox-6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15.tar.bz2 rockbox-6479e4c95eafcdc13fc49bebe6dc24a8ea3b6d15.tar.xz | |
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 d6d765f..ca839a9 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, wps_data->full_line_progressbar=0; return buf; #else + char *p=strchr(tag, '|'); + if (p) { + wps_data->progress_height=atoi(++p); + p=strchr(p, '|'); + if (p) { + wps_data->progress_start=atoi(++p); + p=strchr(p, '|'); + if (p) + wps_data->progress_end=atoi(++p); + else + wps_data->progress_end=NULL; + }else { + wps_data->progress_start=0; + wps_data->progress_end=NULL; + } + }else { + wps_data->progress_height=6; + wps_data->progress_start=0; + wps_data->progress_end=NULL; + } return "\x01"; #endif case 'f': /* full-line progress bar */ @@ -1449,9 +1469,12 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, /* progress */ if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) { -#define PROGRESS_BAR_HEIGHT 6 /* this should probably be defined elsewhere; config-*.h perhaps? */ int sby = i*h + offset + (h > 7 ? (h - 6) / 2 : 1); - gui_scrollbar_draw(display, 0, sby, display->width, +#define PROGRESS_BAR_HEIGHT gwps->data->progress_height /* this should probably be defined elsewhere; config-*.h perhaps? */ + if (!gwps->data->progress_end) + gwps->data->progress_end=gwps->display->width; + gui_scrollbar_draw(display, gwps->data->progress_start, sby, + gwps->data->progress_end-gwps->data->progress_start, PROGRESS_BAR_HEIGHT, state->id3->length?state->id3->length:1, 0, state->id3->length?state->id3->elapsed + state->ff_rewind_count:0, diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 8cd4c8f..7cb1cde 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h @@ -309,6 +309,9 @@ struct wps_data unsigned short time_mult[WPS_MAX_LINES][WPS_MAX_SUBLINES]; long subline_expire_time[WPS_MAX_LINES]; int curr_subline[WPS_MAX_LINES]; + int progress_height; + int progress_start; + int progress_end; bool wps_loaded; bool peak_meter_enabled; }; |