From 3467ba60b116579a855076b7e993603bf817af93 Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Fri, 17 Feb 2006 22:47:56 +0000 Subject: Patch #1423609 by Martin Scarratt and myself: enables using the backlight as record clipping indicator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8722 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/peakmeter.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'apps/recorder/peakmeter.c') diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index fbd206bdf8..0142a9d093 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -32,6 +32,10 @@ #include "icons.h" #include "lang.h" #include "peakmeter.h" +#include "audio.h" +#ifdef CONFIG_BACKLIGHT +#include "backlight.h" +#endif #if CONFIG_CODEC == SWCODEC #include "pcm_playback.h" @@ -943,9 +947,35 @@ void peak_meter_draw(int x, int y, int width, int height) have been calculated before */ lcd_drawpixel(db_scale_lcd_coord[i], y + height / 2 - 1); } + +#ifdef HAVE_RECORDING +#ifdef CONFIG_BACKLIGHT + /* cliplight */ + if ((pm_clip_left || pm_clip_right) && + global_settings.cliplight && +#if CONFIG_CODEC == SWCODEC + (pcm_rec_status() & (AUDIO_STATUS_RECORD | AUDIO_STATUS_PRERECORD))) +#else + (audio_status() & (AUDIO_STATUS_RECORD | AUDIO_STATUS_PRERECORD))) +#endif + { + /* if clipping, cliplight setting on and in recording screen */ + if (global_settings.cliplight <= 2) + { + /* turn on main unit light if setting set to main or both*/ + backlight_on(); + } +#ifdef HAVE_REMOTE_LCD + if (global_settings.cliplight >= 2) + { + /* turn remote light unit on if setting set to remote or both */ + remote_backlight_on(); + } +#endif /* HAVE_REMOTE_LCD */ + } +#endif /*CONFIG_BACKLIGHT */ -#ifdef HAVE_RECORDING if (trig_status != TRIG_OFF) { int start_trigx, stop_trigx, ycenter; @@ -961,7 +991,7 @@ void peak_meter_draw(int x, int y, int width, int height) lcd_vline(stop_trigx, ycenter - 2, ycenter); if (stop_trigx > 0) lcd_drawpixel(stop_trigx - 1, ycenter - 1); } -#endif +#endif /*HAVE_RECORDING*/ #ifdef PM_DEBUG /* display a bar to show how many calls to peak_meter_peek -- cgit v1.2.3