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
This commit is contained in:
Peter D'Hoye 2006-02-17 22:47:56 +00:00
parent 00811840c9
commit 3467ba60b1
5 changed files with 93 additions and 4 deletions

View file

@ -3724,3 +3724,27 @@ desc: jump to new page when scrolling
eng: "Paged Scrolling"
voice: ""
new:
id: LANG_CLIP_LIGHT
desc: in record settings menu.
eng: "Clipping light"
voice: "Clipping light"
new:
id: LANG_MAIN_UNIT
desc: in record settings menu.
eng: "Main unit only"
voice: "Main unit only"
new:
id: LANG_REMOTE_UNIT
desc: in record settings menu.
eng: "Remote unit only"
voice: "Remote unit only"
new:
id: LANG_REMOTE_MAIN
desc: in record settings menu.
eng: "Main and remote unit"
voice: "Main and remote unit"
new:

View file

@ -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"
@ -944,8 +948,34 @@ void peak_meter_draw(int x, int y, int width, int height)
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 */
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

View file

@ -540,6 +540,11 @@ static const struct bit_entry hd_bits[] =
"mic decimator right gain", NULL }, /* -128...48 */
#endif
{1, S_O(scroll_paginated), false, "scroll paginated", off_on },
#ifdef HAVE_RECORDING
#ifdef CONFIG_BACKLIGHT
{2, S_O(cliplight), 0, "cliplight", "off,main,both,remote" },
#endif /* CONFIG_BACKLIGHT */
#endif /*HAVE_RECORDING*/
/* If values are just added to the end, no need to bump the version. */
/* new stuff to be added at the end */

View file

@ -236,6 +236,10 @@ struct user_settings
int rec_prerecord_time; /* In seconds, 0-30, 0 means OFF */
int rec_directory; /* 0=base dir, 1=current dir */
bool rec_startup; /* true means start Rockbox in recording screen */
int cliplight; /* 0 = off
1 = main lcd
2 = main and remote lcd
3 = remote lcd */
int rec_start_thres; /* negative: db, positive: % range -87 .. 100 */
int rec_start_duration; /* index of trig_durations */

View file

@ -341,7 +341,29 @@ static bool reconstartup(void)
&global_settings.rec_startup);
}
#endif /* MAS3587F */
#ifdef CONFIG_BACKLIGHT
static bool cliplight(void)
{
static const struct opt_items names[] = {
{ STR(LANG_OFF) },
{ STR(LANG_MAIN_UNIT) }
#ifdef HAVE_REMOTE_LCD
, { STR(LANG_REMOTE_MAIN) },
{ STR(LANG_REMOTE_UNIT) }
#endif
};
return set_option( str(LANG_CLIP_LIGHT),
&global_settings.cliplight, INT, names,
#ifdef HAVE_REMOTE_LCD
4, NULL );
#else
2, NULL );
#endif
}
#endif /*CONFIG_BACKLIGHT */
#endif /* HAVE_RECORDING */
static bool chanconf(void)
{
@ -808,6 +830,10 @@ bool recording_menu(bool no_source)
items[i++].function = recdirectory;
items[i].desc = ID2P(LANG_RECORD_STARTUP);
items[i++].function = reconstartup;
#ifdef CONFIG_BACKLIGHT
items[i].desc = ID2P(LANG_CLIP_LIGHT);
items[i++].function = cliplight;
#endif
#if !defined(SIMULATOR) && CONFIG_CODEC == MAS3587F
items[i].desc = ID2P(LANG_RECORD_TRIGGER);
items[i++].function = rectrigger;