diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-04-15 20:15:07 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-05-26 12:26:06 -0400 |
commit | bbef5988175a3d06488b2bd46ffcfaf9e5711fc5 (patch) | |
tree | 1ccd64061e268b84df8941de5da64548bc7b2b72 /apps/plugins/pictureflow | |
parent | 0f941488af3f91088c306e7ee53facb3e8927731 (diff) | |
download | rockbox-bbef5988175a3d06488b2bd46ffcfaf9e5711fc5.tar.gz rockbox-bbef5988175a3d06488b2bd46ffcfaf9e5711fc5.zip |
PictureFlow: Scroll through albums from track list
This lets players that can't spare any keys scroll through
albums without leaving the track listing first, which was
only possible on the M3K before.
Enter mode from Main Menu. While active, the gradient
highlighting an album's selected track will not appear,
and context menu options apply to the whole album
instead of to a single track.
Exit mode by pressing buttons for Select/Back, or by
quitting PictureFlow.
NB: Be sure to enable "Database in RAM" for a good
experience, as the loading time for each album can
become quite annoying otherwise.
Change-Id: Id6c9a8cc49e4cfb2aea958610b95a19887f496b6
Diffstat (limited to 'apps/plugins/pictureflow')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index b884f3ae0f..87db58aa34 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -540,6 +540,7 @@ static PFreal offsetX; | |||
540 | static PFreal offsetY; | 540 | static PFreal offsetY; |
541 | static int number_of_slides; | 541 | static int number_of_slides; |
542 | static bool is_initial_slide = true; | 542 | static bool is_initial_slide = true; |
543 | static bool show_tracks_while_browsing = false; | ||
543 | 544 | ||
544 | static struct pf_slide_cache pf_sldcache; | 545 | static struct pf_slide_cache pf_sldcache; |
545 | 546 | ||
@@ -3649,6 +3650,7 @@ static int settings_menu(void) | |||
3649 | Show the main menu | 3650 | Show the main menu |
3650 | */ | 3651 | */ |
3651 | enum { | 3652 | enum { |
3653 | PF_SHOW_TRACKS_WHILE_BROWSING, | ||
3652 | PF_GOTO_WPS, | 3654 | PF_GOTO_WPS, |
3653 | #if PF_PLAYBACK_CAPABLE | 3655 | #if PF_PLAYBACK_CAPABLE |
3654 | PF_MENU_CLEAR_PLAYLIST, | 3656 | PF_MENU_CLEAR_PLAYLIST, |
@@ -3669,6 +3671,7 @@ static int main_menu(void) | |||
3669 | #endif | 3671 | #endif |
3670 | 3672 | ||
3671 | MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL, | 3673 | MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL, |
3674 | ID2P(LANG_SHOW_TRACKS_WHILE_BROWSING), | ||
3672 | ID2P(LANG_GOTO_WPS), | 3675 | ID2P(LANG_GOTO_WPS), |
3673 | #if PF_PLAYBACK_CAPABLE | 3676 | #if PF_PLAYBACK_CAPABLE |
3674 | ID2P(LANG_CLEAR_PLAYLIST), | 3677 | ID2P(LANG_CLEAR_PLAYLIST), |
@@ -3679,6 +3682,16 @@ static int main_menu(void) | |||
3679 | ID2P(LANG_MENU_QUIT)); | 3682 | ID2P(LANG_MENU_QUIT)); |
3680 | while (1) { | 3683 | while (1) { |
3681 | switch (rb->do_menu(&main_menu,&selection, NULL, false)) { | 3684 | switch (rb->do_menu(&main_menu,&selection, NULL, false)) { |
3685 | case PF_SHOW_TRACKS_WHILE_BROWSING: | ||
3686 | if (pf_state != pf_show_tracks) | ||
3687 | { | ||
3688 | if (pf_state == pf_scrolling) | ||
3689 | set_current_slide(target); | ||
3690 | |||
3691 | skip_animation_to_show_tracks(); | ||
3692 | } | ||
3693 | show_tracks_while_browsing = true; | ||
3694 | return 0; | ||
3682 | case PF_GOTO_WPS: /* WPS */ | 3695 | case PF_GOTO_WPS: /* WPS */ |
3683 | return -2; | 3696 | return -2; |
3684 | #if PF_PLAYBACK_CAPABLE | 3697 | #if PF_PLAYBACK_CAPABLE |
@@ -3926,7 +3939,7 @@ static void show_track_list(void) | |||
3926 | for (; track_i < pf_tracks.list_visible + pf_tracks.list_start; track_i++) | 3939 | for (; track_i < pf_tracks.list_visible + pf_tracks.list_start; track_i++) |
3927 | { | 3940 | { |
3928 | char *trackname = get_track_name(track_i); | 3941 | char *trackname = get_track_name(track_i); |
3929 | if ( track_i == pf_tracks.sel ) { | 3942 | if (track_i == pf_tracks.sel && !show_tracks_while_browsing) { |
3930 | if (pf_tracks.sel != pf_tracks.last_sel) { | 3943 | if (pf_tracks.sel != pf_tracks.last_sel) { |
3931 | set_scroll_line(trackname, PF_SCROLL_TRACK); | 3944 | set_scroll_line(trackname, PF_SCROLL_TRACK); |
3932 | pf_tracks.last_sel = pf_tracks.sel; | 3945 | pf_tracks.last_sel = pf_tracks.sel; |
@@ -4140,7 +4153,7 @@ static bool context_menu_ready(void) | |||
4140 | rb->lcd_set_background(N_BRIGHT(255)); | 4153 | rb->lcd_set_background(N_BRIGHT(255)); |
4141 | #endif | 4154 | #endif |
4142 | #endif | 4155 | #endif |
4143 | insert_whole_album = pf_state != pf_show_tracks; | 4156 | insert_whole_album = (pf_state != pf_show_tracks) || show_tracks_while_browsing; |
4144 | FOR_NB_SCREENS(i) | 4157 | FOR_NB_SCREENS(i) |
4145 | rb->viewportmanager_theme_enable(i, true, NULL); | 4158 | rb->viewportmanager_theme_enable(i, true, NULL); |
4146 | 4159 | ||
@@ -4151,7 +4164,7 @@ static void context_menu_cleanup(void) | |||
4151 | { | 4164 | { |
4152 | FOR_NB_SCREENS(i) | 4165 | FOR_NB_SCREENS(i) |
4153 | rb->viewportmanager_theme_undo(i, false); | 4166 | rb->viewportmanager_theme_undo(i, false); |
4154 | if (insert_whole_album) | 4167 | if (pf_state != pf_show_tracks) |
4155 | free_borrowed_tracks(); | 4168 | free_borrowed_tracks(); |
4156 | #ifdef USEGSLIB | 4169 | #ifdef USEGSLIB |
4157 | grey_show(true); | 4170 | grey_show(true); |
@@ -4163,7 +4176,7 @@ static void context_menu_cleanup(void) | |||
4163 | static int context_menu(void) | 4176 | static int context_menu(void) |
4164 | { | 4177 | { |
4165 | char album_name[MAX_PATH]; | 4178 | char album_name[MAX_PATH]; |
4166 | char *file_name = get_track_filename(pf_tracks.sel); | 4179 | char *file_name = get_track_filename(show_tracks_while_browsing ? 0 : pf_tracks.sel); |
4167 | int attr; | 4180 | int attr; |
4168 | 4181 | ||
4169 | enum { | 4182 | enum { |
@@ -4538,6 +4551,7 @@ static int pictureflow_main(const char* selected_file) | |||
4538 | instant_update = true; | 4551 | instant_update = true; |
4539 | break; | 4552 | break; |
4540 | case pf_cover_out: | 4553 | case pf_cover_out: |
4554 | show_tracks_while_browsing = false; | ||
4541 | update_cover_out_animation(); | 4555 | update_cover_out_animation(); |
4542 | render_all_slides(); | 4556 | render_all_slides(); |
4543 | instant_update = true; | 4557 | instant_update = true; |
@@ -4546,6 +4560,7 @@ static int pictureflow_main(const char* selected_file) | |||
4546 | show_track_list(); | 4560 | show_track_list(); |
4547 | break; | 4561 | break; |
4548 | case pf_idle: | 4562 | case pf_idle: |
4563 | show_tracks_while_browsing = false; | ||
4549 | render_all_slides(); | 4564 | render_all_slides(); |
4550 | if (aa_cache.inspected < pf_idx.album_ct) | 4565 | if (aa_cache.inspected < pf_idx.album_ct) |
4551 | { | 4566 | { |
@@ -4608,7 +4623,9 @@ static int pictureflow_main(const char* selected_file) | |||
4608 | case PF_WPS: | 4623 | case PF_WPS: |
4609 | return PLUGIN_GOTO_WPS; | 4624 | return PLUGIN_GOTO_WPS; |
4610 | case PF_BACK: | 4625 | case PF_BACK: |
4611 | if ( pf_state == pf_show_tracks ) | 4626 | if (show_tracks_while_browsing) |
4627 | show_tracks_while_browsing = false; | ||
4628 | else if (pf_state == pf_show_tracks) | ||
4612 | { | 4629 | { |
4613 | pf_state = pf_cover_out; | 4630 | pf_state = pf_cover_out; |
4614 | free_borrowed_tracks(); | 4631 | free_borrowed_tracks(); |
@@ -4641,7 +4658,12 @@ static int pictureflow_main(const char* selected_file) | |||
4641 | case PF_NEXT: | 4658 | case PF_NEXT: |
4642 | case PF_NEXT_REPEAT: | 4659 | case PF_NEXT_REPEAT: |
4643 | if ( pf_state == pf_show_tracks ) | 4660 | if ( pf_state == pf_show_tracks ) |
4644 | select_next_track(); | 4661 | { |
4662 | if (show_tracks_while_browsing) | ||
4663 | select_next_album(); | ||
4664 | else | ||
4665 | select_next_track(); | ||
4666 | } | ||
4645 | else if (pf_state == pf_cover_in) | 4667 | else if (pf_state == pf_cover_in) |
4646 | skip_animation_to_show_tracks(); | 4668 | skip_animation_to_show_tracks(); |
4647 | else if (pf_state == pf_cover_out) | 4669 | else if (pf_state == pf_cover_out) |
@@ -4654,7 +4676,12 @@ static int pictureflow_main(const char* selected_file) | |||
4654 | case PF_PREV: | 4676 | case PF_PREV: |
4655 | case PF_PREV_REPEAT: | 4677 | case PF_PREV_REPEAT: |
4656 | if ( pf_state == pf_show_tracks ) | 4678 | if ( pf_state == pf_show_tracks ) |
4657 | select_prev_track(); | 4679 | { |
4680 | if (show_tracks_while_browsing) | ||
4681 | select_prev_album(); | ||
4682 | else | ||
4683 | select_prev_track(); | ||
4684 | } | ||
4658 | else if (pf_state == pf_cover_in) | 4685 | else if (pf_state == pf_cover_in) |
4659 | skip_animation_to_show_tracks(); | 4686 | skip_animation_to_show_tracks(); |
4660 | else if (pf_state == pf_cover_out) | 4687 | else if (pf_state == pf_cover_out) |
@@ -4743,16 +4770,19 @@ static int pictureflow_main(const char* selected_file) | |||
4743 | reverse_animation(); | 4770 | reverse_animation(); |
4744 | else if (pf_state == pf_cover_in) | 4771 | else if (pf_state == pf_cover_in) |
4745 | skip_animation_to_show_tracks(); | 4772 | skip_animation_to_show_tracks(); |
4773 | else if (pf_state == pf_show_tracks) | ||
4774 | { | ||
4775 | if (show_tracks_while_browsing) | ||
4776 | show_tracks_while_browsing = false; | ||
4746 | #if PF_PLAYBACK_CAPABLE | 4777 | #if PF_PLAYBACK_CAPABLE |
4747 | else if (pf_state == pf_show_tracks) { | 4778 | else if(pf_cfg.auto_wps != 0) { |
4748 | if(pf_cfg.auto_wps != 0) { | ||
4749 | if (start_playback(true)) | 4779 | if (start_playback(true)) |
4750 | return PLUGIN_GOTO_WPS; | 4780 | return PLUGIN_GOTO_WPS; |
4751 | } | 4781 | } |
4752 | else | 4782 | else |
4753 | start_playback(false); | 4783 | start_playback(false); |
4754 | } | ||
4755 | #endif | 4784 | #endif |
4785 | } | ||
4756 | break; | 4786 | break; |
4757 | default: | 4787 | default: |
4758 | exit_on_usb(button); | 4788 | exit_on_usb(button); |