forked from len0rd/rockbox
aced667 forgot about those pesky __PCTOOL__ things.
It was so close to aced666. Change-Id: I2b952a0704bb2d006db5e3ea4a929db3118cf390
This commit is contained in:
parent
aced667f48
commit
12bc24adbf
1 changed files with 15 additions and 15 deletions
30
apps/misc.c
30
apps/misc.c
|
|
@ -1004,6 +1004,21 @@ void replaygain_update(void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CODEC == SWCODEC */
|
#endif /* CONFIG_CODEC == SWCODEC */
|
||||||
|
|
||||||
|
/* format a sound value like: -1.05 dB */
|
||||||
|
int format_sound_value(char *buf, size_t size, int snd, int val)
|
||||||
|
{
|
||||||
|
int numdec = sound_numdecimals(snd);
|
||||||
|
const char *unit = sound_unit(snd);
|
||||||
|
int physval = sound_val2phys(snd, val);
|
||||||
|
|
||||||
|
unsigned int factor = ipow(10, numdec);
|
||||||
|
unsigned int av = abs(physval);
|
||||||
|
unsigned int i = av / factor;
|
||||||
|
unsigned int d = av - i*factor;
|
||||||
|
return snprintf(buf, size, "%c%u%.*s%.*u %s", " -"[physval < 0],
|
||||||
|
i, numdec, ".", numdec, d, unit);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* !defined(__PCTOOL__) */
|
#endif /* !defined(__PCTOOL__) */
|
||||||
|
|
||||||
/* Read (up to) a line of text from fd into buffer and return number of bytes
|
/* Read (up to) a line of text from fd into buffer and return number of bytes
|
||||||
|
|
@ -1253,18 +1268,3 @@ enum current_activity get_current_activity(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* format a sound value like: -1.05 dB */
|
|
||||||
int format_sound_value(char *buf, size_t size, int snd, int val)
|
|
||||||
{
|
|
||||||
int numdec = sound_numdecimals(snd);
|
|
||||||
const char *unit = sound_unit(snd);
|
|
||||||
int physval = sound_val2phys(snd, val);
|
|
||||||
|
|
||||||
unsigned int factor = ipow(10, numdec);
|
|
||||||
unsigned int av = abs(physval);
|
|
||||||
unsigned int i = av / factor;
|
|
||||||
unsigned int d = av - i*factor;
|
|
||||||
return snprintf(buf, size, "%c%u%.*s%.*u %s", " -"[physval < 0],
|
|
||||||
i, numdec, ".", numdec, d, unit);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue