diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2021-03-09 03:57:23 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-03-09 11:18:22 +0000 |
commit | 3b9a803a5b4f1e94339e7bb9724400a096900306 (patch) | |
tree | ab10bf8356e66f85f4089ba8d5ba9d4485656b34 | |
parent | 13178d23b82ffde13fdbf8e36cfa0358f22e8dc3 (diff) | |
download | rockbox-3b9a803a5b4f1e94339e7bb9724400a096900306.tar.gz 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
-rw-r--r-- | apps/onplay.c | 29 | ||||
-rw-r--r-- | manual/working_with_playlists/main.tex | 28 |
2 files changed, 35 insertions, 22 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), | |||
477 | /* CONTEXT_[TREE|ID3DB] playlist options */ | 477 | /* CONTEXT_[TREE|ID3DB] playlist options */ |
478 | static bool add_to_playlist(int position, bool queue) | 478 | static bool add_to_playlist(int position, bool queue) |
479 | { | 479 | { |
480 | bool new_playlist = !(audio_status() & AUDIO_STATUS_PLAY) && (global_status.resume_index == -1 || playlist_resume() == -1); | 480 | bool new_playlist = false; |
481 | if (!(audio_status() & AUDIO_STATUS_PLAY)) | ||
482 | { | ||
483 | if (position == PLAYLIST_REPLACE) | ||
484 | { | ||
485 | new_playlist = true; | ||
486 | position = PLAYLIST_INSERT; | ||
487 | } | ||
488 | else if (global_status.resume_index == -1 || playlist_resume() == -1) | ||
489 | new_playlist = true; | ||
490 | } | ||
491 | |||
481 | const char *lines[] = { | 492 | const char *lines[] = { |
482 | ID2P(LANG_RECURSE_DIRECTORY_QUESTION), | 493 | ID2P(LANG_RECURSE_DIRECTORY_QUESTION), |
483 | selected_file | 494 | selected_file |
@@ -594,7 +605,7 @@ static int treeplaylist_callback(int action, | |||
594 | /* insert items */ | 605 | /* insert items */ |
595 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), | 606 | MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), |
596 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, | 607 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT, |
597 | NULL, Icon_Playlist); | 608 | treeplaylist_callback, Icon_Playlist); |
598 | MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), | 609 | MENUITEM_FUNCTION(i_first_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT_FIRST), |
599 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST, | 610 | playlist_insert_func, (intptr_t*)PLAYLIST_INSERT_FIRST, |
600 | treeplaylist_wplayback_callback, Icon_Playlist); | 611 | treeplaylist_wplayback_callback, Icon_Playlist); |
@@ -630,7 +641,7 @@ MENUITEM_FUNCTION(q_last_shuf_pl_item, MENU_FUNC_USEPARAM, | |||
630 | /* replace playlist */ | 641 | /* replace playlist */ |
631 | MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_REPLACE), | 642 | MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_REPLACE), |
632 | playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE, | 643 | playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE, |
633 | treeplaylist_wplayback_callback, Icon_Playlist); | 644 | NULL, Icon_Playlist); |
634 | 645 | ||
635 | /* others */ | 646 | /* others */ |
636 | MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW), | 647 | MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW), |
@@ -680,11 +691,17 @@ static int treeplaylist_callback(int action, | |||
680 | return action; | 691 | return action; |
681 | } | 692 | } |
682 | } | 693 | } |
694 | else if (this_item == &i_pl_item) | ||
695 | { | ||
696 | if (global_status.resume_index != -1) | ||
697 | return action; | ||
698 | } | ||
683 | else if (this_item == &i_shuf_pl_item) | 699 | else if (this_item == &i_shuf_pl_item) |
684 | { | 700 | { |
685 | if ((audio_status() & AUDIO_STATUS_PLAY) || | 701 | if ((global_status.resume_index != -1) && |
686 | (selected_file_attr & ATTR_DIRECTORY) || | 702 | ((audio_status() & AUDIO_STATUS_PLAY) || |
687 | ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U)) | 703 | (selected_file_attr & ATTR_DIRECTORY) || |
704 | ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U))) | ||
688 | { | 705 | { |
689 | return action; | 706 | return action; |
690 | } | 707 | } |
diff --git a/manual/working_with_playlists/main.tex b/manual/working_with_playlists/main.tex index 96fb259414..dbbeefc7d6 100644 --- a/manual/working_with_playlists/main.tex +++ b/manual/working_with_playlists/main.tex | |||
@@ -48,10 +48,10 @@ song. | |||
48 | rather than erasing the current | 48 | rather than erasing the current |
49 | playlist, see the section below on how to add music to a playlist.} | 49 | playlist, see the section below on how to add music to a playlist.} |
50 | 50 | ||
51 | \subsubsection{By using Insert and Queue functions} | 51 | \subsubsection{By using the Play Next function} |
52 | If a dynamic playlist has finished playing, the \setting{Insert} and | 52 | The \setting{Play Next} function as described in \ref{ref:playlist_submenu} will |
53 | \setting{Queue} functions as described in \ref{ref:playlist_submenu} will | 53 | \emph{replace} the dynamic playlist with the selected tracks. If a track is |
54 | \emph{replace} the playlist with the selected tracks instead of adding to it. | 54 | currently playing, it is only removed once it’s finished playing. |
55 | 55 | ||
56 | \subsubsection{\label{ref:playlist_catalogue}By using the Playlist catalogue} | 56 | \subsubsection{\label{ref:playlist_catalogue}By using the Playlist catalogue} |
57 | The \setting{Playlist catalogue} makes it possible to modify and create | 57 | The \setting{Playlist catalogue} makes it possible to modify and create |
@@ -74,15 +74,12 @@ in the \setting{Main Menu}. The created playlist will be named | |||
74 | \fname{root.m3u8} and saved in the root of your \daps{} disk. | 74 | \fname{root.m3u8} and saved in the root of your \daps{} disk. |
75 | 75 | ||
76 | \subsection{Adding music to playlists} | 76 | \subsection{Adding music to playlists} |
77 | 77 | ||
78 | \subsubsection{\label{ref:playlist_submenu}Adding music to a dynamic playlist} | 78 | \subsubsection{\label{ref:playlist_submenu}Adding music to a dynamic playlist} |
79 | \screenshot{rockbox_interface/images/ss-playlist-menu}{The Playlist Submenu}{} | 79 | \screenshot{rockbox_interface/images/ss-playlist-menu}{The Playlist Submenu}{} |
80 | The \setting{Playlist Submenu} is a submenu in the \setting{Context Menu} (see | 80 | The \setting{Playlist Submenu} is a submenu in the \setting{Context Menu} (see |
81 | \reference{ref:Contextmenu}), it allows you to put tracks into a | 81 | \reference{ref:Contextmenu}), it allows you to put tracks into a |
82 | ``dynamic playlist''. If the current playlist has finished playing, Rockbox will | 82 | ``dynamic playlist''. The place in which the newly |
83 | create a new dynamic playlist and put the selected track(s) into it. | ||
84 | If there is music currently playing, Rockbox will put the | ||
85 | selected track(s) into the current playlist. The place in which the newly | ||
86 | selected tracks are added to the playlist is determined by the following | 83 | selected tracks are added to the playlist is determined by the following |
87 | options: | 84 | options: |
88 | 85 | ||
@@ -90,8 +87,7 @@ options: | |||
90 | \item [Insert.] Add track(s) immediately after any tracks added via the most | 87 | \item [Insert.] Add track(s) immediately after any tracks added via the most |
91 | recent \setting{Insert} operation. If no tracks have yet been added via an | 88 | recent \setting{Insert} operation. If no tracks have yet been added via an |
92 | \setting{Insert}, new tracks will be added immediately after the current | 89 | \setting{Insert}, new tracks will be added immediately after the current |
93 | playing track. If a dynamic playlist has finished playing, | 90 | playing track. |
94 | it will be \emph{replaced} by the selected track(s). | ||
95 | 91 | ||
96 | \item [Insert Next.] Add track(s) immediately after current playing | 92 | \item [Insert Next.] Add track(s) immediately after current playing |
97 | track, no matter what else has been inserted. | 93 | track, no matter what else has been inserted. |
@@ -106,17 +102,17 @@ options: | |||
106 | deleted immediately from the playlist after they have been played. Also, | 102 | deleted immediately from the playlist after they have been played. Also, |
107 | queued tracks are not saved to the playlist file (see | 103 | queued tracks are not saved to the playlist file (see |
108 | \reference{ref:playlistoptions}). | 104 | \reference{ref:playlistoptions}). |
109 | 105 | ||
110 | \item [Queue Next.] Queue track(s) immediately after current playing track. | 106 | \item [Queue Next.] Queue track(s) immediately after current playing track. |
111 | 107 | ||
112 | \item [Queue Last.] Queue track(s) at end of playlist. | 108 | \item [Queue Last.] Queue track(s) at end of playlist. |
113 | 109 | ||
114 | \item [Queue Shuffled.] Queue track(s) in a random order. | 110 | \item [Queue Shuffled.] Queue track(s) in a random order. |
115 | 111 | ||
116 | \item [Queue Last Shuffled.] Queue tracks in a random order at the end of the playlist. | 112 | \item [Queue Last Shuffled.] Queue tracks in a random order at the end of the playlist. |
117 | 113 | ||
118 | \item [Play Next.] Replaces all but the current playing track with track(s). | 114 | \item [Play Next.] Replaces all tracks in the dynamic playlist. |
119 | Current playing track is queued. | 115 | If a track is currently playing, it is only removed once it’s finished playing. |
120 | \end{description} | 116 | \end{description} |
121 | 117 | ||
122 | The \setting{Playlist Submenu} can be used to add either single tracks or | 118 | The \setting{Playlist Submenu} can be used to add either single tracks or |
@@ -126,7 +122,7 @@ On the other hand, if the \setting{Playlist Submenu} is invoked on a | |||
126 | directory, Rockbox adds all of the tracks in that directory to the | 122 | directory, Rockbox adds all of the tracks in that directory to the |
127 | playlist. | 123 | playlist. |
128 | 124 | ||
129 | \note{You can control whether or not Rockbox includes the contents of | 125 | \note{You can control whether or not Rockbox includes the contents of |
130 | subdirectories when adding an entire directory to a playlist. Set the | 126 | subdirectories when adding an entire directory to a playlist. Set the |
131 | \setting{Settings $\rightarrow$ General Settings $\rightarrow$ Playlist | 127 | \setting{Settings $\rightarrow$ General Settings $\rightarrow$ Playlist |
132 | $\rightarrow$ Recursively Insert Directories} setting to \setting{Yes} if | 128 | $\rightarrow$ Recursively Insert Directories} setting to \setting{Yes} if |