forked from len0rd/rockbox
only build the clipcounter for targets with recording
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14467 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8f9717ae6f
commit
6109d39469
5 changed files with 35 additions and 14 deletions
|
|
@ -11127,13 +11127,16 @@
|
||||||
desc: in settings, for recording peak meter
|
desc: in settings, for recording peak meter
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: "Clip Counter"
|
*: none
|
||||||
|
recording: "Clip Counter"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "Clip Counter"
|
*: none
|
||||||
|
recording: "Clip Counter"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: "Clip Counter"
|
*: none
|
||||||
|
recording: "Clip Counter"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
|
@ -11141,12 +11144,15 @@
|
||||||
desc: in recording GUI, for recording peak meter. MAX 5 characters!
|
desc: in recording GUI, for recording peak meter. MAX 5 characters!
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: "CLIP:"
|
*: none
|
||||||
|
recording: "CLIP:"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: "CLIP:"
|
*: none
|
||||||
|
recording: "CLIP:"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: ""
|
*: none
|
||||||
|
recording: ""
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
|
|
||||||
|
|
@ -401,8 +401,10 @@ MENUITEM_SETTING(peak_meter_hold,
|
||||||
&global_settings.peak_meter_hold, peakmeter_callback);
|
&global_settings.peak_meter_hold, peakmeter_callback);
|
||||||
MENUITEM_SETTING(peak_meter_clip_hold,
|
MENUITEM_SETTING(peak_meter_clip_hold,
|
||||||
&global_settings.peak_meter_clip_hold, peakmeter_callback);
|
&global_settings.peak_meter_clip_hold, peakmeter_callback);
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
MENUITEM_SETTING(peak_meter_clipcounter,
|
MENUITEM_SETTING(peak_meter_clipcounter,
|
||||||
&global_settings.peak_meter_clipcounter, NULL);
|
&global_settings.peak_meter_clipcounter, NULL);
|
||||||
|
#endif
|
||||||
MENUITEM_SETTING(peak_meter_release,
|
MENUITEM_SETTING(peak_meter_release,
|
||||||
&global_settings.peak_meter_release, peakmeter_callback);
|
&global_settings.peak_meter_release, peakmeter_callback);
|
||||||
/**
|
/**
|
||||||
|
|
@ -530,7 +532,10 @@ MENUITEM_FUNCTION(peak_meter_max_item, 0, ID2P(LANG_PM_MAX),
|
||||||
peak_meter_max, NULL, NULL, Icon_NOICON);
|
peak_meter_max, NULL, NULL, Icon_NOICON);
|
||||||
MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON,
|
MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON,
|
||||||
&peak_meter_release, &peak_meter_hold,
|
&peak_meter_release, &peak_meter_hold,
|
||||||
&peak_meter_clip_hold, &peak_meter_clipcounter,
|
&peak_meter_clip_hold,
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
|
&peak_meter_clipcounter,
|
||||||
|
#endif
|
||||||
&peak_meter_scale_item, &peak_meter_min_item, &peak_meter_max_item);
|
&peak_meter_scale_item, &peak_meter_min_item, &peak_meter_max_item);
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
/* PEAK METER MENU */
|
/* PEAK METER MENU */
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,6 @@ static bool pm_clip_right = false;
|
||||||
static long pm_clip_timeout_l; /* clip hold timeouts */
|
static long pm_clip_timeout_l; /* clip hold timeouts */
|
||||||
static long pm_clip_timeout_r;
|
static long pm_clip_timeout_r;
|
||||||
|
|
||||||
/* clipping counter (only used for recording) */
|
|
||||||
static unsigned int pm_clipcount = 0; /* clipping count */
|
|
||||||
static bool pm_clipcount_active = false; /* counting or not */
|
|
||||||
|
|
||||||
/* Temporarily en- / disables peak meter. This is especially for external
|
/* Temporarily en- / disables peak meter. This is especially for external
|
||||||
applications to detect if the peak_meter is in use and needs drawing at all */
|
applications to detect if the peak_meter is in use and needs drawing at all */
|
||||||
bool peak_meter_enabled = true;
|
bool peak_meter_enabled = true;
|
||||||
|
|
@ -118,6 +114,10 @@ static long trig_lowtime;
|
||||||
static int trig_status = TRIG_OFF;
|
static int trig_status = TRIG_OFF;
|
||||||
|
|
||||||
static void (*trigger_listener)(int) = NULL;
|
static void (*trigger_listener)(int) = NULL;
|
||||||
|
|
||||||
|
/* clipping counter (only used for recording) */
|
||||||
|
static unsigned int pm_clipcount = 0; /* clipping count */
|
||||||
|
static bool pm_clipcount_active = false; /* counting or not */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* debug only */
|
/* debug only */
|
||||||
|
|
@ -496,6 +496,7 @@ void peak_meter_init_times(int release, int hold, int clip_hold)
|
||||||
pm_clip_hold = clip_hold;
|
pm_clip_hold = clip_hold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
/**
|
/**
|
||||||
* Enable/disable clip counting
|
* Enable/disable clip counting
|
||||||
*/
|
*/
|
||||||
|
|
@ -519,6 +520,7 @@ void pm_reset_clipcount(void)
|
||||||
{
|
{
|
||||||
pm_clipcount = 0;
|
pm_clipcount = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the source of the peak meter to playback or to
|
* Set the source of the peak meter to playback or to
|
||||||
|
|
@ -566,7 +568,9 @@ static void set_trig_status(int new_state)
|
||||||
void peak_meter_peek(void)
|
void peak_meter_peek(void)
|
||||||
{
|
{
|
||||||
int left, right;
|
int left, right;
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
bool was_clipping = pm_clip_left || pm_clip_right;
|
bool was_clipping = pm_clip_left || pm_clip_right;
|
||||||
|
#endif
|
||||||
/* read current values */
|
/* read current values */
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
if (pm_playback)
|
if (pm_playback)
|
||||||
|
|
@ -617,11 +621,13 @@ void peak_meter_peek(void)
|
||||||
current_tick + clip_time_out[pm_clip_hold];
|
current_tick + clip_time_out[pm_clip_hold];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
if(!was_clipping && (pm_clip_left || pm_clip_right))
|
if(!was_clipping && (pm_clip_left || pm_clip_right))
|
||||||
{
|
{
|
||||||
if(pm_clipcount_active)
|
if(pm_clipcount_active)
|
||||||
pm_clipcount++;
|
pm_clipcount++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* peaks are searched -> we have to find the maximum. When
|
/* peaks are searched -> we have to find the maximum. When
|
||||||
many calls of peak_meter_peek the maximum value will be
|
many calls of peak_meter_peek the maximum value will be
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,9 @@ struct user_settings
|
||||||
bool peak_meter_dbfs; /* show linear or dbfs values */
|
bool peak_meter_dbfs; /* show linear or dbfs values */
|
||||||
int peak_meter_min; /* range minimum */
|
int peak_meter_min; /* range minimum */
|
||||||
int peak_meter_max; /* range maximum */
|
int peak_meter_max; /* range maximum */
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
bool peak_meter_clipcounter; /* clipping count indicator */
|
bool peak_meter_clipcounter; /* clipping count indicator */
|
||||||
|
#endif
|
||||||
bool car_adapter_mode; /* 0=off 1=on */
|
bool car_adapter_mode; /* 0=off 1=on */
|
||||||
|
|
||||||
/* show status bar */
|
/* show status bar */
|
||||||
|
|
|
||||||
|
|
@ -712,9 +712,11 @@ const struct settings_list settings[] = {
|
||||||
OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
|
OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
|
||||||
{F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED},
|
{F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED},
|
||||||
{F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED},
|
{F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED},
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
OFFON_SETTING(0,peak_meter_clipcounter,LANG_PM_CLIPCOUNTER,false,
|
OFFON_SETTING(0,peak_meter_clipcounter,LANG_PM_CLIPCOUNTER,false,
|
||||||
"peak meter clipcounter",NULL),
|
"peak meter clipcounter",NULL),
|
||||||
#endif
|
#endif /* HAVE_RECORDING */
|
||||||
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
||||||
SOUND_SETTING(0, mdb_strength, LANG_MDB_STRENGTH,
|
SOUND_SETTING(0, mdb_strength, LANG_MDB_STRENGTH,
|
||||||
"mdb strength", SOUND_MDB_STRENGTH),
|
"mdb strength", SOUND_MDB_STRENGTH),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue