mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Make id's created with the TALK_ID macro work in 64 bit sims
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15723 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ade8ae9acb
commit
acbd780239
6 changed files with 21 additions and 20 deletions
|
|
@ -152,9 +152,9 @@ static int option_talk(int selected_item, void * data)
|
||||||
{
|
{
|
||||||
struct int_setting *info = setting->int_setting;
|
struct int_setting *info = setting->int_setting;
|
||||||
if (info->get_talk_id)
|
if (info->get_talk_id)
|
||||||
talk_id(info->get_talk_id((int)temp_var), false);
|
talk_id(info->get_talk_id(temp_var), false);
|
||||||
else
|
else
|
||||||
talk_value((int)temp_var, info->unit, false);
|
talk_value(temp_var, info->unit, false);
|
||||||
}
|
}
|
||||||
else if ((setting->flags & F_T_SOUND) == F_T_SOUND)
|
else if ((setting->flags & F_T_SOUND) == F_T_SOUND)
|
||||||
{
|
{
|
||||||
|
|
@ -477,7 +477,7 @@ void set_option_formatter(char* buf, size_t size, int item, const char* unit)
|
||||||
const unsigned char *text = set_option_options[item].string;
|
const unsigned char *text = set_option_options[item].string;
|
||||||
snprintf(buf, size, "%s", P2STR(text));
|
snprintf(buf, size, "%s", P2STR(text));
|
||||||
}
|
}
|
||||||
long set_option_get_talk_id(int value)
|
int32_t set_option_get_talk_id(int value)
|
||||||
{
|
{
|
||||||
return set_option_options[value].voice_id;
|
return set_option_options[value].voice_id;
|
||||||
}
|
}
|
||||||
|
|
@ -518,7 +518,7 @@ bool set_int_ex(const unsigned char* string,
|
||||||
int min,
|
int min,
|
||||||
int max,
|
int max,
|
||||||
void (*formatter)(char*, size_t, int, const char*),
|
void (*formatter)(char*, size_t, int, const char*),
|
||||||
long (*get_talk_id)(int))
|
int32_t (*get_talk_id)(int))
|
||||||
{
|
{
|
||||||
(void)unit;
|
(void)unit;
|
||||||
struct settings_list item;
|
struct settings_list item;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
struct opt_items {
|
struct opt_items {
|
||||||
unsigned const char* string;
|
unsigned const char* string;
|
||||||
long voice_id;
|
int32_t voice_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Setting values defines **/
|
/** Setting values defines **/
|
||||||
|
|
@ -254,7 +254,7 @@ bool set_int_ex(const unsigned char* string, const char* unit, int voice_unit,
|
||||||
int* variable,
|
int* variable,
|
||||||
void (*function)(int), int step, int min, int max,
|
void (*function)(int), int step, int min, int max,
|
||||||
void (*formatter)(char*, size_t, int, const char*),
|
void (*formatter)(char*, size_t, int, const char*),
|
||||||
long (*get_talk_id)(int));
|
int32_t (*get_talk_id)(int));
|
||||||
|
|
||||||
/* the following are either not in setting.c or shouldnt be */
|
/* the following are either not in setting.c or shouldnt be */
|
||||||
bool set_time_screen(const char* string, struct tm *tm);
|
bool set_time_screen(const char* string, struct tm *tm);
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ static const char trig_durations_conf [] =
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static long rectime_getlang(int value)
|
static int32_t rectime_getlang(int value)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return LANG_OFF;
|
return LANG_OFF;
|
||||||
|
|
@ -221,7 +221,7 @@ static void backlight_formatter(char *buffer, size_t buffer_size,
|
||||||
else
|
else
|
||||||
snprintf(buffer, buffer_size, "%d s", backlight_timeout_value[val]);
|
snprintf(buffer, buffer_size, "%d s", backlight_timeout_value[val]);
|
||||||
}
|
}
|
||||||
static long backlight_getlang(int value)
|
static int32_t backlight_getlang(int value)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return LANG_OFF;
|
return LANG_OFF;
|
||||||
|
|
@ -232,7 +232,7 @@ static long backlight_getlang(int value)
|
||||||
#endif
|
#endif
|
||||||
/* ffwd/rewind and scan acceleration stuff */
|
/* ffwd/rewind and scan acceleration stuff */
|
||||||
static const unsigned char ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60};
|
static const unsigned char ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60};
|
||||||
static long ff_rewind_min_step_getlang(int value)
|
static int32_t ff_rewind_min_step_getlang(int value)
|
||||||
{
|
{
|
||||||
return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
|
return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,7 @@ static void ff_rewind_min_step_formatter(char *buffer, size_t buffer_size,
|
||||||
(void)unit;
|
(void)unit;
|
||||||
snprintf(buffer, buffer_size, "%ds", ff_rewind_min_stepvals[val]);
|
snprintf(buffer, buffer_size, "%ds", ff_rewind_min_stepvals[val]);
|
||||||
}
|
}
|
||||||
static long scanaccel_getlang(int value)
|
static int32_t scanaccel_getlang(int value)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return LANG_OFF;
|
return LANG_OFF;
|
||||||
|
|
@ -259,7 +259,7 @@ static void scanaccel_formatter(char *buffer, size_t buffer_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unsigned char poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60};
|
static const unsigned char poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60};
|
||||||
static long poweroff_idle_timer_getlang(int value)
|
static int32_t poweroff_idle_timer_getlang(int value)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return LANG_OFF;
|
return LANG_OFF;
|
||||||
|
|
@ -276,7 +276,7 @@ static void poweroff_idle_timer_formatter(char *buffer, size_t buffer_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_SCROLLWHEEL
|
#ifndef HAVE_SCROLLWHEEL
|
||||||
static long listaccel_getlang(int value)
|
static int32_t listaccel_getlang(int value)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
return LANG_OFF;
|
return LANG_OFF;
|
||||||
|
|
@ -352,7 +352,7 @@ static void jumpscroll_format(char* buffer, size_t buffer_size, int value,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static long jumpscroll_getlang(int value)
|
static int32_t jumpscroll_getlang(int value)
|
||||||
{
|
{
|
||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ struct int_setting {
|
||||||
int max;
|
int max;
|
||||||
int step;
|
int step;
|
||||||
void (*formatter)(char*, size_t, int, const char*);
|
void (*formatter)(char*, size_t, int, const char*);
|
||||||
long (*get_talk_id)(int);
|
int32_t (*get_talk_id)(int);
|
||||||
};
|
};
|
||||||
#define F_INT_SETTING 0x80
|
#define F_INT_SETTING 0x80
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -559,11 +559,11 @@ void talk_buffer_steal(void)
|
||||||
|
|
||||||
|
|
||||||
/* play a voice ID from voicefile */
|
/* play a voice ID from voicefile */
|
||||||
int talk_id(long id, bool enqueue)
|
int talk_id(int32_t id, bool enqueue)
|
||||||
{
|
{
|
||||||
long clipsize;
|
long clipsize;
|
||||||
unsigned char* clipbuf;
|
unsigned char* clipbuf;
|
||||||
int unit;
|
int32_t unit;
|
||||||
|
|
||||||
if (talk_temp_disable_count > 0)
|
if (talk_temp_disable_count > 0)
|
||||||
return -1; /* talking has been disabled */
|
return -1; /* talking has been disabled */
|
||||||
|
|
@ -582,10 +582,10 @@ int talk_id(long id, bool enqueue)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* check if this is a special ID, with a value */
|
/* check if this is a special ID, with a value */
|
||||||
unit = ((unsigned long)id) >> UNIT_SHIFT;
|
unit = ((uint32_t)id) >> UNIT_SHIFT;
|
||||||
if (unit)
|
if (unit)
|
||||||
{ /* sign-extend the value */
|
{ /* sign-extend the value */
|
||||||
id = (unsigned long)id << (32-UNIT_SHIFT);
|
id = (uint32_t)id << (32-UNIT_SHIFT);
|
||||||
id >>= (32-UNIT_SHIFT);
|
id >>= (32-UNIT_SHIFT);
|
||||||
talk_value(id, unit, enqueue); /* speak it */
|
talk_value(id, unit, enqueue); /* speak it */
|
||||||
return 0; /* and stop, end of special case */
|
return 0; /* and stop, end of special case */
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#define __TALK_H__
|
#define __TALK_H__
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
|
|
||||||
#define VOICE_VERSION 400 /* 4.00 - if you change this, change it in voicefont too */
|
#define VOICE_VERSION 400 /* 4.00 - if you change this, change it in voicefont too */
|
||||||
|
|
@ -72,7 +73,7 @@ bool talk_voice_required(void); /* returns true if voice codec required */
|
||||||
int talk_get_bufsize(void); /* get the loaded voice file size */
|
int talk_get_bufsize(void); /* get the loaded voice file size */
|
||||||
void talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
|
void talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */
|
||||||
bool is_voice_queued(void); /* Are there more voice clips to be spoken? */
|
bool is_voice_queued(void); /* Are there more voice clips to be spoken? */
|
||||||
int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */
|
int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */
|
||||||
int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */
|
int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */
|
||||||
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 */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue