Speech feedback in the pictureflow plugin

Patch by Igor Poretsky

Change-Id: I99d789e43d1093c69b4d76f58704303d3c1b3c80
This commit is contained in:
Solomon Peachy 2019-08-05 22:03:45 -04:00
parent 2ebb8da275
commit b1f2c795a6
3 changed files with 759 additions and 35 deletions

View file

@ -15421,22 +15421,22 @@ id: VOICE_BAT_BENCH_KEYS
</phrase>
<phrase>
id: LANG_DISPLAY_FPS
desc: in the mpegplayer settings menu
desc: in the mpegplayer and pictureflow settings menus
user: core
<source>
*: none
swcodec: "Display FPS"
lowmem: none
lcd_bitmap: "Display FPS"
</source>
<dest>
*: none
swcodec: "Display FPS"
lowmem: none
lcd_bitmap: "Display FPS"
</dest>
<voice>
*: none
swcodec: "Display FPS"
lowmem: none
lcd_bitmap: "Display FPS"
</voice>
</phrase>
<phrase>
@ -16033,3 +16033,360 @@ id: VOICE_BAT_BENCH_KEYS
lowmem: none
</voice>
</phrase>
<phrase>
id: LANG_SPACING
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Spacing"
</source>
<dest>
*: none
lcd_bitmap: "Spacing"
</dest>
<voice>
*: none
lcd_bitmap: "Spacing"
</voice>
</phrase>
<phrase>
id: LANG_CENTRE_MARGIN
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Centre margin"
</source>
<dest>
*: none
lcd_bitmap: "Centre margin"
</dest>
<voice>
*: none
lcd_bitmap: "Centre margin"
</voice>
</phrase>
<phrase>
id: LANG_NUMBER_OF_SLIDES
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Number of slides"
</source>
<dest>
*: none
lcd_bitmap: "Number of slides"
</dest>
<voice>
*: none
lcd_bitmap: "Number of slides"
</voice>
</phrase>
<phrase>
id: LANG_ZOOM
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Zoom"
</source>
<dest>
*: none
lcd_bitmap: "Zoom"
</dest>
<voice>
*: none
lcd_bitmap: "Zoom"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_ALBUM_TITLE
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Show album title"
</source>
<dest>
*: none
lcd_bitmap: "Show album title"
</dest>
<voice>
*: none
lcd_bitmap: "Show album title"
</voice>
</phrase>
<phrase>
id: LANG_RESIZE_COVERS
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Resize Covers"
</source>
<dest>
*: none
lcd_bitmap: "Resize Covers"
</dest>
<voice>
*: none
lcd_bitmap: "Resize Covers"
</voice>
</phrase>
<phrase>
id: LANG_REBUILD_CACHE
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Rebuild cache"
</source>
<dest>
*: none
lcd_bitmap: "Rebuild cache"
</dest>
<voice>
*: none
lcd_bitmap: "Rebuild cache"
</voice>
</phrase>
<phrase>
id: LANG_WPS_INTEGRATION
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "WPS Integration"
</source>
<dest>
*: none
lcd_bitmap: "WPS Integration"
</dest>
<voice>
*: none
lcd_bitmap: "WPS Integration"
</voice>
</phrase>
<phrase>
id: LANG_GOTO_WPS
desc: in the pictureflow main menu
user: core
<source>
*: none
lcd_bitmap: "Go to WPS"
</source>
<dest>
*: none
lcd_bitmap: "Go to WPS"
</dest>
<voice>
*: none
lcd_bitmap: "Go to WPS"
</voice>
</phrase>
<phrase>
id: LANG_CLEAR_PLAYLIST
desc: in the pictureflow main menu
user: core
<source>
*: none
lcd_bitmap: "Clear playlist"
</source>
<dest>
*: none
lcd_bitmap: "Clear playlist"
</dest>
<voice>
*: none
lcd_bitmap: "Clear playlist"
</voice>
</phrase>
<phrase>
id: LANG_HIDE_ALBUM_TITLE
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Hide album title"
</source>
<dest>
*: none
lcd_bitmap: "Hide album title"
</dest>
<voice>
*: none
lcd_bitmap: "Hide album title"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_AT_THE_BOTTOM
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Show at the bottom"
</source>
<dest>
*: none
lcd_bitmap: "Show at the bottom"
</dest>
<voice>
*: none
lcd_bitmap: "Show at the bottom"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_AT_THE_TOP
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Show at the top"
</source>
<dest>
*: none
lcd_bitmap: "Show at the top"
</dest>
<voice>
*: none
lcd_bitmap: "Show at the top"
</voice>
</phrase>
<phrase>
id: LANG_DIRECT
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Direct"
</source>
<dest>
*: none
lcd_bitmap: "Direct"
</dest>
<voice>
*: none
lcd_bitmap: "Direct"
</voice>
</phrase>
<phrase>
id: LANG_VIA_TRACK_LIST
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Via Track list"
</source>
<dest>
*: none
lcd_bitmap: "Via Track list"
</dest>
<voice>
*: none
lcd_bitmap: "Via Track list"
</voice>
</phrase>
<phrase>
id: LANG_ALWAYS_ON
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Always On"
</source>
<dest>
*: none
lcd_bitmap: "Always On"
</dest>
<voice>
*: none
lcd_bitmap: "Always On"
</voice>
</phrase>
<phrase>
id: LANG_NO_ALBUMART_FOUND
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "No album art found"
</source>
<dest>
*: none
lcd_bitmap: "No album art found"
</dest>
<voice>
*: none
lcd_bitmap: "No album art found"
</voice>
</phrase>
<phrase>
id: LANG_CACHE_REBUILT_NEXT_RESTART
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Cache will be rebuilt on next restart"
</source>
<dest>
*: none
lcd_bitmap: "Cache will be rebuilt on next restart"
</dest>
<voice>
*: none
lcd_bitmap: "Cache will be rebuilt on next restart"
</voice>
</phrase>
<phrase>
id: LANG_PLAYLIST_CLEARED
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Playlist Cleared"
</source>
<dest>
*: none
lcd_bitmap: "Playlist Cleared"
</dest>
<voice>
*: none
lcd_bitmap: "Playlist Cleared"
</voice>
</phrase>
<phrase>
id: LANG_ADDED_TO_PLAYLIST
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Added to playlist"
</source>
<dest>
*: none
lcd_bitmap: "Added to playlist"
</dest>
<voice>
*: none
lcd_bitmap: "Added to playlist"
</voice>
</phrase>
<phrase>
id: LANG_ERROR_WRITING_CONFIG
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Error writing config"
</source>
<dest>
*: none
lcd_bitmap: "Error writing config"
</dest>
<voice>
*: none
lcd_bitmap: "Error writing config"
</voice>
</phrase>

View file

@ -13884,3 +13884,360 @@
lowmem: none
</voice>
</phrase>
<phrase>
id: LANG_SPACING
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Spacing"
</source>
<dest>
*: none
lcd_bitmap: "Разбивка"
</dest>
<voice>
*: none
lcd_bitmap: "Разбивка"
</voice>
</phrase>
<phrase>
id: LANG_CENTRE_MARGIN
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Centre margin"
</source>
<dest>
*: none
lcd_bitmap: "Центральное поле"
</dest>
<voice>
*: none
lcd_bitmap: "Центральное поле"
</voice>
</phrase>
<phrase>
id: LANG_NUMBER_OF_SLIDES
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Number of slides"
</source>
<dest>
*: none
lcd_bitmap: "Число слайдов"
</dest>
<voice>
*: none
lcd_bitmap: "Число слайдов"
</voice>
</phrase>
<phrase>
id: LANG_ZOOM
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Zoom"
</source>
<dest>
*: none
lcd_bitmap: "Увеличение"
</dest>
<voice>
*: none
lcd_bitmap: "Увеличение"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_ALBUM_TITLE
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Show album title"
</source>
<dest>
*: none
lcd_bitmap: "Показывать название альбома"
</dest>
<voice>
*: none
lcd_bitmap: "Показывать название альбома"
</voice>
</phrase>
<phrase>
id: LANG_RESIZE_COVERS
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Resize Covers"
</source>
<dest>
*: none
lcd_bitmap: "Изменить размер обложек"
</dest>
<voice>
*: none
lcd_bitmap: "Изменить размер обложек"
</voice>
</phrase>
<phrase>
id: LANG_REBUILD_CACHE
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Rebuild cache"
</source>
<dest>
*: none
lcd_bitmap: "Обновить кэш"
</dest>
<voice>
*: none
lcd_bitmap: "Обновить кэш"
</voice>
</phrase>
<phrase>
id: LANG_WPS_INTEGRATION
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "WPS Integration"
</source>
<dest>
*: none
lcd_bitmap: "Взаимодействие с экраном воспроизведения"
</dest>
<voice>
*: none
lcd_bitmap: "Взаимодействие с экраном воспроизведения"
</voice>
</phrase>
<phrase>
id: LANG_GOTO_WPS
desc: in the pictureflow main menu
user: core
<source>
*: none
lcd_bitmap: "Go to WPS"
</source>
<dest>
*: none
lcd_bitmap: "Перейти к экрану воспроизведения"
</dest>
<voice>
*: none
lcd_bitmap: "Перейти к экрану воспроизведения"
</voice>
</phrase>
<phrase>
id: LANG_CLEAR_PLAYLIST
desc: in the pictureflow main menu
user: core
<source>
*: none
lcd_bitmap: "Clear playlist"
</source>
<dest>
*: none
lcd_bitmap: "Очистить список воспроизведения"
</dest>
<voice>
*: none
lcd_bitmap: "Очистить список воспроизведения"
</voice>
</phrase>
<phrase>
id: LANG_HIDE_ALBUM_TITLE
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Hide album title"
</source>
<dest>
*: none
lcd_bitmap: "Скрыть название альбома"
</dest>
<voice>
*: none
lcd_bitmap: "Скрыть название альбома"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_AT_THE_BOTTOM
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Show at the bottom"
</source>
<dest>
*: none
lcd_bitmap: "Показывать внизу"
</dest>
<voice>
*: none
lcd_bitmap: "Показывать внизу"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_AT_THE_TOP
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Show at the top"
</source>
<dest>
*: none
lcd_bitmap: "Показывать вверху"
</dest>
<voice>
*: none
lcd_bitmap: "Показывать вверху"
</voice>
</phrase>
<phrase>
id: LANG_DIRECT
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Direct"
</source>
<dest>
*: none
lcd_bitmap: "Непосредственно"
</dest>
<voice>
*: none
lcd_bitmap: "Непосредственно"
</voice>
</phrase>
<phrase>
id: LANG_VIA_TRACK_LIST
desc: in the pictureflow settings
user: core
<source>
*: none
lcd_bitmap: "Via Track list"
</source>
<dest>
*: none
lcd_bitmap: "Через список треков"
</dest>
<voice>
*: none
lcd_bitmap: "Через список трэков"
</voice>
</phrase>
<phrase>
id: LANG_ALWAYS_ON
desc: in the pictureflow settings menu
user: core
<source>
*: none
lcd_bitmap: "Always On"
</source>
<dest>
*: none
lcd_bitmap: "Всегда включено"
</dest>
<voice>
*: none
lcd_bitmap: "Всегда включено"
</voice>
</phrase>
<phrase>
id: LANG_NO_ALBUMART_FOUND
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "No album art found"
</source>
<dest>
*: none
lcd_bitmap: "Обложек не найдено"
</dest>
<voice>
*: none
lcd_bitmap: "Обложек не найдено"
</voice>
</phrase>
<phrase>
id: LANG_CACHE_REBUILT_NEXT_RESTART
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Cache will be rebuilt on next restart"
</source>
<dest>
*: none
lcd_bitmap: "Кэш будет обновлен при перезапуске"
</dest>
<voice>
*: none
lcd_bitmap: "Кэш будет обновлен при перезапуске"
</voice>
</phrase>
<phrase>
id: LANG_PLAYLIST_CLEARED
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Playlist Cleared"
</source>
<dest>
*: none
lcd_bitmap: "Список воспроизведения очищен"
</dest>
<voice>
*: none
lcd_bitmap: "Список воспроизведения очищен"
</voice>
</phrase>
<phrase>
id: LANG_ADDED_TO_PLAYLIST
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Added to playlist"
</source>
<dest>
*: none
lcd_bitmap: "Добавлено к списку воспроизведения"
</dest>
<voice>
*: none
lcd_bitmap: "Добавлено к списку воспроизведения"
</voice>
</phrase>
<phrase>
id: LANG_ERROR_WRITING_CONFIG
desc: in the pictureflow splash messages
user: core
<source>
*: none
lcd_bitmap: "Error writing config"
</source>
<dest>
*: none
lcd_bitmap: "Ошибка при записи конфигурации"
</dest>
<voice>
*: none
lcd_bitmap: "Ошибка при записи конфигурации"
</voice>
</phrase>

View file

@ -1261,7 +1261,7 @@ static bool create_albumart_cache(void)
draw_progressbar(i);
if ( slides == 0 ) {
/* Warn the user that we couldn't find any albumart */
rb->splash(2*HZ, "No album art found");
rb->splash(2*HZ, ID2P(LANG_NO_ALBUMART_FOUND));
return false;
}
return true;
@ -2236,36 +2236,43 @@ static int settings_menu(void)
int selection = 0;
bool old_val;
MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, "Show FPS",
"Spacing", "Centre margin", "Number of slides", "Zoom",
"Show album title", "Resize Covers", "Rebuild cache",
"WPS Integration", "Backlight");
MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL,
ID2P(LANG_DISPLAY_FPS),
ID2P(LANG_SPACING),
ID2P(LANG_CENTRE_MARGIN),
ID2P(LANG_NUMBER_OF_SLIDES),
ID2P(LANG_ZOOM),
ID2P(LANG_SHOW_ALBUM_TITLE),
ID2P(LANG_RESIZE_COVERS),
ID2P(LANG_REBUILD_CACHE),
ID2P(LANG_WPS_INTEGRATION),
ID2P(LANG_BACKLIGHT));
static const struct opt_items album_name_options[] = {
{ "Hide album title", -1 },
{ "Show at the bottom", -1 },
{ "Show at the top", -1 }
{ STR(LANG_HIDE_ALBUM_TITLE) },
{ STR(LANG_SHOW_AT_THE_BOTTOM) },
{ STR(LANG_SHOW_AT_THE_TOP) }
};
static const struct opt_items wps_options[] = {
{ "Off", -1 },
{ "Direct", -1 },
{ "Via Track list", -1 }
{ STR(LANG_OFF) },
{ STR(LANG_DIRECT) },
{ STR(LANG_VIA_TRACK_LIST) }
};
static const struct opt_items backlight_options[] = {
{ "Always On", -1 },
{ "Normal", -1 },
{ STR(LANG_ALWAYS_ON) },
{ STR(LANG_NORMAL) },
};
do {
selection=rb->do_menu(&settings_menu,&selection, NULL, false);
switch(selection) {
case 0:
rb->set_bool("Show FPS", &show_fps);
rb->set_bool(rb->str(LANG_DISPLAY_FPS), &show_fps);
reset_track_list();
break;
case 1:
rb->set_int("Spacing between slides", "", 1,
rb->set_int(rb->str(LANG_SPACING), "", 1,
&slide_spacing,
NULL, 1, 0, 100, NULL );
recalc_offsets();
@ -2273,7 +2280,7 @@ static int settings_menu(void)
break;
case 2:
rb->set_int("Centre margin", "", 1,
rb->set_int(rb->str(LANG_CENTRE_MARGIN), "", 1,
&center_margin,
NULL, 1, 0, 80, NULL );
recalc_offsets();
@ -2281,20 +2288,20 @@ static int settings_menu(void)
break;
case 3:
rb->set_int("Number of slides", "", 1, &num_slides,
rb->set_int(rb->str(LANG_NUMBER_OF_SLIDES), "", 1, &num_slides,
NULL, 1, 1, MAX_SLIDES_COUNT, NULL );
recalc_offsets();
reset_slides();
break;
case 4:
rb->set_int("Zoom", "", 1, &zoom,
rb->set_int(rb->str(LANG_ZOOM), "", 1, &zoom,
NULL, 1, 10, 300, NULL );
recalc_offsets();
reset_slides();
break;
case 5:
rb->set_option("Show album title", &show_album_name,
rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), &show_album_name,
INT, album_name_options, 3, NULL);
reset_track_list();
recalc_offsets();
@ -2302,7 +2309,7 @@ static int settings_menu(void)
break;
case 6:
old_val = resize;
rb->set_bool("Resize Covers", &resize);
rb->set_bool(rb->str(LANG_RESIZE_COVERS), &resize);
if (old_val == resize) /* changed? */
break;
/* fallthrough if changed, since cache needs to be rebuilt */
@ -2311,13 +2318,13 @@ static int settings_menu(void)
rb->remove(EMPTY_SLIDE);
configfile_save(CONFIG_FILE, config,
CONFIG_NUM_ITEMS, CONFIG_VERSION);
rb->splash(HZ, "Cache will be rebuilt on next restart");
rb->splash(HZ, ID2P(LANG_CACHE_REBUILT_NEXT_RESTART));
break;
case 8:
rb->set_option("WPS Integration", &auto_wps, INT, wps_options, 3, NULL);
rb->set_option(rb->str(LANG_WPS_INTEGRATION), &auto_wps, INT, wps_options, 3, NULL);
break;
case 9:
rb->set_option("Backlight", &backlight_mode, INT, backlight_options, 2, NULL);
rb->set_option(rb->str(LANG_BACKLIGHT), &backlight_mode, INT, backlight_options, 2, NULL);
break;
case MENU_ATTACHED_USB:
@ -2350,12 +2357,15 @@ static int main_menu(void)
rb->lcd_set_foreground(N_BRIGHT(255));
#endif
MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL,
"Go to WPS",
MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL,
ID2P(LANG_GOTO_WPS),
#if PF_PLAYBACK_CAPABLE
"Clear playlist", "Playback Control",
ID2P(LANG_CLEAR_PLAYLIST),
ID2P(LANG_PLAYBACK_CONTROL),
#endif
"Settings", "Return", "Quit");
ID2P(LANG_SETTINGS),
ID2P(LANG_RETURN),
ID2P(LANG_MENU_QUIT));
while (1) {
switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
case PF_GOTO_WPS: /* WPS */
@ -2364,7 +2374,7 @@ static int main_menu(void)
case PF_MENU_CLEAR_PLAYLIST:
if(rb->playlist_remove_all_tracks(NULL) == 0) {
rb->playlist_create(NULL, NULL);
rb->splash(HZ*2, "Playlist Cleared");
rb->splash(HZ*2, ID2P(LANG_PLAYLIST_CLEARED));
}
break;
case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */
@ -2900,13 +2910,13 @@ static int pictureflow_main(void)
create_track_index(center_slide.slide_index);
reset_track_list();
start_playback(true);
rb->splash(HZ*2, "Added to playlist");
rb->splash(HZ*2, ID2P(LANG_ADDED_TO_PLAYLIST));
}
else if( pf_state == pf_show_tracks ) {
rb->playlist_insert_track(NULL, get_track_filename(selected_track),
PLAYLIST_INSERT_LAST, false, true);
rb->playlist_sync(NULL);
rb->splash(HZ*2, "Added to playlist");
rb->splash(HZ*2, ID2P(LANG_ADDED_TO_PLAYLIST));
}
}
break;
@ -2989,7 +2999,7 @@ enum plugin_status plugin_start(const void *parameter)
if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
CONFIG_VERSION))
{
rb->splash(HZ, "Error writing config.");
rb->splash(HZ, ID2P(LANG_ERROR_WRITING_CONFIG));
ret = PLUGIN_ERROR;
}
}