summaryrefslogtreecommitdiffstats
path: root/apps/gui/pitchscreen.c
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-06-28 20:45:21 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-06-28 20:45:21 +0000
commit205f3df7816a1eea9c812ea285d74a4f8ecfad2a (patch)
tree356be7b807a4407b7e243ec57da4d5068fe09ab1 /apps/gui/pitchscreen.c
parent3d240f1e2a34e616c2aba22b58ea78de7f277127 (diff)
downloadrockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.gz
rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.bz2
rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.zip
Remove a viewport ambiguity by changing the screens width/heigth members into lcdwidth/lcdheight. Normal usercode should always use getwidth()/getheigth() as that returns the viewport width/height. Fixes issues that would have appeared in many places when introducing viewports with sizes != lcd sizes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17857 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/pitchscreen.c')
-rw-r--r--apps/gui/pitchscreen.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c
index c9d6750242..e0a7416ac6 100644
--- a/apps/gui/pitchscreen.c
+++ b/apps/gui/pitchscreen.c
@@ -64,7 +64,7 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
{
w = snprintf((char *)buf, sizeof(buf), "%s: %d.%d%%",str(LANG_PITCH),
pitch / 10, pitch % 10 );
- display->putsxy((display->width-(w*display->char_width))/2,
+ display->putsxy((display->lcdwidth-(w*display->char_width))/2,
display->nb_lines/2,buf);
}
else /* bigger screen, show everything... */
@@ -77,9 +77,9 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
ptr = str(LANG_PITCH_UP_SEMITONE);
}
display->getstringsize(ptr,&w,&h);
- display->putsxy((display->width-w)/2, 0, ptr);
+ display->putsxy((display->lcdwidth-w)/2, 0, ptr);
display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow],
- display->width/2 - 3, h, 7, 8);
+ display->lcdwidth/2 - 3, h, 7, 8);
/* DOWN: Pitch Down */
if (pitch_mode == PITCH_MODE_ABSOLUTE) {
@@ -88,33 +88,35 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
ptr = str(LANG_PITCH_DOWN_SEMITONE);
}
display->getstringsize(ptr,&w,&h);
- display->putsxy((display->width-w)/2, display->height - h, ptr);
+ display->putsxy((display->lcdwidth-w)/2, display->lcdheight - h, ptr);
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
- display->width/2 - 3, display->height - h*2, 7, 8);
+ display->lcdwidth/2 - 3,
+ display->lcdheight - h*2, 7, 8);
/* RIGHT: +2% */
ptr = "+2%";
display->getstringsize(ptr,&w,&h);
- display->putsxy(display->width-w, (display->height-h)/2, ptr);
+ display->putsxy(display->lcdwidth-w, (display->lcdheight-h)/2, ptr);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
- display->width-w-8, (display->height-h)/2, 7, 8);
+ display->lcdwidth-w-8,
+ (display->lcdheight-h)/2, 7, 8);
/* LEFT: -2% */
ptr = "-2%";
display->getstringsize(ptr,&w,&h);
- display->putsxy(0, (display->height-h)/2, ptr);
+ display->putsxy(0, (display->lcdheight-h)/2, ptr);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
- w+1, (display->height-h)/2, 7, 8);
+ w+1, (display->lcdheight-h)/2, 7, 8);
/* "Pitch" */
snprintf((char *)buf, sizeof(buf), str(LANG_PITCH));
display->getstringsize(buf,&w,&h);
- display->putsxy((display->width-w)/2, (display->height/2)-h, buf);
+ display->putsxy((display->lcdwidth-w)/2, (display->lcdheight/2)-h, buf);
/* "XX.X%" */
snprintf((char *)buf, sizeof(buf), "%d.%d%%",
pitch / 10, pitch % 10 );
display->getstringsize(buf,&w,&h);
- display->putsxy((display->width-w)/2, display->height/2, buf);
+ display->putsxy((display->lcdwidth-w)/2, display->lcdheight/2, buf);
}
display->update();
@@ -123,7 +125,7 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
static int pitch_increase(int pitch, int delta, bool allow_cutoff)
{
int new_pitch;
-
+
if (delta < 0) {
if (pitch + delta >= PITCH_MIN) {
new_pitch = pitch + delta;