summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-03-09 03:57:23 +0100
committerSolomon Peachy <pizza@shaftnet.org>2021-03-09 11:18:22 +0000
commit3b9a803a5b4f1e94339e7bb9724400a096900306 (patch)
treeab10bf8356e66f85f4089ba8d5ba9d4485656b34 /apps
parent13178d23b82ffde13fdbf8e36cfa0358f22e8dc3 (diff)
downloadrockbox-3b9a803a5b4f1e94339e7bb9724400a096900306.tar.gz
rockbox-3b9a803a5b4f1e94339e7bb9724400a096900306.tar.bz2
rockbox-3b9a803a5b4f1e94339e7bb9724400a096900306.zip
Show 'Play Next' option when playback is stopped
1) The Insert functionality was changed in abebc6b to not delete unfinished dynamic playlists anymore. "Play Next" has now been added as an option when playback is stopped. The behavior of "Play Next" as such has not changed and it is now the consistent way to replace a current playlist in all playback modes. 2) The 'Insert' and 'Insert Shuffle' options will now only be displayed if there is a resumable dynamic playlist Change-Id: Ib5c5469b9e2c583ab06e0f47a922c24e5adf6b5f
Diffstat (limited to 'apps')
-rw-r--r--apps/onplay.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index e7f7e589db..6f29df57cb 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -477,7 +477,18 @@ MAKE_ONPLAYMENU( wps_playlist_menu, ID2P(LANG_PLAYLIST),
/* CONTEXT_[TREE|ID3DB] playlist options */
static bool add_to_playlist(int position, bool queue)
{
- bool new_playlist = !(audio_status() & AUDIO_STATUS_PLAY) && (global_status.resume_index == -1 || playlist_resume() == -1);
+ bool new_playlist = false;
+ if (!(audio_status() & AUDIO_STATUS_PLAY))
+ {
+ if (position == PLAYLIST_REPLACE)
+ {
+ new_playlist = true;
+ position = PLAYLIST_INSERT;
+ }
+ else if (global_status.resume_index == -1 || playlist_resume() == -1)
+ new_playlist = true;
+ }
+
const char *lines[] = {
ID2P(LANG_RECURSE_DIRECTORY_QUESTION),
selected_file
@@ -594,7 +605,7 @@ static int treeplaylist_callback(int action,
/* insert items */
MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT),
playlist_insert_func, (intptr_t*)PLAYLIST_INSERT,
- NULL, Icon_Playlist);
+ treeplaylist_callback, Icon_Playlist);
MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST),
playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST,
treeplaylist_wplayback_callback, Icon_Playlist);
@@ -630,7 +641,7 @@ MENUITEM_FUNCTION(q_last_shuf_pl_item, MENU_FUNC_USEPARAM,
/* replace playlist */
MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_REPLACE),
playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE,
- treeplaylist_wplayback_callback, Icon_Playlist);
+ NULL, Icon_Playlist);
/* others */
MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW),
@@ -680,11 +691,17 @@ static int treeplaylist_callback(int action,
return action;
}
}
+ else if (this_item == &i_pl_item)
+ {
+ if (global_status.resume_index != -1)
+ return action;
+ }
else if (this_item == &i_shuf_pl_item)
{
- if ((audio_status() & AUDIO_STATUS_PLAY) ||
- (selected_file_attr & ATTR_DIRECTORY) ||
- ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U))
+ if ((global_status.resume_index != -1) &&
+ ((audio_status() & AUDIO_STATUS_PLAY) ||
+ (selected_file_attr & ATTR_DIRECTORY) ||
+ ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U)))
{
return action;
}