From 4fd9038d35707104804a068af0ed1d35d467a1f2 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Mon, 29 Mar 2010 23:50:07 +0000 Subject: pitch_detector: fix builds on monochrome targets, remove an unused variable Add icons for Clip, copied from c200 icons git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25397 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/SOURCES | 2 +- apps/plugins/bitmaps/native/SOURCES | 2 ++ apps/plugins/bitmaps/native/pitch_notes.128x64x1.bmp | Bin 0 -> 10294 bytes apps/plugins/pitch_detector.c | 18 +++++++++++------- manual/plugins/main.tex | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 apps/plugins/bitmaps/native/pitch_notes.128x64x1.bmp diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index a74b8be537..88ddff5e29 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -39,7 +39,7 @@ crypt_firmware.c #endif #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_RECORDING) && \ - (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) && defined(HAVE_LCD_COLOR) + (defined(HAVE_LINE_IN) || defined(HAVE_MIC_IN)) pitch_detector.c #endif diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index f5d61b85f0..a064e16589 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -863,6 +863,8 @@ pitch_notes.160x128x2.bmp pitch_notes.132x80x16.bmp #elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 96) && (LCD_DEPTH >= 2) pitch_notes.128x96x2.bmp +#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 64) +pitch_notes.128x64x1.bmp #else #error Pitch Detector: unsupported LCD #endif diff --git a/apps/plugins/bitmaps/native/pitch_notes.128x64x1.bmp b/apps/plugins/bitmaps/native/pitch_notes.128x64x1.bmp new file mode 100644 index 0000000000..b97bbb100a Binary files /dev/null and b/apps/plugins/bitmaps/native/pitch_notes.128x64x1.bmp differ diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c index 5f375d1007..10125c1302 100644 --- a/apps/plugins/pitch_detector.c +++ b/apps/plugins/pitch_detector.c @@ -289,7 +289,9 @@ static const struct note_entry notes[] = }; /* GUI */ -static unsigned back_color, front_color; +#if LCD_DEPTH > 1 +static unsigned front_color; +#endif static int font_w,font_h; static int bar_x_0; static int lbl_x_minus_50, lbl_x_minus_20, lbl_x_0, lbl_x_20, lbl_x_50; @@ -610,8 +612,9 @@ fixed log(fixed inp) void print_int_xy(int x, int y, int v) { char temp[20]; - +#if LCD_DEPTH > 1 rb->lcd_set_foreground(front_color); +#endif rb->snprintf(temp,20,"%d",v); rb->lcd_putsxy(x,y,temp); } @@ -619,7 +622,9 @@ void print_int_xy(int x, int y, int v) /* Print out the frequency etc */ void print_str(char* s) { +#if LCD_DEPTH > 1 rb->lcd_set_foreground(front_color); +#endif rb->lcd_putsxy(0, HZ_Y, s); } @@ -630,7 +635,9 @@ void print_char_xy(int x, int y, char c) temp[0]=c; temp[1]=0; +#if LCD_DEPTH > 1 rb->lcd_set_foreground(front_color); +#endif rb->lcd_putsxy(x, y, temp); } @@ -674,8 +681,6 @@ void draw_bar(fixed wrong_by_cents) rb->lcd_set_foreground(LCD_RGBPACK(255,255,255)); /* Color screens */ #elif LCD_DEPTH > 1 rb->lcd_set_foreground(LCD_BLACK); /* Greyscale screens */ -#else - rb->lcd_set_foreground(LCD_BLACK); /* Black and white screens */ #endif rb->lcd_hline(0,LCD_WIDTH-1, BAR_HLINE_Y); @@ -700,8 +705,6 @@ void draw_bar(fixed wrong_by_cents) rb->lcd_set_foreground(LCD_RGBPACK(255,0,0)); /* Color screens */ #elif LCD_DEPTH > 1 rb->lcd_set_foreground(LCD_DARKGRAY); /* Greyscale screens */ -#else - rb->lcd_set_foreground(LCD_BLACK); /* Black and white screens */ #endif if (fp_gt(wrong_by_cents, FP_ZERO)) @@ -1109,8 +1112,9 @@ void init_everything(void) rb->pcm_init_recording(); /* GUI */ - back_color = rb->lcd_get_background(); +#if LCD_DEPTH > 1 front_color = rb->lcd_get_foreground(); +#endif rb->lcd_getstringsize("X", &font_w, &font_h); bar_x_0 = LCD_WIDTH / 2; diff --git a/manual/plugins/main.tex b/manual/plugins/main.tex index 4952f4e26d..01e676339d 100644 --- a/manual/plugins/main.tex +++ b/manual/plugins/main.tex @@ -228,7 +228,7 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).} {\input{plugins/metronome.tex}} -\opt{swcodec}{\opt{recording_mic}{\opt{lcd_color}{\input{plugins/pitch_detector.tex}}}} +\opt{swcodec}{\opt{recording_mic}{\input{plugins/pitch_detector.tex}}} {\input{plugins/random_folder_advance_config.tex}} -- cgit v1.2.3