Index: apps/gui/gwps-common.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps-common.c,v
retrieving revision 1.46
diff -u -r1.46 gwps-common.c
--- apps/gui/gwps-common.c	28 Mar 2006 10:07:34 -0000	1.46
+++ apps/gui/gwps-common.c	5 Apr 2006 13:54:18 -0000
@@ -19,6 +19,7 @@
 #include "gwps-common.h"
 #include "font.h"
 #include <stdio.h>
+#include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
 #include "system.h"
@@ -696,9 +697,41 @@
                     return buf;
 
 #ifdef HAVE_LCD_BITMAP
-                case 'm': /* Peak Meter */
+                case 'm': /* Peak Meter */ {
+                    char *p=NULL;
                     *flags |= WPS_REFRESH_PEAK_METER;
+                    wps_data->peakmeter_height=0;
+                    wps_data->peakmeter_start=0;
+                    wps_data->peakmeter_end=0;
+
+                    p=strchr(tag, '|');
+                    if (p) {
+                        p++;
+                        if (isdigit(*p)) {
+                            wps_data->peakmeter_height=atoi(p);
+                            if (wps_data->peakmeter_height < 4)
+                                wps_data->peakmeter_height=4;
+                        }
+
+                        p=strchr(p, '|');
+                        if (p) {
+                            p++;
+                            if (isdigit(*p)) {
+                                wps_data->peakmeter_start=atoi(p);
+                                if (wps_data->peakmeter_start < 0)
+                                    wps_data->peakmeter_start=0;
+                            }
+
+                            p=strchr(p, '|');
+                            if (p) {
+                                p++;
+                                if (isdigit(*p))
+                                    wps_data->peakmeter_end=atoi(p);
+                            }
+                        }
+                    }
                     return "\x01";
+                } break;
 #endif
                 case 's': /* shuffle */
                     *flags |= WPS_REFRESH_DYNAMIC;
@@ -1770,17 +1803,38 @@
 
                 update_line = true;
                 peak_meter_y = i * h + offset;
+                if (data->peakmeter_height > 0) {
+                    if (h > (data->peakmeter_height + 1))
+                        peak_meter_y += (h - data->peakmeter_height) / 2;
+                    else
+                        peak_meter_y++;
+                }
+                else
+                    data->peakmeter_height = h;
+
+                if (data->peakmeter_start < 0)
+                     data->peakmeter_start = 0;
 
+                if (data->peakmeter_end <= 0)
+                    data->peakmeter_end = LCD_WIDTH;
+                if (data->peakmeter_end < (data->peakmeter_start + 4))
+                    data->peakmeter_end = data->peakmeter_start + 4;
+  
                 /* The user might decide to have the peak meter in the last
                    line so that it is only displayed if no status bar is
                    visible. If so we neither want do draw nor enable the
                    peak meter. */
-                if (peak_meter_y + h <= display->height) {
+                if (peak_meter_y + data->peakmeter_height <= LCD_HEIGHT) {
                     /* found a line with a peak meter -> remember that we must
                        enable it later */
                     enable_pm = true;
-                    peak_meter_screen(gwps->display, 0, peak_meter_y,
-                                    MIN(h, display->height - peak_meter_y));
+                    peak_meter_screen(gwps->display, data->peakmeter_start,
+                                      peak_meter_y,
+                                      MIN(data->peakmeter_end -
+                                          data->peakmeter_start,
+                                          gwps->display->width),
+                                    MIN(data->peakmeter_height,
+                                        gwps->display->height - peak_meter_y));
                 }
             }
 #else
Index: apps/gui/gwps.h
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/gwps.h,v
retrieving revision 1.27
diff -u -r1.27 gwps.h
--- apps/gui/gwps.h	2 Apr 2006 10:41:16 -0000	1.27
+++ apps/gui/gwps.h	5 Apr 2006 13:54:18 -0000
@@ -350,6 +350,11 @@
     bool has_backdrop;
     fb_data* old_backdrop;
 #endif
+#ifdef HAVE_LCD_BITMAP
+    int peakmeter_height;
+    int peakmeter_start;
+    int peakmeter_end;
+#endif
 };
 
 /* initial setup of wps_data */
Index: apps/recorder/peakmeter.c
===================================================================
RCS file: /cvsroot/rockbox/apps/recorder/peakmeter.c,v
retrieving revision 1.34
diff -u -r1.34 peakmeter.c
--- apps/recorder/peakmeter.c	3 Apr 2006 08:20:20 -0000	1.34
+++ apps/recorder/peakmeter.c	5 Apr 2006 13:54:18 -0000
@@ -811,10 +811,11 @@
     }
     return retval;
 }
-void peak_meter_screen(struct screen *display, int x, int y, int height)
+void peak_meter_screen(struct screen *display, int x, int y,
+                       int width, int height)
 {
     peak_meter_draw(display, &scales[display->screen_type], x, y,
-                        display->width, height);
+                    width, height);
 }           
 /**
  * Draws a peak meter in the specified size at the specified position.
@@ -1203,7 +1204,7 @@
         if (TIME_AFTER(current_tick, next_refresh)) {
             FOR_NB_SCREENS(i)
             {
-                peak_meter_screen(&screens[i], x, y, height);
+                peak_meter_screen(&screens[i], x, y, screens[i].width, height);
                 screens[i].update_rect(x, y, screens[i].width, height);
             }
             next_refresh += HZ / PEAK_METER_FPS;
Index: apps/recorder/peakmeter.h
===================================================================
RCS file: /cvsroot/rockbox/apps/recorder/peakmeter.h,v
retrieving revision 1.7
diff -u -r1.7 peakmeter.h
--- apps/recorder/peakmeter.h	25 Mar 2006 13:35:31 -0000	1.7
+++ apps/recorder/peakmeter.h	5 Apr 2006 13:54:18 -0000
@@ -96,7 +96,9 @@
     long pm_peak_timeout_l;
     long pm_peak_timeout_r;
 };
-extern void peak_meter_draw(struct screen *display, struct meter_scales *meter_scales,
-                                int x, int y, int width, int height);
-extern void peak_meter_screen(struct screen *display, int x, int y, int height);
+extern void peak_meter_draw(struct screen *display,
+                            struct meter_scales *meter_scales,
+                            int x, int y, int width, int height);
+extern void peak_meter_screen(struct screen *display, int x, int y,
+                              int width, int height);
 #endif /* __PEAKMETER_H__ */
Index: apps/recorder/recording.c
===================================================================
RCS file: /cvsroot/rockbox/apps/recorder/recording.c,v
retrieving revision 1.104
diff -u -r1.104 recording.c
--- apps/recorder/recording.c	1 Apr 2006 15:52:06 -0000	1.104
+++ apps/recorder/recording.c	5 Apr 2006 13:54:19 -0000
@@ -1252,7 +1252,8 @@
 
             FOR_NB_SCREENS(i)
             {
-                peak_meter_screen(&screens[i], 0, 8 + h*2, h*2);
+                peak_meter_screen(&screens[i], 0, 8 + h*2,
+                                  screens[i].width, h*2);
                 screens[i].update();                
             }
 
