Basic playlists: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Sho
No edit summary
>Sho
(Cleanup and corrections)
Line 1: Line 1:
A Playlist is a file that includes several media files (Audio or Video), and plays them in succession.
A Playlist is a normal text file that lists one or more media files (Audio or Video), and plays them in succession.
You can either create your own or use existing playlists from other sources, e.g. Winamp m3u playlists.
You can either create your own or use existing playlists from other sources, e.g. Winamp M3U playlists.
Going to the Playlist item on the left side of the [[My Music]] page will take you to all playlists in your media library, same goes for the [[My Videos]] page.
Going to the ''Playlist'' item in the right pane of the [[Music]] and [[Videos]] page will take you to the corresponding playlists.
 
==Supported Playlists==
XBMC supports [http://en.wikipedia.org/wiki/PLS_%28file_format%29 PLS], Winamp [http://en.wikipedia.org/wiki/M3U M3U] and [[Playlists#Smart Playlists|XBMC Smart Playlist (XSP)]] playlists


==Working with Playlists==
==Working with Playlists==
Line 8: Line 11:
There are several ways to manipulate playlists in XBMC, one is the [[The Web Interface|the web interface]], another is using the "controller / remote"
There are several ways to manipulate playlists in XBMC, one is the [[The Web Interface|the web interface]], another is using the "controller / remote"


Pressing the '''black''' button on the gamepad or '''"Title"''' button on the Remote control, brings up the context menu.  The playlist is accessible via the "Now Playing" item.  If the playlist is currently empty, that option will not be visible in the context menu.
Pressing the '''black''' button on the gamepad or '''"Title"''' button on the Remote control, brings up the context menu.  The currently playing playlist is accessible via the "Now Playing" item.  If the playlist is currently empty, that option will not be visible in the context menu.


You can add songs or entire folders with the '''Y''' button on the gamepad, or '''0''' on the Remote Control.  Alternatively, the "Queue Item" option in the context menu can be used.
You can add songs or entire folders with the '''Y''' button on the gamepad, or '''0''' on the Remote Control.  Alternatively, the "Queue Item" option in the context menu can be used.
Line 14: Line 17:
Switching back to the playlist view with the '''black''' or '''Title''' button (gamepad/remote) and then pressing the '''A''' or the '''Play''' button  (gamepad/remote) will play your playlist.
Switching back to the playlist view with the '''black''' or '''Title''' button (gamepad/remote) and then pressing the '''A''' or the '''Play''' button  (gamepad/remote) will play your playlist.


Once in The Playlists view, you can save your playlist. Playlists are by default saved in the $HOME\[[The_UserData_Folder|UserData]]\playlists folder (separate folder for music and video playlists).
Once in The Playlists view, you can save your playlist. Playlists are by default saved in a subfolder  of $HOME\[[The_UserData_Folder|UserData]]\playlists (separate folder for music and video playlists).


|
|
Line 20: Line 23:
|}
|}


==Winamp M3U Playlists==
==Playlists on Remote Computers==
{|
{|
| valign="top" |
| valign="top" |
If you use Winamp [http://en.wikipedia.org/wiki/M3U M3U] playlists to play files on a remote computer, make sure the contents of the m3u match the file structure relative to XBMC.---(ie, if your using samba, you'll need to use smb://fullpath/file.mp3).
If you use playlists to play files on a remote computer, make sure the contents of the playlist file match the file structure relative to XBMC.---(ie, if your using samba, you'll need to use smb://fullpath/file.mp3).


'''Example:'''
'''Example:'''
Line 30: Line 33:
"C:\music\mp3s\" is shared out as mp3 on your PC using [[Configuring PC Shares|PC file sharing]]  
"C:\music\mp3s\" is shared out as mp3 on your PC using [[Configuring PC Shares|PC file sharing]]  


for that to work each playlist item in your m3u file must be formatted thus:
For that to work each item in your playlist file must be formatted thus:
smb://workgroup;someuser:somepass@computer/mp3/fileN.mp3
 
smb://workgroup;someuser:somepass@computer/mp3/fileN.mp3


Alternatively, there are settings in [[AdvancedSettings.xml]] for path substitutions in playlists. For instance, by adding
Alternatively, there are settings in [[AdvancedSettings.xml]] for path substitutions in playlists. For instance, by adding
Line 42: Line 46:
  </pathsubstitution>
  </pathsubstitution>
</xml>
</xml>
you could use the same playlist file on your PC and XBMC. That is, anywhere the path c:\music\mp3s\ is found in a playlist, XBMC would
You could use the same playlist file on your PC and XBMC. That is, anywhere the path c:\music\mp3s\ is found in a playlist, XBMC would substitute smb://workgroup;someuser:somepass@computer/mp3/
substitute smb://workgroup;someuser:somepass@computer/mp3/.


|
|


|}
|}
Going to the Playlist item on the left side of the [[My Music]] page will take you to all playlists in your media library, same goes for the [[My Videos]] page.


==Party Mode Playlist==
==Party Mode Playlist==
{|
{|
| valign="top" |
| valign="top" |
The [[Music Library#Party Mode|Party Mode]] playlist is the only predefined playlist in XBMC. It can be configured via the [[PartyMode.xml]] file in [[The UserData Folder]]. The Party Mode playlist is a smart playlist and can be configured as seen below.
The [[Music Library#Party Mode|Party Mode]] music playlist is the only predefined playlist in XBMC. It can be configured via the [[PartyMode.xml]] file in [[The UserData Folder]]. The Party Mode playlist is a smart playlist and can be configured as seen below.
|
|
|}
|}
Line 61: Line 62:
{|
{|
| valign="top" |
| valign="top" |
 
XBMC now supports "Smart" playlists for music, which essentially use a set of rules to limit the songs from the music database.<br>
XBMC now supports "Smart" playlists, which essentially use a set of rules to limit the songs from the music database.
Smart playlists can be created either by using the built-in GUI Smart Playlist Editor accessible from the Playlist section, or by creating an xml file with the extension .xsp (XBMC Smart Playlist).
 
Currently there is no way to generate a Smart Playlist from within the XBMC GUI, but you can easily setup some by creating an xml file with the extension .xsp.


===Format of a Smart Playlist File===
===Format of a Smart Playlist File===
 
Smart playlists are plain text files that can be parsed by an xml reader.  Any text editor can be used to create them.<br>
Smart playlists are xml files using the extension .xsp (Xbmc Smart Playlist).  These are just text files that can be parsed by an xml reader.  Any text editor can be used to create them. The format is as follows:
The format is as follows:


<xml>
<xml>
Line 83: Line 82:
Basically there are 2 header tags, <name> and <match> and then a set of <rule> tags that define the rules to use, along with an <order> tag to allow sorting and a <limit> tag to limit the returned results.  Note that the tags and attributes are all case-sensitive.  The <name> tag is the name of the playlist (currently unused) and the <match> tag indicates how the <rule> tags should be matched.  If <match>all</match> like in the above example, then only songs which satisfy all the <rule>'s will be included.  If <match>one</match> is specified, then songs that satisfy any one (or more) of the <rule>'s will be included.
Basically there are 2 header tags, <name> and <match> and then a set of <rule> tags that define the rules to use, along with an <order> tag to allow sorting and a <limit> tag to limit the returned results.  Note that the tags and attributes are all case-sensitive.  The <name> tag is the name of the playlist (currently unused) and the <match> tag indicates how the <rule> tags should be matched.  If <match>all</match> like in the above example, then only songs which satisfy all the <rule>'s will be included.  If <match>one</match> is specified, then songs that satisfy any one (or more) of the <rule>'s will be included.


The <rule> tags, of which there can be as many as you wish, have 2 attributes (field and operator) and a value (the parameter).  The allowed fields are
The <rule> tags, of which there can be as many as you wish, have 2 attributes (field and operator) and a value (the parameter).  The allowed fields are:


{|
{|
Line 170: Line 169:


===Smart Playlist Examples===
===Smart Playlist Examples===
'''Recently played songs'''
'''Recently played songs'''
<xml>
<xml>
Line 204: Line 202:


===Combining Playlists===
===Combining Playlists===
The "playlist" field can be used to combine several playlists together.  When playlists are combined, the <limit> and <order> tags of the included playlists are ignored; only the <order> and <limit> of the final playlist are used.
The "playlist" field can be used to combine several playlists together.  When playlists are combined, the <limit> and <order> tags of the included playlists are ignored; only the <order> and <limit> of the final playlist are used.


Line 224: Line 221:


|}
|}
[[category:Customization]]
[[category:Customization]]
[[category:Usage]]
[[category:Usage]]
[[category:User Interface]]

Revision as of 17:14, 26 May 2007

A Playlist is a normal text file that lists one or more media files (Audio or Video), and plays them in succession. You can either create your own or use existing playlists from other sources, e.g. Winamp M3U playlists. Going to the Playlist item in the right pane of the Music and Videos page will take you to the corresponding playlists.

Supported Playlists

XBMC supports PLS, Winamp M3U and XBMC Smart Playlist (XSP) playlists

Working with Playlists

There are several ways to manipulate playlists in XBMC, one is the the web interface, another is using the "controller / remote"

Pressing the black button on the gamepad or "Title" button on the Remote control, brings up the context menu. The currently playing playlist is accessible via the "Now Playing" item. If the playlist is currently empty, that option will not be visible in the context menu.

You can add songs or entire folders with the Y button on the gamepad, or 0 on the Remote Control. Alternatively, the "Queue Item" option in the context menu can be used.

Switching back to the playlist view with the black or Title button (gamepad/remote) and then pressing the A or the Play button (gamepad/remote) will play your playlist.

Once in The Playlists view, you can save your playlist. Playlists are by default saved in a subfolder of $HOME\UserData\playlists (separate folder for music and video playlists).

Playlists on Remote Computers

If you use playlists to play files on a remote computer, make sure the contents of the playlist file match the file structure relative to XBMC.---(ie, if your using samba, you'll need to use smb://fullpath/file.mp3).

Example: You want to play several files located in C:\music\mp3\ on your PC with XBMC.

"C:\music\mp3s\" is shared out as mp3 on your PC using PC file sharing

For that to work each item in your playlist file must be formatted thus:

smb://workgroup;someuser:somepass@computer/mp3/fileN.mp3

Alternatively, there are settings in AdvancedSettings.xml for path substitutions in playlists. For instance, by adding <xml>

<pathsubstitution>
 <substitute>
   <from>C:\music\mp3s\</from>
   <to>smb://workgroup;someuser:somepass@computer/mp3/</to>
 </substitute>
</pathsubstitution>

</xml> You could use the same playlist file on your PC and XBMC. That is, anywhere the path c:\music\mp3s\ is found in a playlist, XBMC would substitute smb://workgroup;someuser:somepass@computer/mp3/

Party Mode Playlist

The Party Mode music playlist is the only predefined playlist in XBMC. It can be configured via the PartyMode.xml file in The UserData Folder. The Party Mode playlist is a smart playlist and can be configured as seen below.

Smart Playlists

XBMC now supports "Smart" playlists for music, which essentially use a set of rules to limit the songs from the music database.
Smart playlists can be created either by using the built-in GUI Smart Playlist Editor accessible from the Playlist section, or by creating an xml file with the extension .xsp (XBMC Smart Playlist).

Format of a Smart Playlist File

Smart playlists are plain text files that can be parsed by an xml reader. Any text editor can be used to create them.
The format is as follows:

<xml>

  <smartplaylist>
   <name>All U2 from after 1990</name>
   <match>all</match>
   <rule field="artist" operator="is">U2</rule>
   <rule field="year" operator="greaterthan">1990</rule>
   <limit>50</limit>
   <order direction="descending">playcount</order>
  </smartplaylist>

</xml>

Basically there are 2 header tags, <name> and <match> and then a set of <rule> tags that define the rules to use, along with an <order> tag to allow sorting and a <limit> tag to limit the returned results. Note that the tags and attributes are all case-sensitive. The <name> tag is the name of the playlist (currently unused) and the <match> tag indicates how the <rule> tags should be matched. If <match>all</match> like in the above example, then only songs which satisfy all the <rule>'s will be included. If <match>one</match> is specified, then songs that satisfy any one (or more) of the <rule>'s will be included.

The <rule> tags, of which there can be as many as you wish, have 2 attributes (field and operator) and a value (the parameter). The allowed fields are:

album Album the song appears on
artist Artist of the song
albumartist Artist of the album the song appears on
genre Genre of the song
title Title of the song
year Year of the song
tracknumber Track number of the song
time Duration of the song
playcount Number of times the song has been played
filename Filename of the song (excluding path)
lastplayed Date/time of last time the song was played
rating User rating of the song (from 1-5). 0 signifies no rating.
comment Comment tag of the song
playlist Whether the song is in the given playlist

The operator attribute specifies the rule that should be used to match the parameter to the field. All matching is done case-insensitive. The allowed operators are

contains True if the field contains the parameter as a substring
doesnotcontain True if the field does not contain the parameter as a substring
is True if the field matches the parameter exactly (case insensitive)
isnot True if the field does not match the parameter exactly (case insensitive)
startswith True if the start of the field matches the parameter
endswith True if the end of the field matches the parameter
lessthan True if the content of the field is is less than the parameter
greaterthan True if the content of the field is is greater than the parameter
inthelast True if the field falls in the last range specified by the parameter. Only applicable for a date field.
notinthelast True if the field does not fall in the last range specified by the parameter. Only applicable for a date field.

The <limit> tag simply takes a number of songs as it's limit. A missing limit tag, or <limit>0</limit> will retrieve all matching songs. The <order> tag has a direction attribute, the values of which can be "ascending" or "descending", and it's value is a field as above, or can be <order>random</order> if you want a random ordering returned. Note that random should be used with care - it is quite slow if the returned results from the <rule> sets is large (> 500 items).

The above example, therefore selects all songs whose artist field is U2 and whose year field is greater than 1990, orders them by the number of times they've been played (most played first) then limits it to just 50. Thus, the top 50 songs you've played from all U2 songs published after 1990.

Smart playlists should be placed in your $HOME\UserData\playlists\music folder on the xbox harddisk. They cannot be read off of remote shares at present.

Smart Playlist Examples

Recently played songs <xml> <smartplaylist>

 <name>Recently Played Songs</name>
 <match>all</match>
 <rule field="lastplayed" operator="inthelast">2 weeks</rule>
 <order direction="descending">lastplayed</order>

</smartplaylist> </xml>

Top 100 songs <xml> <smartplaylist>

 <name>Top 100 Songs</name>
 <match>all</match>
 <rule field="playcount" operator="greaterthan">0</rule>
 <order direction="descending">playcount</order>
 <limit>100</limit>

</smartplaylist> </xml>

Rock music from the 1970s <xml> <smartplaylist>

 <name>Rock Music from the 1970s</name>
 <match>all</match>
 <rule field="genre" operator="is">Rock</rule>
 <rule field="year" operator="greaterthan">1969</rule>
 <rule field="year" operator="lessthan">1980</rule>

</smartplaylist> </xml>

Combining Playlists

The "playlist" field can be used to combine several playlists together. When playlists are combined, the <limit> and <order> tags of the included playlists are ignored; only the <order> and <limit> of the final playlist are used.

As a simple example, lets create a new playlist combining the "Rock Music from the 1970s" and "Recently Played Songs" playlists above, to produce a playlist with the recently played rock songs from the 1970s.

Recently played rock tracks from the 1970s <xml> <smartplaylist>

 <name>Recently played  Rock Tracks from the 1970s</name>
 <match>all</match>
 <rule field="playlist" operator="is">Rock Music from the 1970s</rule>
 <rule field="playlist" operator="is">Recently Played Songs</rule>

</smartplaylist> </xml>

Using this system allows very complex queries to be built. Note that in a single playlist, you can only match ALL of the rules, or ONE (or more) of the rules. This is basically either ANDing the conditions together, or ORing them together. You cannot mix AND with OR in a single playlist. To build up a playlist with both AND and OR operations on the rules, you use multiple playlists to group the AND operations and the OR operations, then combine them as above.