% $Id$ %
\section{\label{ref:working_with_playlists}Working with Playlists}

\subsection{Playlist terminology}
Some common terms that are used in Rockbox when referring to
playlists:

\begin{description}
\item[Directory.] A playlist! One of the keys to getting the most out of
  Rockbox is understanding that Rockbox \emph{always} considers the song that
  it is playing to be part of a playlist, and in some situations, Rockbox will
  create a playlist automatically. For example, if you are playing the
  contents of a directory, Rockbox will automatically create a playlist
  containing all songs in it. This means that just about anything
  that is described in this chapter with respect to playlists also applies to
  directories.

\item[Dynamic playlist.]  A dynamic playlist is a playlist that is created
  ``On the fly.'' Any time you insert or queue tracks using the
  \setting{Current Playlist submenu} (see \reference{ref:currentplaylist_submenu}), you are
  creating (or adding to) a dynamic playlist.

\item[Insert.] In Rockbox, to \setting{Insert} an item into a playlist means
  putting an item into a playlist and leaving it there, even after it is
  played. As you will see later in this chapter, Rockbox can \setting{Insert}
  into a playlist in several places.

\item[Queue.] In Rockbox, to \setting{Queue} a song means to put the song
  into a playlist and then to remove the song from the playlist once it has
  been played. The only difference between \setting{Insert} and
  \setting{Queue} is that the \setting{Queue} option removes the song from the
  playlist once it has been played, and the \setting{Insert} option does not.
\end{description}

\subsection{Creating playlists}

Rockbox can create playlists in four different ways.

\subsubsection{By selecting (``playing'') a song from the File Browser}
Whenever a song is selected from the \setting{File Browser} with
\ActionTreeEnter, Rockbox will automatically create a playlist containing
all of the songs in that directory and start playback with the selected
song.

\note{If you already have created a dynamic playlist, playing a new
  song will \emph{erase} the current dynamic playlist and create a new one.
  If you want to add a song to the current playlist
  rather than erasing the current
  playlist, see the section below on how to add music to a playlist.}

\subsubsection{By using the Clear List \& Play Next function}
The \setting{Clear List \& Play Next} function as described in
\ref{ref:currentplaylist_submenu} will 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
playlists that are not currently playing. To do this select \setting{Playlist
catalogue} in the \setting{Context Menu}. There you will have two choices,
\setting{Add to playlist} adds the selected track or directory to an existing
playlist and \setting{Add to a new playlist} creates a new playlist containing
the selected track or directory.

\note{All playlists in the \setting{Playlist catalogue} are stored by default
  in the \fname{/Playlists} directory in the root of your \daps{} disk and
  playlists stored in other locations are not included in the catalogue. It is
  however possible to move existing playlists there (see
  \reference{ref:Contextmenu}).}

\subsubsection{By using the Main Menu}
To create a playlist containing some or all of the music on your \dap{}, you can use the
\setting{Create Playlist} command in the \setting{Playlist Catalogue Context Menu}
(see \reference{ref:playlistcatalogue_contextmenu}).

\subsection{Adding music to playlists}

\subsubsection{\label{ref:currentplaylist_submenu}Adding music to a dynamic playlist}
\screenshot{rockbox_interface/images/ss-playlist-menu}{The Current Playlist Submenu}{}
The \setting{Current Playlist Submenu} is a submenu in the \setting{Context Menu} (see
\reference{ref:Contextmenu}), it allows you to put tracks into a
``dynamic playlist''. The place in which the newly
selected tracks are added to the playlist is determined by the following
options:

\begin{description}
\item [Insert.] Add track(s) after the most recently added tracks or, if tracks
have not been added yet, immediately after the currently playing track.

\item [Insert Next.] Add track(s) immediately after the currently playing track.

\item [Insert Last.] Add track(s) to the end of the playlist.

\item [Insert Shuffled.] Add track(s) to the playlist at random positions.

\item [Insert Last Shuffled.] Add tracks in a random order to the end of the playlist.

\item [Clear List \& 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}

There are also options for adding tracks only temporarily to the dynamic playlist.
In Rockbox’s parlance, this is called queuing. Queued tracks are automatically
removed from the playlist after they have been played. They are also not saved
to the playlist file (see \reference{ref:playlistoptions}).

\begin{description}
\item [Queue.] Corresponds to \setting{Insert}.

\item [Queue Next.] Corresponds to \setting{Insert Next}.

\item [Queue Last.] Corresponds to \setting{Insert Last}.

\item [Queue Shuffled.] Corresponds to \setting{Insert Shuffled}.

\item [Queue Last Shuffled.] Corresponds to \setting{Insert Last Shuffled}.
\end{description}

\note{You can hide the options to add shuffled tracks or to queue tracks, if you wish.
The latter can also be put into its own submenu.  Simply go to
\setting{Settings} $\rightarrow$ \setting{General Settings} $\rightarrow$ \setting{Playlists}
$\rightarrow$ \setting{Current Playlist} and select either \setting{Show Shuffled Adding Options}
or \setting{Show Queue Options} to customize the displayed set of options.}

The \setting{Current Playlist Submenu}  can be used to add either single tracks or
entire directories to a playlist. If the \setting{Current Playlist Submenu} is
invoked on a single track, it will put only that track into the playlist.
On the other hand, if the \setting{Current 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
  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
  you would like Rockbox to include tracks in subdirectories as well as tracks
  in the currently-selected directory.}

Dynamic playlists are saved so resume will restore them exactly as they
were before shutdown.

\note{To view, save, reshuffle, or display the play time of the current
  dynamic playlist use the
  \setting{Playlist} sub menu in the WPS context menu or in the
  \setting{Main Menu}.}

\subsection{Modifying playlists}
\subsubsection{Reshuffling}
Reshuffling the current playlist is easily done from the \setting{Playlist}
sub menu in the WPS, just select \setting{Reshuffle}.

\subsubsection{Moving and removing tracks}
To move or remove a track from the current playlist enter the
\setting{Playlist Viewer} by selecting \setting{View Current Playlist} in the
\setting{Playlist} submenu in the WPS context menu or the \setting{Main Menu}.
Once in the \setting{Playlist Viewer} open the context menu on the track you
want to move or remove. If you want to move the track, select \setting{Move} in
the context menu and then move the blinking cursor to the place where you want
the track to be moved and confirm with \ActionStdOk. To remove a track, simply
select \setting{Remove} in the context menu.

\subsection{Saving playlists}
To save the current playlist either enter the \setting{Playlist} submenu
in the \setting{WPS Context Menu} (see \reference{sec:contextmenu}) and
select \setting{Save Current Playlist} or enter the
\setting{Playlist Options} menu in the \setting{Main Menu} and select
\setting{Save Current Playlist}.
Either method will bring you to the \setting{Virtual Keyboard} (see
\reference{sec:virtual_keyboard}), enter a filename for your playlist and
accept it and you are done.

\subsection{Loading saved playlists}
\subsubsection{Through the \setting{File Browser}}
Playlist files, like regular music tracks, can be selected through the
\setting{File Browser}. When loading a playlist from disk it will replace
the current dynamic playlist.

\subsubsection{Through the \setting{Playlist catalogue}}
The \setting{Playlist catalogue} offers a shortcut to all playlists in your
\daps{} specified playlist directory.
It can be used like the \setting{File Browser}.

