mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
talk: Make talk_voice_required() local to talk.c
Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
This commit is contained in:
parent
60dea95cad
commit
57000b513b
3 changed files with 13 additions and 22 deletions
26
apps/talk.c
26
apps/talk.c
|
@ -797,6 +797,16 @@ static void queue_clip(unsigned long clip_offset, long size, bool enqueue)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
/* return if a voice codec is required or not */
|
||||||
|
static bool talk_voice_required(void)
|
||||||
|
{
|
||||||
|
return (has_voicefile) /* Voice file is available */
|
||||||
|
|| (global_settings.talk_dir_clip) /* Thumbnail clips are required */
|
||||||
|
|| (global_settings.talk_file_clip);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/***************** Public implementation *****************/
|
/***************** Public implementation *****************/
|
||||||
|
|
||||||
void talk_init(void)
|
void talk_init(void)
|
||||||
|
@ -877,9 +887,9 @@ void talk_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
/* Safe to init voice playback engine now since we now know if talk is
|
/* Initialize the actual voice clip playback engine as well */
|
||||||
required or not */
|
if (talk_voice_required())
|
||||||
voice_thread_init();
|
voice_thread_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -887,16 +897,6 @@ out:
|
||||||
filehandle = -1;
|
filehandle = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_CODEC == SWCODEC
|
|
||||||
/* return if a voice codec is required or not */
|
|
||||||
bool talk_voice_required(void)
|
|
||||||
{
|
|
||||||
return (has_voicefile) /* Voice file is available */
|
|
||||||
|| (global_settings.talk_dir_clip) /* Thumbnail clips are required */
|
|
||||||
|| (global_settings.talk_file_clip);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* somebody else claims the mp3 buffer, e.g. for regular play/record */
|
/* somebody else claims the mp3 buffer, e.g. for regular play/record */
|
||||||
void talk_buffer_set_policy(int policy)
|
void talk_buffer_set_policy(int policy)
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,9 +96,6 @@ extern const char* const dir_thumbnail_name; /* "_dirname.talk" */
|
||||||
extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */
|
extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */
|
||||||
|
|
||||||
void talk_init(void);
|
void talk_init(void);
|
||||||
#if CONFIG_CODEC == SWCODEC
|
|
||||||
bool talk_voice_required(void); /* returns true if voice codec required */
|
|
||||||
#endif
|
|
||||||
int talk_get_bufsize(void); /* get the loaded voice file size */
|
int talk_get_bufsize(void); /* get the loaded voice file size */
|
||||||
size_t talkbuf_init(char* bufstart);
|
size_t talkbuf_init(char* bufstart);
|
||||||
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? */
|
||||||
|
|
|
@ -526,12 +526,6 @@ void voice_thread_init(void)
|
||||||
if (voice_thread_id != 0)
|
if (voice_thread_id != 0)
|
||||||
return; /* Already did an init and succeeded at it */
|
return; /* Already did an init and succeeded at it */
|
||||||
|
|
||||||
if (!talk_voice_required())
|
|
||||||
{
|
|
||||||
logf("No voice required");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
voice_buf_hid = core_alloc_ex("voice buf", sizeof (*voice_buf), &ops);
|
voice_buf_hid = core_alloc_ex("voice buf", sizeof (*voice_buf), &ops);
|
||||||
|
|
||||||
if (voice_buf_hid <= 0)
|
if (voice_buf_hid <= 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue