summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-02-17 22:47:56 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-02-17 22:47:56 +0000
commit3467ba60b116579a855076b7e993603bf817af93 (patch)
tree50f4d1808b47287dc49867920b70ffaf9c852b4d /apps/recorder
parent00811840c9198833e6b234939b1509d52a51c880 (diff)
downloadrockbox-3467ba60b116579a855076b7e993603bf817af93.tar.gz
rockbox-3467ba60b116579a855076b7e993603bf817af93.zip
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
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/peakmeter.c34
1 files changed, 32 insertions, 2 deletions
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 @@
32#include "icons.h" 32#include "icons.h"
33#include "lang.h" 33#include "lang.h"
34#include "peakmeter.h" 34#include "peakmeter.h"
35#include "audio.h"
36#ifdef CONFIG_BACKLIGHT
37#include "backlight.h"
38#endif
35 39
36#if CONFIG_CODEC == SWCODEC 40#if CONFIG_CODEC == SWCODEC
37#include "pcm_playback.h" 41#include "pcm_playback.h"
@@ -943,9 +947,35 @@ void peak_meter_draw(int x, int y, int width, int height)
943 have been calculated before */ 947 have been calculated before */
944 lcd_drawpixel(db_scale_lcd_coord[i], y + height / 2 - 1); 948 lcd_drawpixel(db_scale_lcd_coord[i], y + height / 2 - 1);
945 } 949 }
950
951#ifdef HAVE_RECORDING
946 952
953#ifdef CONFIG_BACKLIGHT
954 /* cliplight */
955 if ((pm_clip_left || pm_clip_right) &&
956 global_settings.cliplight &&
957#if CONFIG_CODEC == SWCODEC
958 (pcm_rec_status() & (AUDIO_STATUS_RECORD | AUDIO_STATUS_PRERECORD)))
959#else
960 (audio_status() & (AUDIO_STATUS_RECORD | AUDIO_STATUS_PRERECORD)))
961#endif
962 {
963 /* if clipping, cliplight setting on and in recording screen */
964 if (global_settings.cliplight <= 2)
965 {
966 /* turn on main unit light if setting set to main or both*/
967 backlight_on();
968 }
969#ifdef HAVE_REMOTE_LCD
970 if (global_settings.cliplight >= 2)
971 {
972 /* turn remote light unit on if setting set to remote or both */
973 remote_backlight_on();
974 }
975#endif /* HAVE_REMOTE_LCD */
976 }
977#endif /*CONFIG_BACKLIGHT */
947 978
948#ifdef HAVE_RECORDING
949 if (trig_status != TRIG_OFF) { 979 if (trig_status != TRIG_OFF) {
950 int start_trigx, stop_trigx, ycenter; 980 int start_trigx, stop_trigx, ycenter;
951 981
@@ -961,7 +991,7 @@ void peak_meter_draw(int x, int y, int width, int height)
961 lcd_vline(stop_trigx, ycenter - 2, ycenter); 991 lcd_vline(stop_trigx, ycenter - 2, ycenter);
962 if (stop_trigx > 0) lcd_drawpixel(stop_trigx - 1, ycenter - 1); 992 if (stop_trigx > 0) lcd_drawpixel(stop_trigx - 1, ycenter - 1);
963 } 993 }
964#endif 994#endif /*HAVE_RECORDING*/
965 995
966#ifdef PM_DEBUG 996#ifdef PM_DEBUG
967 /* display a bar to show how many calls to peak_meter_peek 997 /* display a bar to show how many calls to peak_meter_peek