From 74f358cf8b909aab5d1b9a157765ef6dcd8fe9dc Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 21 May 2020 12:55:32 -0500 Subject: talk.h add init status to debug menu g#2272 adds checks for incompatible version & proper number of clips Currently incompatible talk files will logf when failure to load occurs Adds a message to Debug > Talk engine stats 'Talk Status: OK' 'Talk Status: ERR Incompatible voice file' 'Talk Status: ERR (#)' -- OOM, Alloc Error Change-Id: Ifd2c1f38f710541c9cd929b8abf67bba4363ca53 --- apps/talk.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/talk.h') diff --git a/apps/talk.h b/apps/talk.h index a643cd4f89..bfd8e496af 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -55,6 +55,15 @@ enum { UNIT_LAST /* END MARKER */ }; +/* Status of loading talk file, shown in debug_menu */ +enum talk_status { + TALK_STATUS_OK = 0, + TALK_STATUS_ERR_OOM, + TALK_STATUS_ERR_ALLOC, + TALK_STATUS_ERR_NOFILE, + TALK_STATUS_ERR_INCOMPATIBLE +}; + #define UNIT_SHIFT (32-5) /* this many bits left from UNIT_xx enum */ #define DECIMAL_SHIFT (32 - 8) @@ -174,6 +183,7 @@ struct talk_debug_data { int cached_clips; int cache_hits; int cache_misses; + enum talk_status status; }; bool talk_get_debug_data(struct talk_debug_data *data); -- cgit v1.2.3