Index: apps/gui/gwps-common.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps-common.c,v
retrieving revision 1.69
diff -u -b -B -p -r1.69 gwps-common.c
--- apps/gui/gwps-common.c	29 Dec 2006 19:17:03 -0000	1.69
+++ apps/gui/gwps-common.c	3 Jan 2007 05:01:51 -0000
@@ -607,6 +607,7 @@ static char* get_tag(struct wps_data* wp
             {
                 case 'b':  /* progress bar */
                     *flags |= WPS_REFRESH_PLAYER_PROGRESS;
+                    wps_data->progress_y = -1; /* disabled unless used in tag */
 #ifdef HAVE_LCD_CHARCELLS
                     snprintf(buf, buf_size, "%c",
                              wps_data->wps_progress_pat[0]);
@@ -621,7 +622,14 @@ static char* get_tag(struct wps_data* wp
                             wps_data->progress_start=atoi(++p);
                             p=strchr(p, '|');
                             if (p)
+                            {
                                 wps_data->progress_end=atoi(++p);   
+                                /* find the optional y coord */
+                                p=strchr(p, '|');
+                                if(p)
+                                    wps_data->progress_y = atoi(++p);
+                            }
+
                             else 
                                 wps_data->progress_end=0;
                         }else {
@@ -1655,6 +1663,40 @@ void gui_wps_reset(struct gui_wps *gui_w
 }
 #endif
 
+#ifdef HAVE_LCD_BITMAP
+void progress_bar_draw (struct gui_wps *gwps, int y)
+{
+    struct wps_data  *data    = gwps->data;
+    struct wps_state *state   = gwps->state;
+    struct screen    *display = gwps->display;
+
+    if (!data->progress_end)
+        data->progress_end=display->width;
+                
+    if (gwps->data->progressbar.have_bitmap_pb)
+        gui_bitmap_scrollbar_draw(display, data->progressbar.bm,
+                                  data->progress_start, y, 
+                                  data->progress_end-data->progress_start,
+                                  data->progressbar.bm.height,
+                                  state->id3->length?state->id3->length:1, 0,
+                                  state->id3->length?state->id3->elapsed + state->ff_rewind_count:0,
+                                  HORIZONTAL);
+    else
+        gui_scrollbar_draw(display, data->progress_start, y, 
+                           data->progress_end-data->progress_start,
+                           data->progress_height,
+                           state->id3->length?state->id3->length:1, 0,
+                           state->id3->length?state->id3->elapsed + state->ff_rewind_count:0,
+                           HORIZONTAL);
+# ifdef AB_REPEAT_ENABLE
+    if (ab_repeat_mode_enabled())
+        ab_draw_markers(display, state->id3->length,
+                        data->progress_start, data->progress_end,
+                        y, data->progress_height);
+# endif
+    }
+#endif
+
 bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
                      unsigned char refresh_mode)
 {
@@ -1815,35 +1857,14 @@ bool gui_wps_refresh(struct gui_wps *gwp
 
 #ifdef HAVE_LCD_BITMAP
             /* progress */
-            if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) 
+            /*  if the WPS didn't specify a pixel Y coord for the pb,
+                 handle it the old way (uses a line) */
+            if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS &&
+                (data->progress_y == -1))
             {
                 int sb_y = i*h + offset + ((h > data->progress_height + 1)
                     ? (h - data->progress_height) / 2 : 1);
-
-                if (!data->progress_end)
-                    data->progress_end=display->width;
-                
-                if (gwps->data->progressbar.have_bitmap_pb)
-                    gui_bitmap_scrollbar_draw(display, data->progressbar.bm,
-                                        data->progress_start, sb_y, 
-                                        data->progress_end-data->progress_start,
-                                        data->progressbar.bm.height,
-                                        state->id3->length?state->id3->length:1, 0,
-                                        state->id3->length?state->id3->elapsed + state->ff_rewind_count:0,
-                                        HORIZONTAL);
-                else
-                    gui_scrollbar_draw(display, data->progress_start, sb_y, 
-                                        data->progress_end-data->progress_start,
-                                        data->progress_height,
-                                        state->id3->length?state->id3->length:1, 0,
-                                        state->id3->length?state->id3->elapsed + state->ff_rewind_count:0,
-                                        HORIZONTAL);
-#ifdef AB_REPEAT_ENABLE
-                if ( ab_repeat_mode_enabled() )
-                    ab_draw_markers(display, state->id3->length,
-                            data->progress_start, data->progress_end, sb_y,
-                            data->progress_height);
-#endif
+                progress_bar_draw(gwps, sb_y);
                 update_line = true;
             }
             if (flags & refresh_mode & WPS_REFRESH_PEAK_METER) {
@@ -2084,6 +2105,11 @@ bool gui_wps_refresh(struct gui_wps *gwp
     }
 
 #ifdef HAVE_LCD_BITMAP
+    /* if the WPS requested a specific Y coord for the progress bar,
+        draw it there now */
+    if (data->progress_y != -1 && (refresh_mode & WPS_REFRESH_PLAYER_PROGRESS))
+        progress_bar_draw(gwps, data->progress_y);
+
     /* Display all images */
     wps_display_images(gwps,true);
     display->update();
Index: apps/gui/gwps.h
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps.h,v
retrieving revision 1.40
diff -u -b -B -p -r1.40 gwps.h
--- apps/gui/gwps.h	13 Dec 2006 11:52:21 -0000	1.40
+++ apps/gui/gwps.h	3 Jan 2007 05:01:51 -0000
@@ -106,6 +106,7 @@ struct wps_data
     int progress_height;
     int progress_start;
     int progress_end;
+    int progress_y; /* if 0, progress bars use up a line as before */
     bool wps_loaded;
     bool peak_meter_enabled;
 };
