From b1f2c795a60cc9ddb06e0690b87c33538c94ea8a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 5 Aug 2019 22:03:45 -0400 Subject: Speech feedback in the pictureflow plugin Patch by Igor Poretsky Change-Id: I99d789e43d1093c69b4d76f58704303d3c1b3c80 --- apps/lang/english.lang | 365 ++++++++++++++++++++++++++++++++- apps/lang/russian.lang | 357 ++++++++++++++++++++++++++++++++ apps/plugins/pictureflow/pictureflow.c | 72 ++++--- 3 files changed, 759 insertions(+), 35 deletions(-) (limited to 'apps') diff --git a/apps/lang/english.lang b/apps/lang/english.lang index b77ae0afb7..5bb2069aac 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -15421,22 +15421,22 @@ id: VOICE_BAT_BENCH_KEYS id: LANG_DISPLAY_FPS - desc: in the mpegplayer settings menu + desc: in the mpegplayer and pictureflow settings menus user: core *: none swcodec: "Display FPS" - lowmem: none + lcd_bitmap: "Display FPS" *: none swcodec: "Display FPS" - lowmem: none + lcd_bitmap: "Display FPS" *: none swcodec: "Display FPS" - lowmem: none + lcd_bitmap: "Display FPS" @@ -16033,3 +16033,360 @@ id: VOICE_BAT_BENCH_KEYS lowmem: none + + id: LANG_SPACING + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Spacing" + + + *: none + lcd_bitmap: "Spacing" + + + *: none + lcd_bitmap: "Spacing" + + + + id: LANG_CENTRE_MARGIN + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Centre margin" + + + *: none + lcd_bitmap: "Centre margin" + + + *: none + lcd_bitmap: "Centre margin" + + + + id: LANG_NUMBER_OF_SLIDES + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Number of slides" + + + *: none + lcd_bitmap: "Number of slides" + + + *: none + lcd_bitmap: "Number of slides" + + + + id: LANG_ZOOM + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Zoom" + + + *: none + lcd_bitmap: "Zoom" + + + *: none + lcd_bitmap: "Zoom" + + + + id: LANG_SHOW_ALBUM_TITLE + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Show album title" + + + *: none + lcd_bitmap: "Show album title" + + + *: none + lcd_bitmap: "Show album title" + + + + id: LANG_RESIZE_COVERS + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Resize Covers" + + + *: none + lcd_bitmap: "Resize Covers" + + + *: none + lcd_bitmap: "Resize Covers" + + + + id: LANG_REBUILD_CACHE + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Rebuild cache" + + + *: none + lcd_bitmap: "Rebuild cache" + + + *: none + lcd_bitmap: "Rebuild cache" + + + + id: LANG_WPS_INTEGRATION + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "WPS Integration" + + + *: none + lcd_bitmap: "WPS Integration" + + + *: none + lcd_bitmap: "WPS Integration" + + + + id: LANG_GOTO_WPS + desc: in the pictureflow main menu + user: core + + *: none + lcd_bitmap: "Go to WPS" + + + *: none + lcd_bitmap: "Go to WPS" + + + *: none + lcd_bitmap: "Go to WPS" + + + + id: LANG_CLEAR_PLAYLIST + desc: in the pictureflow main menu + user: core + + *: none + lcd_bitmap: "Clear playlist" + + + *: none + lcd_bitmap: "Clear playlist" + + + *: none + lcd_bitmap: "Clear playlist" + + + + id: LANG_HIDE_ALBUM_TITLE + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Hide album title" + + + *: none + lcd_bitmap: "Hide album title" + + + *: none + lcd_bitmap: "Hide album title" + + + + id: LANG_SHOW_AT_THE_BOTTOM + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Show at the bottom" + + + *: none + lcd_bitmap: "Show at the bottom" + + + *: none + lcd_bitmap: "Show at the bottom" + + + + id: LANG_SHOW_AT_THE_TOP + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Show at the top" + + + *: none + lcd_bitmap: "Show at the top" + + + *: none + lcd_bitmap: "Show at the top" + + + + id: LANG_DIRECT + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Direct" + + + *: none + lcd_bitmap: "Direct" + + + *: none + lcd_bitmap: "Direct" + + + + id: LANG_VIA_TRACK_LIST + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Via Track list" + + + *: none + lcd_bitmap: "Via Track list" + + + *: none + lcd_bitmap: "Via Track list" + + + + id: LANG_ALWAYS_ON + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Always On" + + + *: none + lcd_bitmap: "Always On" + + + *: none + lcd_bitmap: "Always On" + + + + id: LANG_NO_ALBUMART_FOUND + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "No album art found" + + + *: none + lcd_bitmap: "No album art found" + + + *: none + lcd_bitmap: "No album art found" + + + + id: LANG_CACHE_REBUILT_NEXT_RESTART + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Cache will be rebuilt on next restart" + + + *: none + lcd_bitmap: "Cache will be rebuilt on next restart" + + + *: none + lcd_bitmap: "Cache will be rebuilt on next restart" + + + + id: LANG_PLAYLIST_CLEARED + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Playlist Cleared" + + + *: none + lcd_bitmap: "Playlist Cleared" + + + *: none + lcd_bitmap: "Playlist Cleared" + + + + id: LANG_ADDED_TO_PLAYLIST + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Added to playlist" + + + *: none + lcd_bitmap: "Added to playlist" + + + *: none + lcd_bitmap: "Added to playlist" + + + + id: LANG_ERROR_WRITING_CONFIG + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Error writing config" + + + *: none + lcd_bitmap: "Error writing config" + + + *: none + lcd_bitmap: "Error writing config" + + diff --git a/apps/lang/russian.lang b/apps/lang/russian.lang index 7b7384a8c7..990f095a01 100644 --- a/apps/lang/russian.lang +++ b/apps/lang/russian.lang @@ -13884,3 +13884,360 @@ lowmem: none + + id: LANG_SPACING + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Spacing" + + + *: none + lcd_bitmap: "Разбивка" + + + *: none + lcd_bitmap: "Разбивка" + + + + id: LANG_CENTRE_MARGIN + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Centre margin" + + + *: none + lcd_bitmap: "Центральное поле" + + + *: none + lcd_bitmap: "Центральное поле" + + + + id: LANG_NUMBER_OF_SLIDES + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Number of slides" + + + *: none + lcd_bitmap: "Число слайдов" + + + *: none + lcd_bitmap: "Число слайдов" + + + + id: LANG_ZOOM + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Zoom" + + + *: none + lcd_bitmap: "Увеличение" + + + *: none + lcd_bitmap: "Увеличение" + + + + id: LANG_SHOW_ALBUM_TITLE + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Show album title" + + + *: none + lcd_bitmap: "Показывать название альбома" + + + *: none + lcd_bitmap: "Показывать название альбома" + + + + id: LANG_RESIZE_COVERS + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Resize Covers" + + + *: none + lcd_bitmap: "Изменить размер обложек" + + + *: none + lcd_bitmap: "Изменить размер обложек" + + + + id: LANG_REBUILD_CACHE + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Rebuild cache" + + + *: none + lcd_bitmap: "Обновить кэш" + + + *: none + lcd_bitmap: "Обновить кэш" + + + + id: LANG_WPS_INTEGRATION + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "WPS Integration" + + + *: none + lcd_bitmap: "Взаимодействие с экраном воспроизведения" + + + *: none + lcd_bitmap: "Взаимодействие с экраном воспроизведения" + + + + id: LANG_GOTO_WPS + desc: in the pictureflow main menu + user: core + + *: none + lcd_bitmap: "Go to WPS" + + + *: none + lcd_bitmap: "Перейти к экрану воспроизведения" + + + *: none + lcd_bitmap: "Перейти к экрану воспроизведения" + + + + id: LANG_CLEAR_PLAYLIST + desc: in the pictureflow main menu + user: core + + *: none + lcd_bitmap: "Clear playlist" + + + *: none + lcd_bitmap: "Очистить список воспроизведения" + + + *: none + lcd_bitmap: "Очистить список воспроизведения" + + + + id: LANG_HIDE_ALBUM_TITLE + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Hide album title" + + + *: none + lcd_bitmap: "Скрыть название альбома" + + + *: none + lcd_bitmap: "Скрыть название альбома" + + + + id: LANG_SHOW_AT_THE_BOTTOM + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Show at the bottom" + + + *: none + lcd_bitmap: "Показывать внизу" + + + *: none + lcd_bitmap: "Показывать внизу" + + + + id: LANG_SHOW_AT_THE_TOP + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Show at the top" + + + *: none + lcd_bitmap: "Показывать вверху" + + + *: none + lcd_bitmap: "Показывать вверху" + + + + id: LANG_DIRECT + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Direct" + + + *: none + lcd_bitmap: "Непосредственно" + + + *: none + lcd_bitmap: "Непосредственно" + + + + id: LANG_VIA_TRACK_LIST + desc: in the pictureflow settings + user: core + + *: none + lcd_bitmap: "Via Track list" + + + *: none + lcd_bitmap: "Через список треков" + + + *: none + lcd_bitmap: "Через список трэков" + + + + id: LANG_ALWAYS_ON + desc: in the pictureflow settings menu + user: core + + *: none + lcd_bitmap: "Always On" + + + *: none + lcd_bitmap: "Всегда включено" + + + *: none + lcd_bitmap: "Всегда включено" + + + + id: LANG_NO_ALBUMART_FOUND + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "No album art found" + + + *: none + lcd_bitmap: "Обложек не найдено" + + + *: none + lcd_bitmap: "Обложек не найдено" + + + + id: LANG_CACHE_REBUILT_NEXT_RESTART + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Cache will be rebuilt on next restart" + + + *: none + lcd_bitmap: "Кэш будет обновлен при перезапуске" + + + *: none + lcd_bitmap: "Кэш будет обновлен при перезапуске" + + + + id: LANG_PLAYLIST_CLEARED + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Playlist Cleared" + + + *: none + lcd_bitmap: "Список воспроизведения очищен" + + + *: none + lcd_bitmap: "Список воспроизведения очищен" + + + + id: LANG_ADDED_TO_PLAYLIST + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Added to playlist" + + + *: none + lcd_bitmap: "Добавлено к списку воспроизведения" + + + *: none + lcd_bitmap: "Добавлено к списку воспроизведения" + + + + id: LANG_ERROR_WRITING_CONFIG + desc: in the pictureflow splash messages + user: core + + *: none + lcd_bitmap: "Error writing config" + + + *: none + lcd_bitmap: "Ошибка при записи конфигурации" + + + *: none + lcd_bitmap: "Ошибка при записи конфигурации" + + diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 84a4315141..c9d425c549 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -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, ¢er_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; } } -- cgit v1.2.3