diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2019-08-05 22:03:45 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2019-08-07 09:50:27 -0400 |
commit | b1f2c795a60cc9ddb06e0690b87c33538c94ea8a (patch) | |
tree | 9a728e5734191f36bf5932de095e0d96c4d61852 /apps/plugins | |
parent | 2ebb8da275da1aa67d148d8ea4ddc1a3e94bd019 (diff) | |
download | rockbox-b1f2c795a60cc9ddb06e0690b87c33538c94ea8a.tar.gz rockbox-b1f2c795a60cc9ddb06e0690b87c33538c94ea8a.zip |
Speech feedback in the pictureflow plugin
Patch by Igor Poretsky
Change-Id: I99d789e43d1093c69b4d76f58704303d3c1b3c80
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 72 |
1 files changed, 41 insertions, 31 deletions
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) | |||
1261 | draw_progressbar(i); | 1261 | draw_progressbar(i); |
1262 | if ( slides == 0 ) { | 1262 | if ( slides == 0 ) { |
1263 | /* Warn the user that we couldn't find any albumart */ | 1263 | /* Warn the user that we couldn't find any albumart */ |
1264 | rb->splash(2*HZ, "No album art found"); | 1264 | rb->splash(2*HZ, ID2P(LANG_NO_ALBUMART_FOUND)); |
1265 | return false; | 1265 | return false; |
1266 | } | 1266 | } |
1267 | return true; | 1267 | return true; |
@@ -2236,36 +2236,43 @@ static int settings_menu(void) | |||
2236 | int selection = 0; | 2236 | int selection = 0; |
2237 | bool old_val; | 2237 | bool old_val; |
2238 | 2238 | ||
2239 | MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, "Show FPS", | 2239 | MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, |
2240 | "Spacing", "Centre margin", "Number of slides", "Zoom", | 2240 | ID2P(LANG_DISPLAY_FPS), |
2241 | "Show album title", "Resize Covers", "Rebuild cache", | 2241 | ID2P(LANG_SPACING), |
2242 | "WPS Integration", "Backlight"); | 2242 | ID2P(LANG_CENTRE_MARGIN), |
2243 | ID2P(LANG_NUMBER_OF_SLIDES), | ||
2244 | ID2P(LANG_ZOOM), | ||
2245 | ID2P(LANG_SHOW_ALBUM_TITLE), | ||
2246 | ID2P(LANG_RESIZE_COVERS), | ||
2247 | ID2P(LANG_REBUILD_CACHE), | ||
2248 | ID2P(LANG_WPS_INTEGRATION), | ||
2249 | ID2P(LANG_BACKLIGHT)); | ||
2243 | 2250 | ||
2244 | static const struct opt_items album_name_options[] = { | 2251 | static const struct opt_items album_name_options[] = { |
2245 | { "Hide album title", -1 }, | 2252 | { STR(LANG_HIDE_ALBUM_TITLE) }, |
2246 | { "Show at the bottom", -1 }, | 2253 | { STR(LANG_SHOW_AT_THE_BOTTOM) }, |
2247 | { "Show at the top", -1 } | 2254 | { STR(LANG_SHOW_AT_THE_TOP) } |
2248 | }; | 2255 | }; |
2249 | static const struct opt_items wps_options[] = { | 2256 | static const struct opt_items wps_options[] = { |
2250 | { "Off", -1 }, | 2257 | { STR(LANG_OFF) }, |
2251 | { "Direct", -1 }, | 2258 | { STR(LANG_DIRECT) }, |
2252 | { "Via Track list", -1 } | 2259 | { STR(LANG_VIA_TRACK_LIST) } |
2253 | }; | 2260 | }; |
2254 | static const struct opt_items backlight_options[] = { | 2261 | static const struct opt_items backlight_options[] = { |
2255 | { "Always On", -1 }, | 2262 | { STR(LANG_ALWAYS_ON) }, |
2256 | { "Normal", -1 }, | 2263 | { STR(LANG_NORMAL) }, |
2257 | }; | 2264 | }; |
2258 | 2265 | ||
2259 | do { | 2266 | do { |
2260 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); | 2267 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); |
2261 | switch(selection) { | 2268 | switch(selection) { |
2262 | case 0: | 2269 | case 0: |
2263 | rb->set_bool("Show FPS", &show_fps); | 2270 | rb->set_bool(rb->str(LANG_DISPLAY_FPS), &show_fps); |
2264 | reset_track_list(); | 2271 | reset_track_list(); |
2265 | break; | 2272 | break; |
2266 | 2273 | ||
2267 | case 1: | 2274 | case 1: |
2268 | rb->set_int("Spacing between slides", "", 1, | 2275 | rb->set_int(rb->str(LANG_SPACING), "", 1, |
2269 | &slide_spacing, | 2276 | &slide_spacing, |
2270 | NULL, 1, 0, 100, NULL ); | 2277 | NULL, 1, 0, 100, NULL ); |
2271 | recalc_offsets(); | 2278 | recalc_offsets(); |
@@ -2273,7 +2280,7 @@ static int settings_menu(void) | |||
2273 | break; | 2280 | break; |
2274 | 2281 | ||
2275 | case 2: | 2282 | case 2: |
2276 | rb->set_int("Centre margin", "", 1, | 2283 | rb->set_int(rb->str(LANG_CENTRE_MARGIN), "", 1, |
2277 | ¢er_margin, | 2284 | ¢er_margin, |
2278 | NULL, 1, 0, 80, NULL ); | 2285 | NULL, 1, 0, 80, NULL ); |
2279 | recalc_offsets(); | 2286 | recalc_offsets(); |
@@ -2281,20 +2288,20 @@ static int settings_menu(void) | |||
2281 | break; | 2288 | break; |
2282 | 2289 | ||
2283 | case 3: | 2290 | case 3: |
2284 | rb->set_int("Number of slides", "", 1, &num_slides, | 2291 | rb->set_int(rb->str(LANG_NUMBER_OF_SLIDES), "", 1, &num_slides, |
2285 | NULL, 1, 1, MAX_SLIDES_COUNT, NULL ); | 2292 | NULL, 1, 1, MAX_SLIDES_COUNT, NULL ); |
2286 | recalc_offsets(); | 2293 | recalc_offsets(); |
2287 | reset_slides(); | 2294 | reset_slides(); |
2288 | break; | 2295 | break; |
2289 | 2296 | ||
2290 | case 4: | 2297 | case 4: |
2291 | rb->set_int("Zoom", "", 1, &zoom, | 2298 | rb->set_int(rb->str(LANG_ZOOM), "", 1, &zoom, |
2292 | NULL, 1, 10, 300, NULL ); | 2299 | NULL, 1, 10, 300, NULL ); |
2293 | recalc_offsets(); | 2300 | recalc_offsets(); |
2294 | reset_slides(); | 2301 | reset_slides(); |
2295 | break; | 2302 | break; |
2296 | case 5: | 2303 | case 5: |
2297 | rb->set_option("Show album title", &show_album_name, | 2304 | rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), &show_album_name, |
2298 | INT, album_name_options, 3, NULL); | 2305 | INT, album_name_options, 3, NULL); |
2299 | reset_track_list(); | 2306 | reset_track_list(); |
2300 | recalc_offsets(); | 2307 | recalc_offsets(); |
@@ -2302,7 +2309,7 @@ static int settings_menu(void) | |||
2302 | break; | 2309 | break; |
2303 | case 6: | 2310 | case 6: |
2304 | old_val = resize; | 2311 | old_val = resize; |
2305 | rb->set_bool("Resize Covers", &resize); | 2312 | rb->set_bool(rb->str(LANG_RESIZE_COVERS), &resize); |
2306 | if (old_val == resize) /* changed? */ | 2313 | if (old_val == resize) /* changed? */ |
2307 | break; | 2314 | break; |
2308 | /* fallthrough if changed, since cache needs to be rebuilt */ | 2315 | /* fallthrough if changed, since cache needs to be rebuilt */ |
@@ -2311,13 +2318,13 @@ static int settings_menu(void) | |||
2311 | rb->remove(EMPTY_SLIDE); | 2318 | rb->remove(EMPTY_SLIDE); |
2312 | configfile_save(CONFIG_FILE, config, | 2319 | configfile_save(CONFIG_FILE, config, |
2313 | CONFIG_NUM_ITEMS, CONFIG_VERSION); | 2320 | CONFIG_NUM_ITEMS, CONFIG_VERSION); |
2314 | rb->splash(HZ, "Cache will be rebuilt on next restart"); | 2321 | rb->splash(HZ, ID2P(LANG_CACHE_REBUILT_NEXT_RESTART)); |
2315 | break; | 2322 | break; |
2316 | case 8: | 2323 | case 8: |
2317 | rb->set_option("WPS Integration", &auto_wps, INT, wps_options, 3, NULL); | 2324 | rb->set_option(rb->str(LANG_WPS_INTEGRATION), &auto_wps, INT, wps_options, 3, NULL); |
2318 | break; | 2325 | break; |
2319 | case 9: | 2326 | case 9: |
2320 | rb->set_option("Backlight", &backlight_mode, INT, backlight_options, 2, NULL); | 2327 | rb->set_option(rb->str(LANG_BACKLIGHT), &backlight_mode, INT, backlight_options, 2, NULL); |
2321 | break; | 2328 | break; |
2322 | 2329 | ||
2323 | case MENU_ATTACHED_USB: | 2330 | case MENU_ATTACHED_USB: |
@@ -2350,12 +2357,15 @@ static int main_menu(void) | |||
2350 | rb->lcd_set_foreground(N_BRIGHT(255)); | 2357 | rb->lcd_set_foreground(N_BRIGHT(255)); |
2351 | #endif | 2358 | #endif |
2352 | 2359 | ||
2353 | MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL, | 2360 | MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL, |
2354 | "Go to WPS", | 2361 | ID2P(LANG_GOTO_WPS), |
2355 | #if PF_PLAYBACK_CAPABLE | 2362 | #if PF_PLAYBACK_CAPABLE |
2356 | "Clear playlist", "Playback Control", | 2363 | ID2P(LANG_CLEAR_PLAYLIST), |
2364 | ID2P(LANG_PLAYBACK_CONTROL), | ||
2357 | #endif | 2365 | #endif |
2358 | "Settings", "Return", "Quit"); | 2366 | ID2P(LANG_SETTINGS), |
2367 | ID2P(LANG_RETURN), | ||
2368 | ID2P(LANG_MENU_QUIT)); | ||
2359 | while (1) { | 2369 | while (1) { |
2360 | switch (rb->do_menu(&main_menu,&selection, NULL, false)) { | 2370 | switch (rb->do_menu(&main_menu,&selection, NULL, false)) { |
2361 | case PF_GOTO_WPS: /* WPS */ | 2371 | case PF_GOTO_WPS: /* WPS */ |
@@ -2364,7 +2374,7 @@ static int main_menu(void) | |||
2364 | case PF_MENU_CLEAR_PLAYLIST: | 2374 | case PF_MENU_CLEAR_PLAYLIST: |
2365 | if(rb->playlist_remove_all_tracks(NULL) == 0) { | 2375 | if(rb->playlist_remove_all_tracks(NULL) == 0) { |
2366 | rb->playlist_create(NULL, NULL); | 2376 | rb->playlist_create(NULL, NULL); |
2367 | rb->splash(HZ*2, "Playlist Cleared"); | 2377 | rb->splash(HZ*2, ID2P(LANG_PLAYLIST_CLEARED)); |
2368 | } | 2378 | } |
2369 | break; | 2379 | break; |
2370 | case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */ | 2380 | case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */ |
@@ -2900,13 +2910,13 @@ static int pictureflow_main(void) | |||
2900 | create_track_index(center_slide.slide_index); | 2910 | create_track_index(center_slide.slide_index); |
2901 | reset_track_list(); | 2911 | reset_track_list(); |
2902 | start_playback(true); | 2912 | start_playback(true); |
2903 | rb->splash(HZ*2, "Added to playlist"); | 2913 | rb->splash(HZ*2, ID2P(LANG_ADDED_TO_PLAYLIST)); |
2904 | } | 2914 | } |
2905 | else if( pf_state == pf_show_tracks ) { | 2915 | else if( pf_state == pf_show_tracks ) { |
2906 | rb->playlist_insert_track(NULL, get_track_filename(selected_track), | 2916 | rb->playlist_insert_track(NULL, get_track_filename(selected_track), |
2907 | PLAYLIST_INSERT_LAST, false, true); | 2917 | PLAYLIST_INSERT_LAST, false, true); |
2908 | rb->playlist_sync(NULL); | 2918 | rb->playlist_sync(NULL); |
2909 | rb->splash(HZ*2, "Added to playlist"); | 2919 | rb->splash(HZ*2, ID2P(LANG_ADDED_TO_PLAYLIST)); |
2910 | } | 2920 | } |
2911 | } | 2921 | } |
2912 | break; | 2922 | break; |
@@ -2989,7 +2999,7 @@ enum plugin_status plugin_start(const void *parameter) | |||
2989 | if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS, | 2999 | if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS, |
2990 | CONFIG_VERSION)) | 3000 | CONFIG_VERSION)) |
2991 | { | 3001 | { |
2992 | rb->splash(HZ, "Error writing config."); | 3002 | rb->splash(HZ, ID2P(LANG_ERROR_WRITING_CONFIG)); |
2993 | ret = PLUGIN_ERROR; | 3003 | ret = PLUGIN_ERROR; |
2994 | } | 3004 | } |
2995 | } | 3005 | } |