From c14430a9c198c261990ceff77bdfa0856ebcf5fe Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 7 Nov 2007 09:28:07 +0000 Subject: compile talk.c on hwcodec sim. it wont actually talk though git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15512 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 2 -- apps/screens.c | 4 +--- apps/talk.c | 5 ++++- apps/talk.h | 14 +------------- firmware/mp3_playback.c | 21 ++++++++++++++++++++- uisimulator/common/stubs.c | 47 ---------------------------------------------- 6 files changed, 26 insertions(+), 67 deletions(-) diff --git a/apps/SOURCES b/apps/SOURCES index dc5b987b61..d50da979ad 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -36,9 +36,7 @@ settings.c settings_list.c status.c cuesheet.c -#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC talk.c -#endif tree.c #ifdef HAVE_TAGCACHE tagtree.c diff --git a/apps/screens.c b/apps/screens.c index ecd989043b..642d523c1d 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -1286,14 +1286,12 @@ static char* runtime_get_data(int selected_item, void* data, char* buffer) static int runtime_speak_data(int selected_item, void* data) { - (void) data;(void)selected_item; -#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC + (void) data; long title_ids[] = {LANG_RUNNING_TIME, LANG_TOP_TIME}; talk_ids(false, title_ids[selected_item/2], TALK_ID((selected_item == 0) ? global_status.runtime : global_status.topruntime, UNIT_TIME)); -#endif return 0; } diff --git a/apps/talk.c b/apps/talk.c index a7baf4927a..9b699a566d 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -347,6 +347,9 @@ void talk_force_shutup(void) { /* Most of this is MAS only */ #if CONFIG_CODEC != SWCODEC +#ifdef SIMULATOR + return; +#endif unsigned char* pos; unsigned char* search; unsigned char* end; @@ -656,7 +659,7 @@ int talk_file(const char* filename, bool enqueue) if (size != 0 && size != size_for_thumbnail) /* Don't play missing or truncated clips */ { -#if CONFIG_CODEC != SWCODEC +#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR) bitswap(p_thumbnail, size); #endif queue_clip(p_thumbnail, size, enqueue); diff --git a/apps/talk.h b/apps/talk.h index bb05bd8321..50759bc026 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -93,18 +93,6 @@ void talk_date(struct tm *tm, bool enqueue); /* This (otherwise invalid) ID signals the end of the array. */ #define TALK_FINAL_ID LANG_LAST_INDEX_IN_ARRAY -/* We don't build talk.c for hwcodec sims so we need to define these as empty */ -#if defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC) -#define talk_init(...) -#define talk_buffer_steal(...) -#define talk_shutup(...) -#define talk_force_enqueue_next(...) -#define talk_idarray(...) -#define talk_ids(...) -#define cond_talk_ids(...) -#define cond_talk_ids_fq(...) -#else - /* Enqueue next utterance even if enqueue parameter is false: don't interrupt the current utterance. */ void talk_force_enqueue_next(void); @@ -135,5 +123,5 @@ int talk_idarray(long *idarray, bool enqueue); talk_force_enqueue_next(); \ } \ }while(0) -#endif /*defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC)*/ + #endif /* __TALK_H__ */ diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c index c5c747ac2c..b2b7205318 100644 --- a/firmware/mp3_playback.c +++ b/firmware/mp3_playback.c @@ -590,6 +590,25 @@ unsigned char* mp3_get_pos(void) { return (unsigned char*)SAR3; } +#else /* #ifndef SIMULATOR */ +void mp3_play_pause(bool play) +{ + (void)play; +} +void mp3_play_stop(void) +{ +} -#endif /* #ifndef SIMULATOR */ +unsigned char* mp3_get_pos(void) +{ + return NULL; +} + +void mp3_play_data(const unsigned char* start, int size, + void (*get_more)(unsigned char** start, size_t* size) /* callback fn */ +) +{ + (void)start; (void)size; (void)get_more; +} +#endif diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index 00716b39c6..c40d10082c 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c @@ -301,53 +301,6 @@ void button_set_flip(bool yesno) (void)yesno; } -#if CONFIG_CODEC != SWCODEC - -int talk_id(int id, bool enqueue) -{ - (void)id; - (void)enqueue; - return 0; -} - -int talk_file(char* filename, bool enqueue) -{ - (void)filename; - (void)enqueue; - return 0; -} - -int talk_value(int n, int unit, bool enqueue) -{ - (void)n; - (void)unit; - (void)enqueue; - return 0; -} - -int talk_number(int n, bool enqueue) -{ - (void)n; - (void)enqueue; - return 0; -} - -int talk_spell(char* spell, bool enqueue) -{ - (void)spell; - (void)enqueue; - return 0; -} - -void talk_disable(bool disable) -{ - (void) disable; -} - -const char* const dir_thumbnail_name = "_dirname.talk"; -const char* const file_thumbnail_ext = ".talk"; -#endif - /* assure an unused place to direct virtual pointers to */ #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */ unsigned char vp_dummy[VIRT_SIZE]; -- cgit