Make peakmeter release setting work in units per tick (was units per read), add the unit and make it voiced. Make old leftover in lang file deprecated

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14390 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2007-08-18 23:03:03 +00:00
parent 022d026594
commit ebcf06d237
6 changed files with 35 additions and 11 deletions

View file

@ -42,6 +42,7 @@ static const char *unit_strings[] =
[UNIT_PER_SEC] = "per sec",
[UNIT_HERTZ] = "Hz",
[UNIT_MB] = "MB", [UNIT_KBIT] = "kb/s",
[UNIT_PM_TICK] = "units/10ms",
};
char *option_get_valuestring(struct settings_list *setting,

View file

@ -3566,19 +3566,16 @@
</phrase>
<phrase>
id: LANG_PM_UNITS_PER_READ
desc: in the peak meter menu
desc: DEPRECATED
user:
<source>
*: "Units Per Read"
masd: none
*: ""
</source>
<dest>
*: "Units Per Read"
masd: none
*: ""
</dest>
<voice>
*: "Units Per Read"
masd: none
*: ""
</voice>
</phrase>
<phrase>
@ -11043,3 +11040,17 @@
*: "Only when viewing all types"
</voice>
</phrase>
<phrase>
id: VOICE_PM_UNITS_PER_TICK
desc: spoken only, peak meter release unit
user:
<source>
*: ""
</source>
<dest>
*: ""
</dest>
<voice>
*: "units per tick"
</voice>
</phrase>

View file

@ -880,6 +880,7 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
int left = 0, right = 0;
int meterwidth = width - 3;
int i;
static long peak_release_tick = 0;
#ifdef PM_DEBUG
static long pm_tick = 0;
@ -934,9 +935,17 @@ void peak_meter_draw(struct screen *display, struct meter_scales *scales,
}
/* apply release */
left = MAX(left , scales->last_left - pm_peak_release);
right = MAX(right, scales->last_right - pm_peak_release);
if(current_tick != peak_release_tick)
{
peak_release_tick = current_tick;
left = MAX(left , scales->last_left - pm_peak_release);
right = MAX(right, scales->last_right - pm_peak_release);
}
else
{
left = MAX(left , scales->last_left);
right = MAX(right, scales->last_right);
}
/* reset max values after timeout */
if (TIME_AFTER(current_tick, scales->pm_peak_timeout_l)){
scales->pm_peak_left = 0;

View file

@ -708,7 +708,7 @@ const struct settings_list settings[] = {
TALK_ID(10, UNIT_SEC), TALK_ID(15, UNIT_SEC), TALK_ID(20, UNIT_SEC),
TALK_ID(30, UNIT_SEC), TALK_ID(60, UNIT_SEC)),
INT_SETTING(0, peak_meter_release, LANG_PM_RELEASE, 8, "peak meter release",
UNIT_INT, 1, 0x7e, 1, NULL, NULL,NULL),
UNIT_PM_TICK, 1, 0x7e, 1, NULL, NULL,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_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED},

View file

@ -782,6 +782,8 @@ int talk_value(long n, int unit, bool enqueue)
= LANG_MEGABYTE,
[UNIT_KBIT]
= VOICE_KBIT_PER_SEC,
[UNIT_PM_TICK]
= VOICE_PM_UNITS_PER_TICK,
};
#if CONFIG_CODEC != SWCODEC

View file

@ -43,6 +43,7 @@ enum {
UNIT_HERTZ, /* hertz */
UNIT_MB, /* Megabytes */
UNIT_KBIT, /* kilobits per sec */
UNIT_PM_TICK, /* peak meter units per tick */
UNIT_LAST /* END MARKER */
};