diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2023-05-26 03:24:45 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2023-05-27 19:17:52 -0400 |
commit | 3ef49d9c5e92579dcb7e51e081b27fddf8c7b9b4 (patch) | |
tree | 055a1138f0536e1ce59715e8cda1e38faca359b3 | |
parent | 028eafaeef87b8855a79e118e4239d6220b2b6c9 (diff) | |
download | rockbox-3ef49d9c5e92579dcb7e51e081b27fddf8c7b9b4.tar.gz rockbox-3ef49d9c5e92579dcb7e51e081b27fddf8c7b9b4.zip |
PictureFlow: Make Shuffle options available
The "Playing Next..." menu couldn't display any
options for shuffling tracks of an album before
Change-Id: I54f4497394fb29877bf8bce0ef95a27c82eb2279
-rw-r--r-- | apps/onplay.c | 7 | ||||
-rw-r--r-- | apps/onplay.h | 2 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 4 | ||||
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 14 | ||||
-rw-r--r-- | apps/shortcuts.c | 5 |
6 files changed, 18 insertions, 16 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 3e52aab003..341da62840 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -828,15 +828,12 @@ static int treeplaylist_callback(int action, | |||
828 | return action; | 828 | return action; |
829 | } | 829 | } |
830 | 830 | ||
831 | void onplay_show_playlist_menu(const char* path, void (*playlist_insert_cb)) | 831 | void onplay_show_playlist_menu(const char* path, int attr, void (*playlist_insert_cb)) |
832 | { | 832 | { |
833 | context = CONTEXT_STD; | 833 | context = CONTEXT_STD; |
834 | ctx_current_playlist_insert = playlist_insert_cb; | 834 | ctx_current_playlist_insert = playlist_insert_cb; |
835 | selected_file = path; | 835 | selected_file = path; |
836 | if (dir_exists(path)) | 836 | selected_file_attr = attr; |
837 | selected_file_attr = ATTR_DIRECTORY; | ||
838 | else | ||
839 | selected_file_attr = filetype_get_attr(path); | ||
840 | in_queue_submenu = false; | 837 | in_queue_submenu = false; |
841 | do_menu(&tree_playlist_menu, NULL, NULL, false); | 838 | do_menu(&tree_playlist_menu, NULL, NULL, false); |
842 | } | 839 | } |
diff --git a/apps/onplay.h b/apps/onplay.h index 144fb80df1..ea1c2e6c38 100644 --- a/apps/onplay.h +++ b/apps/onplay.h | |||
@@ -78,6 +78,6 @@ const struct hotkey_assignment *get_hotkey(int action); | |||
78 | /* needed for the playlist viewer.. eventually clean this up */ | 78 | /* needed for the playlist viewer.. eventually clean this up */ |
79 | void onplay_show_playlist_cat_menu(const char* track_name, int attr, | 79 | void onplay_show_playlist_cat_menu(const char* track_name, int attr, |
80 | void (*add_to_pl_cb)); | 80 | void (*add_to_pl_cb)); |
81 | void onplay_show_playlist_menu(const char* path, void (*playlist_insert_cb)); | 81 | void onplay_show_playlist_menu(const char* path, int attr, void (*playlist_insert_cb)); |
82 | 82 | ||
83 | #endif | 83 | #endif |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index e3a3b1bea7..28b919b008 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -634,7 +634,7 @@ static enum pv_onplay_result onplay_menu(int index) | |||
634 | { | 634 | { |
635 | case 0: | 635 | case 0: |
636 | /* playlist */ | 636 | /* playlist */ |
637 | onplay_show_playlist_menu(current_track->name, NULL); | 637 | onplay_show_playlist_menu(current_track->name, FILE_ATTR_AUDIO, NULL); |
638 | ret = PV_ONPLAY_UNCHANGED; | 638 | ret = PV_ONPLAY_UNCHANGED; |
639 | break; | 639 | break; |
640 | case 1: | 640 | case 1: |
diff --git a/apps/plugin.h b/apps/plugin.h index 9e94fe697e..ad8822ed72 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -162,7 +162,7 @@ int plugin_open(const char *plugin, const char *parameter); | |||
162 | * when this happens please take the opportunity to sort in | 162 | * when this happens please take the opportunity to sort in |
163 | * any new functions "waiting" at the end of the list. | 163 | * any new functions "waiting" at the end of the list. |
164 | */ | 164 | */ |
165 | #define PLUGIN_API_VERSION 268 | 165 | #define PLUGIN_API_VERSION 269 |
166 | 166 | ||
167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ | 167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ |
168 | 168 | ||
@@ -495,7 +495,7 @@ struct plugin_api { | |||
495 | void (*set_current_file)(const char* path); | 495 | void (*set_current_file)(const char* path); |
496 | void (*set_dirfilter)(int l_dirfilter); | 496 | void (*set_dirfilter)(int l_dirfilter); |
497 | 497 | ||
498 | void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb)); | 498 | void (*onplay_show_playlist_menu)(const char* path, int attr, void (*playlist_insert_cb)); |
499 | void (*onplay_show_playlist_cat_menu)(const char* track_name, int attr, | 499 | void (*onplay_show_playlist_cat_menu)(const char* track_name, int attr, |
500 | void (*add_to_pl_cb)); | 500 | void (*add_to_pl_cb)); |
501 | bool (*browse_id3)(struct mp3entry *id3, | 501 | bool (*browse_id3)(struct mp3entry *id3, |
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 75504cf17e..b21faf1dd8 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -4188,7 +4188,7 @@ static int context_menu(void) | |||
4188 | { | 4188 | { |
4189 | char album_name[MAX_PATH]; | 4189 | char album_name[MAX_PATH]; |
4190 | char *file_name = get_track_filename(show_tracks_while_browsing ? 0 : pf_tracks.sel); | 4190 | char *file_name = get_track_filename(show_tracks_while_browsing ? 0 : pf_tracks.sel); |
4191 | int attr; | 4191 | int attr = FILE_ATTR_AUDIO; |
4192 | 4192 | ||
4193 | enum { | 4193 | enum { |
4194 | PF_CURRENT_PLAYLIST = 0, | 4194 | PF_CURRENT_PLAYLIST = 0, |
@@ -4205,13 +4205,15 @@ static int context_menu(void) | |||
4205 | NULL, NULL, false)) { | 4205 | NULL, NULL, false)) { |
4206 | 4206 | ||
4207 | case PF_CURRENT_PLAYLIST: | 4207 | case PF_CURRENT_PLAYLIST: |
4208 | rb->onplay_show_playlist_menu(file_name, | 4208 | if (insert_whole_album && pf_tracks.count > 1) |
4209 | &pf_current_playlist_insert); | 4209 | { |
4210 | attr = ATTR_DIRECTORY; | ||
4211 | file_name = NULL; | ||
4212 | } | ||
4213 | rb->onplay_show_playlist_menu(file_name, attr, &pf_current_playlist_insert); | ||
4210 | return 0; | 4214 | return 0; |
4211 | case PF_CATALOG: | 4215 | case PF_CATALOG: |
4212 | if (!insert_whole_album) | 4216 | if (insert_whole_album) |
4213 | attr = FILE_ATTR_AUDIO; | ||
4214 | else | ||
4215 | { | 4217 | { |
4216 | /* add a leading slash so that catalog_add_to_a_playlist | 4218 | /* add a leading slash so that catalog_add_to_a_playlist |
4217 | later prefills the name when creating a new playlist */ | 4219 | later prefills the name when creating a new playlist */ |
diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 2e10bad00f..b52ff4a741 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c | |||
@@ -640,7 +640,10 @@ int do_shortcut_menu(void *ignored) | |||
640 | } | 640 | } |
641 | else | 641 | else |
642 | { | 642 | { |
643 | onplay_show_playlist_menu(sc->u.path, NULL); | 643 | onplay_show_playlist_menu(sc->u.path, |
644 | dir_exists(sc->u.path) ? ATTR_DIRECTORY : | ||
645 | filetype_get_attr(sc->u.path), | ||
646 | NULL); | ||
644 | } | 647 | } |
645 | break; | 648 | break; |
646 | case SHORTCUT_FILE: | 649 | case SHORTCUT_FILE: |