summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-03-12 13:44:51 +0000
committerJens Arnold <amiconn@rockbox.org>2006-03-12 13:44:51 +0000
commitc91623b7801650d38a3492ca3e7ce66e3523b51c (patch)
tree4711a2862ab91d162ced7128a61746dfccee53c3
parentfcd884ba9bdc14b53009c5808bc2d33cd692dbb5 (diff)
Oscilloscope: Don't print speed messages at an irritanting position (i.e. wrapped) * Print speed messages in horizontal mode (as number only).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9013 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/oscilloscope.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index baaf25d2b0..3c20d39500 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -300,6 +300,19 @@ void anim_horizontal(int cur_left, int cur_right)
last_left = cur_left;
last_right = cur_right;
+ if (displaymsg)
+ {
+ int width;
+
+ rb->lcd_getstringsize(message, &width, NULL);
+ last_pos -= width - 1;
+ rb->lcd_putsxy(last_pos, 0, message);
+ displaymsg = false;
+
+ if (last_pos < 0)
+ last_pos = 0;
+ }
+
if (full_update)
{
rb->lcd_update();
@@ -468,11 +481,11 @@ void anim_vertical(int cur_left, int cur_right)
if (displaymsg)
{
last_pos -= font_height - 1;
- if (last_pos < 0)
- last_pos = LCD_HEIGHT - font_height;
-
rb->lcd_putsxy(0, last_pos, message);
displaymsg = false;
+
+ if (last_pos < 0)
+ last_pos = 0;
}
if (full_update)
@@ -651,7 +664,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
if (tell_speed)
{
- rb->snprintf(message, sizeof(message), "Speed: %d", 100 / osc.delay);
+ rb->snprintf(message, sizeof(message), "%s%d",
+ (osc.orientation == OSC_VERT) ? "Speed: " : "",
+ 100 / osc.delay);
displaymsg = true;
}
}