mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Delete unused function, const police, minor style police
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18664 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0326055f91
commit
b82fd56e0f
2 changed files with 17 additions and 47 deletions
50
apps/talk.c
50
apps/talk.c
|
@ -634,7 +634,7 @@ int talk_id(int32_t id, bool enqueue)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Speaks zero or more IDs (from an array). */
|
/* Speaks zero or more IDs (from an array). */
|
||||||
int talk_idarray(long *ids, bool enqueue)
|
int talk_idarray(const long *ids, bool enqueue)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
if(!ids)
|
if(!ids)
|
||||||
|
@ -657,7 +657,8 @@ void talk_force_enqueue_next(void)
|
||||||
/* play a thumbnail from file */
|
/* play a thumbnail from file */
|
||||||
/* Returns size of spoken thumbnail, so >0 means something is spoken,
|
/* Returns size of spoken thumbnail, so >0 means something is spoken,
|
||||||
<=0 means something went wrong. */
|
<=0 means something went wrong. */
|
||||||
static int _talk_file(const char* filename, long *prefix_ids, bool enqueue)
|
static int _talk_file(const char* filename,
|
||||||
|
const long *prefix_ids, bool enqueue)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int size;
|
int size;
|
||||||
|
@ -729,9 +730,8 @@ static int _talk_file(const char* filename, long *prefix_ids, bool enqueue)
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int talk_file(const char *root, const char *dir, const char *file,
|
||||||
talk_file(const char *root, const char *dir, const char *file,
|
const char *ext, const long *prefix_ids, bool enqueue)
|
||||||
const char *ext, long *prefix_ids, bool enqueue)
|
|
||||||
/* Play a thumbnail file */
|
/* Play a thumbnail file */
|
||||||
{
|
{
|
||||||
char buf[MAX_PATH];
|
char buf[MAX_PATH];
|
||||||
|
@ -746,9 +746,8 @@ talk_file(const char *root, const char *dir, const char *file,
|
||||||
return _talk_file(buf, prefix_ids, enqueue);
|
return _talk_file(buf, prefix_ids, enqueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int talk_spell_basename(const char *path,
|
||||||
talk_spell_basename(const char *path,
|
const long *prefix_ids, bool enqueue)
|
||||||
long *prefix_ids, bool enqueue)
|
|
||||||
{
|
{
|
||||||
if(prefix_ids)
|
if(prefix_ids)
|
||||||
{
|
{
|
||||||
|
@ -771,7 +770,7 @@ talk_spell_basename(const char *path,
|
||||||
/* Play a file's .talk thumbnail, fallback to spelling the filename, or
|
/* Play a file's .talk thumbnail, fallback to spelling the filename, or
|
||||||
go straight to spelling depending on settings. */
|
go straight to spelling depending on settings. */
|
||||||
int talk_file_or_spell(const char *dirname, const char *filename,
|
int talk_file_or_spell(const char *dirname, const char *filename,
|
||||||
long *prefix_ids, bool enqueue)
|
const long *prefix_ids, bool enqueue)
|
||||||
{
|
{
|
||||||
if (global_settings.talk_file_clip)
|
if (global_settings.talk_file_clip)
|
||||||
{ /* .talk clips enabled */
|
{ /* .talk clips enabled */
|
||||||
|
@ -788,7 +787,7 @@ int talk_file_or_spell(const char *dirname, const char *filename,
|
||||||
/* Play a directory's .talk thumbnail, fallback to spelling the filename, or
|
/* Play a directory's .talk thumbnail, fallback to spelling the filename, or
|
||||||
go straight to spelling depending on settings. */
|
go straight to spelling depending on settings. */
|
||||||
int talk_dir_or_spell(const char* dirname,
|
int talk_dir_or_spell(const char* dirname,
|
||||||
long *prefix_ids, bool enqueue)
|
const long *prefix_ids, bool enqueue)
|
||||||
{
|
{
|
||||||
if (global_settings.talk_dir_clip)
|
if (global_settings.talk_dir_clip)
|
||||||
{ /* .talk clips enabled */
|
{ /* .talk clips enabled */
|
||||||
|
@ -802,33 +801,6 @@ int talk_dir_or_spell(const char* dirname,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Speak thumbnail for each component of a full path, again falling
|
|
||||||
back or going straight to spelling depending on settings. */
|
|
||||||
int talk_fullpath(const char* path, bool enqueue)
|
|
||||||
{
|
|
||||||
if (!enqueue)
|
|
||||||
talk_shutup();
|
|
||||||
if(path[0] != '/')
|
|
||||||
/* path ought to start with /... */
|
|
||||||
return talk_spell(path, true);
|
|
||||||
talk_id(VOICE_CHAR_SLASH, true);
|
|
||||||
char buf[MAX_PATH];
|
|
||||||
strncpy(buf, path, MAX_PATH);
|
|
||||||
char *start = buf+1; /* start of current component */
|
|
||||||
char *ptr = strchr(start, '/'); /* end of current component */
|
|
||||||
while(ptr) { /* There are more slashes ahead */
|
|
||||||
/* temporarily poke a NULL at end of component to truncate string */
|
|
||||||
*ptr = '\0';
|
|
||||||
talk_dir_or_spell(buf, NULL, true);
|
|
||||||
*ptr = '/'; /* restore string */
|
|
||||||
talk_id(VOICE_CHAR_SLASH, true);
|
|
||||||
start = ptr+1; /* setup for next component */
|
|
||||||
ptr = strchr(start, '/');
|
|
||||||
}
|
|
||||||
/* no more slashes, final component is a filename */
|
|
||||||
return talk_file_or_spell(NULL, buf, NULL, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* say a numeric value, this word ordering works for english,
|
/* say a numeric value, this word ordering works for english,
|
||||||
but not necessarily for other languages (e.g. german) */
|
but not necessarily for other languages (e.g. german) */
|
||||||
int talk_number(long n, bool enqueue)
|
int talk_number(long n, bool enqueue)
|
||||||
|
@ -1099,14 +1071,14 @@ void talk_setting(const void *global_settings_variable)
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
void talk_date(struct tm *tm, bool enqueue)
|
void talk_date(const struct tm *tm, bool enqueue)
|
||||||
{
|
{
|
||||||
talk_id(LANG_MONTH_JANUARY + tm->tm_mon, enqueue);
|
talk_id(LANG_MONTH_JANUARY + tm->tm_mon, enqueue);
|
||||||
talk_number(tm->tm_mday, true);
|
talk_number(tm->tm_mday, true);
|
||||||
talk_number(1900 + tm->tm_year, true);
|
talk_number(1900 + tm->tm_year, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void talk_time(struct tm *tm, bool enqueue)
|
void talk_time(const struct tm *tm, bool enqueue)
|
||||||
{
|
{
|
||||||
if (global_settings.timeformat == 1)
|
if (global_settings.timeformat == 1)
|
||||||
{
|
{
|
||||||
|
|
14
apps/talk.h
14
apps/talk.h
|
@ -86,15 +86,13 @@ bool is_voice_queued(void); /* Are there more voice clips to be spoken? */
|
||||||
int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */
|
int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */
|
||||||
/* play a thumbnail from file */
|
/* play a thumbnail from file */
|
||||||
int talk_file(const char *root, const char *dir, const char *file,
|
int talk_file(const char *root, const char *dir, const char *file,
|
||||||
const char *ext, long *prefix_ids, bool enqueue);
|
const char *ext, const long *prefix_ids, bool enqueue);
|
||||||
/* play file's thumbnail or spell name */
|
/* play file's thumbnail or spell name */
|
||||||
int talk_file_or_spell(const char *dirname, const char* filename,
|
int talk_file_or_spell(const char *dirname, const char* filename,
|
||||||
long *prefix_ids, bool enqueue);
|
const long *prefix_ids, bool enqueue);
|
||||||
/* play dir's thumbnail or spell name */
|
/* play dir's thumbnail or spell name */
|
||||||
int talk_dir_or_spell(const char* filename,
|
int talk_dir_or_spell(const char* filename,
|
||||||
long *prefix_ids, bool enqueue);
|
const long *prefix_ids, bool enqueue);
|
||||||
/* play thumbnails for each components of full path, or spell */
|
|
||||||
int talk_fullpath(const char* path, bool enqueue);
|
|
||||||
int talk_number(long n, bool enqueue); /* say a number */
|
int talk_number(long n, bool enqueue); /* say a number */
|
||||||
int talk_value(long n, int unit, bool enqueue); /* say a numeric value */
|
int talk_value(long n, int unit, bool enqueue); /* say a numeric value */
|
||||||
int talk_value_decimal(long n, int unit, int decimals, bool enqueue);
|
int talk_value_decimal(long n, int unit, int decimals, bool enqueue);
|
||||||
|
@ -108,8 +106,8 @@ void talk_shutup(void); /* Interrupt voice, as when enqueue is false */
|
||||||
void talk_fractional(char *tbuf, int value, int unit);
|
void talk_fractional(char *tbuf, int value, int unit);
|
||||||
|
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
void talk_time(struct tm *tm, bool enqueue);
|
void talk_time(const struct tm *tm, bool enqueue);
|
||||||
void talk_date(struct tm *tm, bool enqueue);
|
void talk_date(const struct tm *tm, bool enqueue);
|
||||||
#endif /* CONFIG_RTC */
|
#endif /* CONFIG_RTC */
|
||||||
|
|
||||||
/* This (otherwise invalid) ID signals the end of the array. */
|
/* This (otherwise invalid) ID signals the end of the array. */
|
||||||
|
@ -120,7 +118,7 @@ void talk_date(struct tm *tm, bool enqueue);
|
||||||
void talk_force_enqueue_next(void);
|
void talk_force_enqueue_next(void);
|
||||||
|
|
||||||
/* speaks one or more IDs (from an array)). */
|
/* speaks one or more IDs (from an array)). */
|
||||||
int talk_idarray(long *idarray, bool enqueue);
|
int talk_idarray(const long *idarray, bool enqueue);
|
||||||
/* This makes an initializer for the array of IDs and takes care to
|
/* This makes an initializer for the array of IDs and takes care to
|
||||||
put the final sentinel element at the end. */
|
put the final sentinel element at the end. */
|
||||||
#define TALK_IDARRAY(ids...) ((long[]){ids,TALK_FINAL_ID})
|
#define TALK_IDARRAY(ids...) ((long[]){ids,TALK_FINAL_ID})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue