summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-12-11 10:27:14 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-12-11 10:27:14 +0000
commit489436385f6f4543c3bc7e2d4c945f2440a611bb (patch)
tree9198629010184adaf2f56df9cee600f91568690f
parentc2513580cbe8b94f9c229f8a8d518136ad75facc (diff)
downloadrockbox-489436385f6f4543c3bc7e2d4c945f2440a611bb.zip
rockbox-489436385f6f4543c3bc7e2d4c945f2440a611bb.tar.gz
rockbox-489436385f6f4543c3bc7e2d4c945f2440a611bb.tar.bz2
rockbox-489436385f6f4543c3bc7e2d4c945f2440a611bb.tar.xz
Add talk support to the shortcuts menu.
'talkclip: <filename>' in the [shortcut] will cause the list to .talk the file specified. (.talk files are the same filetype as gets talked by the file listing... hopefully we can add rbutil support to generate these) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31210 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/shortcuts.c18
-rw-r--r--manual/main_menu/main.tex1
2 files changed, 19 insertions, 0 deletions
diff --git a/apps/shortcuts.c b/apps/shortcuts.c
index e8ea1df..75e005b 100644
--- a/apps/shortcuts.c
+++ b/apps/shortcuts.c
@@ -43,6 +43,7 @@
#include "shortcuts.h"
#include "onplay.h"
#include "screens.h"
+#include "talk.h"
#define MAX_SHORTCUT_NAME 32
@@ -61,6 +62,7 @@ static const char * const type_strings[SHORTCUT_TYPE_COUNT] = {
struct shortcut {
enum shortcut_type type;
char name[MAX_SHORTCUT_NAME];
+ char talk_clip[MAX_PATH];
int icon;
union {
char path[MAX_PATH];
@@ -161,6 +163,7 @@ static void init_shortcut(struct shortcut* sc)
sc->type = SHORTCUT_UNDEFINED;
sc->name[0] = '\0';
sc->u.path[0] = '\0';
+ sc->talk_clip[0] = '\0';
sc->icon = Icon_NOICON;
}
@@ -296,6 +299,10 @@ int readline_cb(int n, char *buf, void *parameters)
sc->icon = atoi(value);
}
}
+ else if (!strcmp(name, "talkclip"))
+ {
+ strlcpy(sc->talk_clip, value, MAX_PATH);
+ }
}
return 0;
}
@@ -381,6 +388,15 @@ static enum themable_icons shortcut_menu_get_icon(int selected_item, void * data
return sc->icon;
}
+int shortcut_menu_speak_item(int selected_item, void * data)
+{
+ (void)data;
+ struct shortcut *sc = get_shortcut(selected_item);
+ if (sc && sc->talk_clip[0])
+ talk_file(NULL, NULL, sc->talk_clip, NULL, NULL, false);
+ return 0;
+}
+
void talk_timedate(void);
const char* sleep_timer_formatter(char* buffer, size_t buffer_size,
int value, const char* unit);
@@ -399,6 +415,8 @@ int do_shortcut_menu(void *ignored)
if (global_settings.show_icons)
list.get_icon = shortcut_menu_get_icon;
list.title_icon = Icon_Bookmark;
+ if (global_settings.talk_menu)
+ list.get_talk = shortcut_menu_speak_item;
push_current_activity(ACTIVITY_SHORTCUTSMENU);
diff --git a/manual/main_menu/main.tex b/manual/main_menu/main.tex
index 41e16ba..33e64c1 100644
--- a/manual/main_menu/main.tex
+++ b/manual/main_menu/main.tex
@@ -298,6 +298,7 @@ each item to be displayed. Each shortcut looks like the following:
data: <what the shortcut actually links to>
name: <what the shortcut should be displayed as>
icon: <number of the theme icon to use (see \wikilink{CustomIcons})>
+ talkclip: <filename of a talk clip to speak when voice menus are enabled>
\end{example}
Only ``type'' and ``data'' are required (except if type is ``separator'' in which case