summaryrefslogtreecommitdiff
path: root/apps/plugins/oscilloscope.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-12-07 01:50:52 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-12-18 19:16:26 -0500
commit371c86bf3f4d1708fc40db2aa7fa572eb429d0b4 (patch)
treebe339c62eac616ac6938c2929349b72377c10ee2 /apps/plugins/oscilloscope.c
parentf668c3624184fedc14d34f87ad7b5f1e43bc87a1 (diff)
downloadrockbox-371c86bf3f4d1708fc40db2aa7fa572eb429d0b4.tar.gz
rockbox-371c86bf3f4d1708fc40db2aa7fa572eb429d0b4.zip
Adapt OSD in plugin lib to be greylib compatible.
Requires addition of viewports and alternate framebuffers to greylib which are essentially similar to the core implementation except that the framebuffer can be any size and relationship to a viewport. Drawing is always fully clipped to the intersecting area. Adapt oscilloscope.c to the API change. FFT will use the new features (later update). Get rid of silly and wrong lcd_bmp_part use in OSD. Remove it from plugin API (must be made incompatible now). Change-Id: Iafa5e2174148fb8ad11db6b9d4add0dcabc5c563
Diffstat (limited to 'apps/plugins/oscilloscope.c')
-rw-r--r--apps/plugins/oscilloscope.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 4fbf96939d..c418f127fc 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -727,7 +727,14 @@ static void osc_osd_init(void)
727 /* Grab the plugin buffer for the OSD back buffer */ 727 /* Grab the plugin buffer for the OSD back buffer */
728 size_t bufsize; 728 size_t bufsize;
729 void *buf = rb->plugin_get_buffer(&bufsize); 729 void *buf = rb->plugin_get_buffer(&bufsize);
730 osd_init(buf, bufsize, osd_lcd_draw_cb); 730
731 int width, height;
732 rb->lcd_setfont(FONT_UI);
733 rb->lcd_getstringsize("M", NULL, &height);
734 width = LCD_WIDTH;
735 height += 2 + 2*OSC_OSD_MARGIN_SIZE;
736 osd_init(OSD_INIT_MAJOR_HEIGHT | OSD_INIT_MINOR_MAX, buf, bufsize,
737 osd_lcd_draw_cb, &width, &height, NULL);
731} 738}
732 739
733/* Format a message by ID and show the OSD */ 740/* Format a message by ID and show the OSD */
@@ -1826,7 +1833,7 @@ static long oscilloscope_draw(void)
1826 1833
1827static void osc_cleanup(void) 1834static void osc_cleanup(void)
1828{ 1835{
1829 osd_init(NULL, 0, NULL); 1836 osd_destroy();
1830 1837
1831#ifdef OSCILLOSCOPE_GRAPHMODE 1838#ifdef OSCILLOSCOPE_GRAPHMODE
1832 anim_waveform_exit(); 1839 anim_waveform_exit();