Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

PictureFlow: Rejigger menu options

Put Sort command as first entry into main menu,
and immediately exit menu after sorting has changed,
to allow quicker adjustments than before.

Move commands to update or rebuild the cache from
Settings into main menu for improved discoverability,
and since they aren't really proper settings anyway.

Add 'Display' submenu to Settings which now houses the
following more 'esoteric' options that are likely to
need only infrequent adjustments:

- Backlight
- Display FPS
- Spacing
- Center Margin
- Number of Slides
- Zoom
- Resize Covers

Change-Id: I5bb3ee922cb870f9b6db9bd6ac9480d49f5decf3

+131 -95
+117 -87
apps/plugins/pictureflow/pictureflow.c
··· 3527 3527 skip_animation_to_show_tracks(); 3528 3528 } 3529 3529 3530 - /** 3531 - Shows the settings menu 3532 - */ 3533 - static int settings_menu(void) 3530 + static int display_settings_menu(void) 3534 3531 { 3535 3532 int selection = 0; 3536 3533 int old_val; 3537 3534 3538 - MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, 3539 - ID2P(LANG_SHOW_ALBUM_TITLE), 3540 - ID2P(LANG_SHOW_YEAR_IN_ALBUM_TITLE), 3541 - ID2P(LANG_SORT_ALBUMS_BY), 3542 - ID2P(LANG_YEAR_SORT_ORDER), 3535 + MENUITEM_STRINGLIST(display_menu, ID2P(LANG_DISPLAY), NULL, 3536 + ID2P(LANG_BACKLIGHT), 3543 3537 ID2P(LANG_DISPLAY_FPS), 3544 3538 ID2P(LANG_SPACING), 3545 3539 ID2P(LANG_CENTRE_MARGIN), 3546 3540 ID2P(LANG_NUMBER_OF_SLIDES), 3547 3541 ID2P(LANG_ZOOM), 3548 - ID2P(LANG_RESIZE_COVERS), 3549 - ID2P(LANG_REBUILD_CACHE), 3550 - ID2P(LANG_UPDATE_CACHE), 3551 - ID2P(LANG_WPS_INTEGRATION), 3552 - ID2P(LANG_BACKLIGHT)); 3542 + ID2P(LANG_RESIZE_COVERS)); 3553 3543 3554 - static const struct opt_items album_name_options[] = { 3555 - { STR(LANG_HIDE_ALBUM_TITLE_NEW) }, 3556 - { STR(LANG_SHOW_AT_THE_BOTTOM_NEW) }, 3557 - { STR(LANG_SHOW_AT_THE_TOP_NEW) }, 3558 - { STR(LANG_SHOW_ALL_AT_THE_TOP) }, 3559 - { STR(LANG_SHOW_ALL_AT_THE_BOTTOM) }, 3560 - }; 3561 - static const struct opt_items sort_options[] = { 3562 - { STR(LANG_ARTIST_PLUS_NAME) }, 3563 - { STR(LANG_ARTIST_PLUS_YEAR) }, 3564 - { STR(LANG_ID3_YEAR) }, 3565 - { STR(LANG_NAME) } 3566 - }; 3567 - static const struct opt_items year_sort_order_options[] = { 3568 - { STR(LANG_ASCENDING) }, 3569 - { STR(LANG_DESCENDING) } 3570 - }; 3571 - static const struct opt_items wps_options[] = { 3572 - { STR(LANG_OFF) }, 3573 - { STR(LANG_DIRECT) }, 3574 - { STR(LANG_VIA_TRACK_LIST) } 3575 - }; 3576 3544 static const struct opt_items backlight_options[] = { 3577 3545 { STR(LANG_ALWAYS_ON) }, 3578 - { STR(LANG_NORMAL) }, 3579 - }; 3546 + { STR(LANG_NORMAL) }}; 3580 3547 3581 3548 do { 3582 - selection=rb->do_menu(&settings_menu,&selection, NULL, false); 3549 + selection=rb->do_menu(&display_menu, &selection, NULL, false); 3583 3550 switch(selection) { 3584 3551 case 0: 3585 - old_val = pf_cfg.show_album_name; 3586 - rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), 3587 - &pf_cfg.show_album_name, RB_INT, album_name_options, 5, NULL); 3588 - adjust_album_display_for_setting(old_val, pf_cfg.show_album_name); 3552 + rb->set_option(rb->str(LANG_BACKLIGHT), 3553 + &pf_cfg.backlight_mode, RB_INT, backlight_options, 2, NULL); 3589 3554 break; 3590 3555 case 1: 3591 - rb->set_bool(rb->str(LANG_SHOW_YEAR_IN_ALBUM_TITLE), &pf_cfg.show_year); 3592 - break; 3593 - case 2: 3594 - old_val = pf_cfg.sort_albums_by; 3595 - rb->set_option(rb->str(LANG_SORT_ALBUMS_BY), 3596 - &pf_cfg.sort_albums_by, RB_INT, sort_options, 4, NULL); 3597 - if (old_val != pf_cfg.sort_albums_by && 3598 - !sort_albums(pf_cfg.sort_albums_by, true)) 3599 - pf_cfg.sort_albums_by = old_val; 3600 - break; 3601 - case 3: 3602 - old_val = pf_cfg.year_sort_order; 3603 - rb->set_option(rb->str(LANG_YEAR_SORT_ORDER), 3604 - &pf_cfg.year_sort_order, RB_INT, year_sort_order_options, 2, NULL); 3605 - if (old_val != pf_cfg.year_sort_order && 3606 - !sort_albums(pf_cfg.sort_albums_by, true)) 3607 - pf_cfg.year_sort_order = old_val; 3608 - break; 3609 - case 4: 3610 3556 old_val = pf_cfg.show_fps; 3611 3557 rb->set_bool(rb->str(LANG_DISPLAY_FPS), &pf_cfg.show_fps); 3612 3558 if (old_val != pf_cfg.show_fps) 3613 3559 reset_track_list(); 3614 3560 break; 3615 - 3616 - case 5: 3561 + case 2: 3617 3562 old_val = pf_cfg.slide_spacing; 3618 3563 rb->set_int(rb->str(LANG_SPACING), "", 1, 3619 3564 &pf_cfg.slide_spacing, 3620 3565 NULL, 1, 0, 100, NULL ); 3621 3566 adjust_album_display_for_setting(old_val, pf_cfg.slide_spacing); 3622 3567 break; 3623 - 3624 - case 6: 3568 + case 3: 3625 3569 old_val = pf_cfg.center_margin; 3626 3570 rb->set_int(rb->str(LANG_CENTRE_MARGIN), "", 1, 3627 3571 &pf_cfg.center_margin, 3628 3572 NULL, 1, 0, 80, NULL ); 3629 3573 adjust_album_display_for_setting(old_val, pf_cfg.center_margin); 3630 3574 break; 3631 - 3632 - case 7: 3575 + case 4: 3633 3576 old_val = pf_cfg.num_slides; 3634 3577 rb->set_int(rb->str(LANG_NUMBER_OF_SLIDES), "", 1, 3635 3578 &pf_cfg.num_slides, NULL, 1, 1, MAX_SLIDES_COUNT, NULL ); 3636 3579 adjust_album_display_for_setting(old_val, pf_cfg.num_slides); 3637 3580 break; 3638 - 3639 - case 8: 3581 + case 5: 3640 3582 old_val = pf_cfg.zoom; 3641 3583 rb->set_int(rb->str(LANG_ZOOM), "", 1, &pf_cfg.zoom, 3642 3584 NULL, 1, 10, 300, NULL ); 3643 3585 adjust_album_display_for_setting(old_val, pf_cfg.zoom); 3644 3586 break; 3645 - 3646 - case 9: 3587 + case 6: 3647 3588 old_val = pf_cfg.resize; 3648 3589 rb->set_bool(rb->str(LANG_RESIZE_COVERS), &pf_cfg.resize); 3649 3590 if (old_val == pf_cfg.resize) /* changed? */ 3650 3591 break; 3651 - /* fallthrough if changed, since cache needs to be rebuilt */ 3652 - case 10: 3592 + 3653 3593 pf_cfg.update_albumart = false; 3654 3594 pf_cfg.cache_version = CACHE_REBUILD; 3655 3595 rb->remove(EMPTY_SLIDE); 3656 3596 configfile_save(CONFIG_FILE, config, 3657 3597 CONFIG_NUM_ITEMS, CONFIG_VERSION); 3658 3598 return -3; /* re-init */ 3659 - case 11: 3660 - pf_cfg.update_albumart = true; 3661 - pf_cfg.cache_version = CACHE_REBUILD; 3662 - rb->remove(EMPTY_SLIDE); 3663 - configfile_save(CONFIG_FILE, config, 3664 - CONFIG_NUM_ITEMS, CONFIG_VERSION); 3665 - return -3; /* re-init */ 3666 - case 12: 3599 + case MENU_ATTACHED_USB: 3600 + return PLUGIN_USB_CONNECTED; 3601 + } 3602 + } while (selection >= 0); 3603 + 3604 + return 0; 3605 + } 3606 + 3607 + /** 3608 + Shows the settings menu 3609 + */ 3610 + static int settings_menu(void) 3611 + { 3612 + int selection = 0; 3613 + int old_val, result; 3614 + 3615 + MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, 3616 + ID2P(LANG_SHOW_ALBUM_TITLE), 3617 + ID2P(LANG_SHOW_YEAR_IN_ALBUM_TITLE), 3618 + ID2P(LANG_YEAR_SORT_ORDER), 3619 + ID2P(LANG_WPS_INTEGRATION), 3620 + ID2P(LANG_DISPLAY)); 3621 + 3622 + static const struct opt_items album_name_options[] = { 3623 + { STR(LANG_HIDE_ALBUM_TITLE_NEW) }, 3624 + { STR(LANG_SHOW_AT_THE_BOTTOM_NEW) }, 3625 + { STR(LANG_SHOW_AT_THE_TOP_NEW) }, 3626 + { STR(LANG_SHOW_ALL_AT_THE_TOP) }, 3627 + { STR(LANG_SHOW_ALL_AT_THE_BOTTOM) }, 3628 + }; 3629 + static const struct opt_items year_sort_order_options[] = { 3630 + { STR(LANG_ASCENDING) }, 3631 + { STR(LANG_DESCENDING) } 3632 + }; 3633 + static const struct opt_items wps_options[] = { 3634 + { STR(LANG_OFF) }, 3635 + { STR(LANG_DIRECT) }, 3636 + { STR(LANG_VIA_TRACK_LIST) } 3637 + }; 3638 + 3639 + do { 3640 + selection=rb->do_menu(&settings_menu,&selection, NULL, false); 3641 + switch(selection) { 3642 + case 0: 3643 + old_val = pf_cfg.show_album_name; 3644 + rb->set_option(rb->str(LANG_SHOW_ALBUM_TITLE), 3645 + &pf_cfg.show_album_name, RB_INT, album_name_options, 5, NULL); 3646 + adjust_album_display_for_setting(old_val, pf_cfg.show_album_name); 3647 + break; 3648 + case 1: 3649 + rb->set_bool(rb->str(LANG_SHOW_YEAR_IN_ALBUM_TITLE), &pf_cfg.show_year); 3650 + break; 3651 + case 2: 3652 + old_val = pf_cfg.year_sort_order; 3653 + rb->set_option(rb->str(LANG_YEAR_SORT_ORDER), 3654 + &pf_cfg.year_sort_order, RB_INT, year_sort_order_options, 2, NULL); 3655 + if (old_val != pf_cfg.year_sort_order && 3656 + !sort_albums(pf_cfg.sort_albums_by, true)) 3657 + pf_cfg.year_sort_order = old_val; 3658 + break; 3659 + case 3: 3667 3660 rb->set_option(rb->str(LANG_WPS_INTEGRATION), 3668 3661 &pf_cfg.auto_wps, RB_INT, wps_options, 3, NULL); 3669 3662 break; 3670 - case 13: 3671 - rb->set_option(rb->str(LANG_BACKLIGHT), 3672 - &pf_cfg.backlight_mode, RB_INT, backlight_options, 2, NULL); 3663 + case 4: 3664 + if ((result = display_settings_menu())) 3665 + return result; 3673 3666 break; 3674 - 3675 3667 case MENU_ATTACHED_USB: 3676 3668 return PLUGIN_USB_CONNECTED; 3677 3669 } 3678 3670 } while ( selection >= 0 ); 3671 + 3679 3672 return 0; 3680 3673 } 3681 3674 ··· 3683 3676 Show the main menu 3684 3677 */ 3685 3678 enum { 3679 + PF_SORT_ALBUMS_BY, 3686 3680 PF_SHOW_TRACKS_WHILE_BROWSING, 3687 3681 PF_GOTO_LAST_ALBUM, 3688 3682 PF_GOTO_WPS, 3689 3683 #if PF_PLAYBACK_CAPABLE 3690 3684 PF_MENU_PLAYBACK_CONTROL, 3691 3685 #endif 3686 + PF_REBUILD_CACHE, 3687 + PF_UPDATE_CACHE, 3692 3688 PF_MENU_SETTINGS, 3693 3689 PF_MENU_QUIT, 3694 3690 }; ··· 3696 3692 static int main_menu(void) 3697 3693 { 3698 3694 int selection = 0; 3699 - int result, curr_album; 3695 + int result, curr_album, old_val; 3700 3696 3701 3697 #if LCD_DEPTH > 1 3702 3698 rb->lcd_set_foreground(N_BRIGHT(255)); 3703 3699 #endif 3704 3700 3705 3701 MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL, 3702 + ID2P(LANG_SORT_ALBUMS_BY), 3706 3703 ID2P(LANG_SHOW_TRACKS_WHILE_BROWSING), 3707 3704 ID2P(LANG_GOTO_LAST_ALBUM), 3708 3705 ID2P(LANG_GOTO_WPS), 3709 3706 #if PF_PLAYBACK_CAPABLE 3710 3707 ID2P(LANG_PLAYBACK_CONTROL), 3711 3708 #endif 3709 + ID2P(LANG_REBUILD_CACHE), 3710 + ID2P(LANG_UPDATE_CACHE), 3712 3711 ID2P(LANG_SETTINGS), 3713 3712 ID2P(LANG_MENU_QUIT)); 3713 + 3714 + static const struct opt_items sort_options[] = { 3715 + { STR(LANG_ARTIST_PLUS_NAME) }, 3716 + { STR(LANG_ARTIST_PLUS_YEAR) }, 3717 + { STR(LANG_ID3_YEAR) }, 3718 + { STR(LANG_NAME) }}; 3719 + 3714 3720 while (1) { 3715 3721 switch (rb->do_menu(&main_menu,&selection, NULL, false)) { 3722 + case PF_SORT_ALBUMS_BY: 3723 + old_val = pf_cfg.sort_albums_by; 3724 + rb->set_option(rb->str(LANG_SORT_ALBUMS_BY), 3725 + &pf_cfg.sort_albums_by, RB_INT, sort_options, 4, NULL); 3726 + if (old_val != pf_cfg.sort_albums_by && 3727 + !sort_albums(pf_cfg.sort_albums_by, true)) 3728 + pf_cfg.sort_albums_by = old_val; 3729 + if (old_val == pf_cfg.sort_albums_by) 3730 + break; 3731 + return 0; 3716 3732 case PF_SHOW_TRACKS_WHILE_BROWSING: 3717 3733 if (pf_state != pf_show_tracks) 3718 3734 { ··· 3748 3764 playback_control(NULL); 3749 3765 break; 3750 3766 #endif 3767 + case PF_REBUILD_CACHE: 3768 + pf_cfg.update_albumart = false; 3769 + pf_cfg.cache_version = CACHE_REBUILD; 3770 + rb->remove(EMPTY_SLIDE); 3771 + configfile_save(CONFIG_FILE, config, 3772 + CONFIG_NUM_ITEMS, CONFIG_VERSION); 3773 + return -3; /* re-init */ 3774 + case PF_UPDATE_CACHE: 3775 + pf_cfg.update_albumart = true; 3776 + pf_cfg.cache_version = CACHE_REBUILD; 3777 + rb->remove(EMPTY_SLIDE); 3778 + configfile_save(CONFIG_FILE, config, 3779 + CONFIG_NUM_ITEMS, CONFIG_VERSION); 3780 + return -3; /* re-init */ 3751 3781 case PF_MENU_SETTINGS: 3752 3782 result = settings_menu(); 3753 3783 if (result != 0)
+14 -8
manual/plugins/pictureflow.tex
··· 34 34 35 35 \begin{itemize} 36 36 \item PictureFlow needs to build an album index the first time it's launched 37 - (Cancel/Quit by pressing any button) and then writes an album art cache to disk. 38 - During the latter, press any button to skip past the progress bar screen and 37 + (Cancel/Quit by pressing \ActionStdCancel{} or \ActionStdMenu{}) and then writes an album art cache to disk. 38 + During the latter (5th step), press any button to skip past the progress bar screen and 39 39 to start browsing immediately. Processing of album art will continue in the 40 40 background. An indicator in the screen corner shows you the completed percentage. 41 41 When the cache is being built, the UI may be slow to react to your input. ··· 200 200 201 201 \subsubsection{Main Menu} 202 202 \begin{description} 203 + \item[Sort albums by.] Change the sorting of albums in PictureFlow. 203 204 \item[Show Tracks While Browsing.] Scroll through albums from their track list. 204 205 \item[Go to Last Album.] Go to selected album when PictureFlow was last quit or the sorting changed. 205 206 \item[Go to WPS.] Leave PictureFlow and enter the While Playing Screen. 206 207 \item[Playback Control.] Control music playback from within the plugin. 208 + \item[Rebuild cache.] Creates a fresh album index and builds the artwork cache from scratch. 209 + \item[Update cache.] Creates a fresh album index and updates the existing artwork cache to 210 + include newly added albums. 207 211 \item[Settings.] Enter the settings menu. 208 212 \item[Quit.] Exit PictureFlow plugin. 209 213 \end{description} ··· 215 219 shown above or below the cover art, or not at all. 216 220 \item[Show year in album title.] Set whether a year will be displayed next to each album 217 221 title (determined by the release year of the latest track on an album). 218 - \item[Sort albums by.] Change the sorting of albums in PictureFlow. 219 222 \item[Year sort order.] Determines whether albums are sorted in ascending or descending 220 223 order, when sorting by year. 224 + \item[WPS integration.] Integrate PictureFlow with the While Playing Screen. 225 + \item[Display.] Enter the Display settings menu. 226 + \end{description} 227 + 228 + \subsubsection{Display Settings Menu} 229 + 230 + \begin{description} 231 + \item[Backlight.] Force backlight on while running pictureflow. 221 232 \item[Display FPS.] Displays frames per second on screen. 222 233 \item[Spacing.] The distance between the front edges of the side slides, i.e. changes 223 234 the degree of overlap of the side slides. A larger number means less overlap. Scales with zoom. ··· 229 240 \item[Zoom.] Changes the distance at which slides are rendered from the ``camera''. 230 241 \item[Resize Covers.] Set whether to automatically resize the covers or to leave 231 242 them at their original size. 232 - \item[Rebuild cache.] Creates a fresh album index and builds the artwork cache from scratch. 233 - \item[Update cache.] Creates a fresh album index and updates the existing artwork cache to 234 - include newly added albums. 235 - \item[WPS integration.] Integrate PictureFlow with the While Playing Screen. 236 - \item[Backlight.] Force backlight on while running pictureflow. 237 243 \end{description}