summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-02-15 22:17:01 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-02-15 22:17:01 +0000
commit7ba8aec5af73d7ff4ce4d9a788d6a5911c621e88 (patch)
tree934b0132d2729b3fb40f74f4774d0ae8d8bc66bb /apps
parent375b7e0f85a1cfee58e6d359d83df6f3e9e44cb5 (diff)
downloadrockbox-7ba8aec5af73d7ff4ce4d9a788d6a5911c621e88.tar.gz
rockbox-7ba8aec5af73d7ff4ce4d9a788d6a5911c621e88.tar.bz2
rockbox-7ba8aec5af73d7ff4ce4d9a788d6a5911c621e88.zip
* Add support for an optional y coordinate to the progressbar (from FS #4783).
* Modify the 'Rockboxed' WPS to make use of this new coordinate. It improves the display of cuesheet/A-B markers a lot and cleans the bitmaps up a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c61
-rw-r--r--apps/gui/gwps.h1
2 files changed, 37 insertions, 25 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index b6e64d2fcc..2037ad57a5 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -620,30 +620,37 @@ 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
+ /* default values : */
+ wps_data->progress_top = -1;
+ wps_data->progress_height = 6;
+ wps_data->progress_start = 0;
+ wps_data->progress_end = 0;
+
+ char *prev=strchr(tag, '|');
+ if (prev) {
+ char *p=strchr(prev+1, '|');
+ if (p) {
+ wps_data->progress_height=atoi(++prev);
+ prev=strchr(prev, '|');
+ p=strchr(++p, '|');
+ if (p) {
+ wps_data->progress_start=atoi(++prev);
+ prev=strchr(prev, '|');
+ p=strchr(++p, '|');
+ if (p) {
+ wps_data->progress_end=atoi(++prev);
+ prev=strchr(prev, '|');
+ p=strchr(++p, '|');
+ if(p)
+ wps_data->progress_top = atoi(++prev);
+ }
+
+ if (wps_data->progress_height<3)
+ wps_data->progress_height=3;
+ if (wps_data->progress_end<wps_data->progress_start+3)
wps_data->progress_end=0;
- }else {
- wps_data->progress_start=0;
- wps_data->progress_end=0;
- }
-
- if (wps_data->progress_height<3)
- wps_data->progress_height=3;
- if (wps_data->progress_end<wps_data->progress_start+3)
- wps_data->progress_end=0;
- }else {
- wps_data->progress_height=6;
- wps_data->progress_start=0;
- wps_data->progress_end=0;
+ }
+ }
}
return "\x01";
#endif
@@ -1824,8 +1831,12 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
/* progress */
if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS)
{
- int sb_y = i*h + offset + ((h > data->progress_height + 1)
- ? (h - data->progress_height) / 2 : 1);
+ int sb_y;
+ if (data->progress_top == -1)
+ sb_y = i*h + offset + ((h > data->progress_height + 1)
+ ? (h - data->progress_height) / 2 : 1);
+ else
+ sb_y = data->progress_top;
if (!data->progress_end)
data->progress_end=display->width;
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index ff4e128d4e..e19bffc0b1 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -103,6 +103,7 @@ 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_top;
int progress_height;
int progress_start;
int progress_end;