diff options
-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), /* 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; } 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. rather than erasing the current playlist, see the section below on how to add music to a playlist.} -\subsubsection{By using Insert and Queue functions} -If a dynamic playlist has finished playing, the \setting{Insert} and -\setting{Queue} functions as described in \ref{ref:playlist_submenu} will -\emph{replace} the playlist with the selected tracks instead of adding to it. +\subsubsection{By using the Play Next function} +The \setting{Play Next} function as described in \ref{ref:playlist_submenu} will +\emph{replace} the dynamic playlist with the selected tracks. If a track is +currently playing, it is only removed once it’s finished playing. \subsubsection{\label{ref:playlist_catalogue}By using the Playlist catalogue} 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 \fname{root.m3u8} and saved in the root of your \daps{} disk. \subsection{Adding music to playlists} - + \subsubsection{\label{ref:playlist_submenu}Adding music to a dynamic playlist} \screenshot{rockbox_interface/images/ss-playlist-menu}{The Playlist Submenu}{} The \setting{Playlist Submenu} is a submenu in the \setting{Context Menu} (see \reference{ref:Contextmenu}), it allows you to put tracks into a -``dynamic playlist''. If the current playlist has finished playing, Rockbox will -create a new dynamic playlist and put the selected track(s) into it. -If there is music currently playing, Rockbox will put the -selected track(s) into the current playlist. The place in which the newly +``dynamic playlist''. The place in which the newly selected tracks are added to the playlist is determined by the following options: @@ -90,8 +87,7 @@ options: \item [Insert.] Add track(s) immediately after any tracks added via the most recent \setting{Insert} operation. If no tracks have yet been added via an \setting{Insert}, new tracks will be added immediately after the current - playing track. If a dynamic playlist has finished playing, - it will be \emph{replaced} by the selected track(s). + playing track. \item [Insert Next.] Add track(s) immediately after current playing track, no matter what else has been inserted. @@ -106,17 +102,17 @@ options: deleted immediately from the playlist after they have been played. Also, queued tracks are not saved to the playlist file (see \reference{ref:playlistoptions}). - + \item [Queue Next.] Queue track(s) immediately after current playing track. - + \item [Queue Last.] Queue track(s) at end of playlist. \item [Queue Shuffled.] Queue track(s) in a random order. \item [Queue Last Shuffled.] Queue tracks in a random order at the end of the playlist. -\item [Play Next.] Replaces all but the current playing track with track(s). - Current playing track is queued. +\item [Play Next.] Replaces all tracks in the dynamic playlist. +If a track is currently playing, it is only removed once it’s finished playing. \end{description} 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 directory, Rockbox adds all of the tracks in that directory to the playlist. -\note{You can control whether or not Rockbox includes the contents of +\note{You can control whether or not Rockbox includes the contents of subdirectories when adding an entire directory to a playlist. Set the \setting{Settings $\rightarrow$ General Settings $\rightarrow$ Playlist $\rightarrow$ Recursively Insert Directories} setting to \setting{Yes} if |