addAttribution [line 406]
void addAttribution(
object
$attribution, [boolean
$append = true])
|
|
Add an identifier or location tag to the playlist attribution.
This method adds a identifier or location tag to the playlist attribution. The first parameter must be an instance of either the File_XSPF_Identifier or File_XSPF_Location classes.
The third parameter, $append, affects the output of the order of the children of the attribution element. According to the specification, the children of the attribution element should be in chronological order, so this parameter is included to make the job somewhat more simplistic.
Parameters:
addExtension [line 427]
Add an extension element to the playlist.
This method adds an extension element to the playlist. This function will only accept instances of the File_XSPF_Extension class, which is documented elsewhere.
Parameters:
addLink [line 446]
Add a link element to the playlist.
This method adds a link element to the playlist. The $link parameter must be a instance of the File_XSPF_Link class or the method will fail.
Parameters:
addMeta [line 465]
Add a meta element to the playlist.
This method adds a meta element to the playlist. The $meta parameter must be an instance of the File_XSPF_Meta class or the method will fail.
Parameters:
addTrack [line 485]
Add a track element to the playlist.
This method adds a track element to the playlist. Complimentary documentation exists for the File_XSPF_Track class, and should be the focus of the majority of attention for users building a XSPF playlist.
Parameters:
File_XSPF (Constructor) [line 334]
Creates a new File_XSPF object.
getAnnotation [line 501]
Get the annotation for this playlist.
This method returns the contents of the annotation element, which is the human-readable comment of this playlist.
getAttribution [line 518]
Get an array of attribution elements.
This method returns an array of attribution elements.
Parameters:
getAttributions [line 536]
array getAttributions(
[unknown
$filter = null])
|
|
Get an array of attribution elements.
This method returns a list of attribution elements, which is either an instance of File_XSPF_Identifier or File_XSPF_Location.
Parameters:
getCreator [line 565]
Get the author of this playlist.
This method returns the contents of the creator element, which represents the author of this playlist.
getDate [line 580]
Get the date of creation for this playlist.
This method returns the date on which this playlist was created (not last modified), formatted as a XML schema dateTime, which is the same as the 'r' parameter for date() in PHP5.
getDuration [line 594]
Get the duration of this playlist in seconds.
This method returns the length of this playlist in seconds. These times are taken from the duration elements of the playlist track elements.
getIdentifier [line 613]
Get an identifier for this playlist.
This method returns a canonical ID for this playlist as a URN. An example might be an SHA1 hash of the tracklisting, e.g. sha1://0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
getImage [line 628]
Get the image URL for this playlist.
This method returns the URL of the image used to represent this playlist. This image should be used if individual tracks belonging to this playlist do not have their own image.
getInfo [line 643]
Get the URL of a web page containing information about this playlist.
This method returns the URL of a web page, allowing the user to find out more information about the author of the playlist, and find other playlists.
getLicense [line 662]
Get the license for this playlist.
This method returns the URL of the license under which this playlist has been or will be released, such as http://www.gnu.org/copyleft/lesser.html for the LGPL. If the specified license contains a requirement for attribution, users should use the getAttribution method to retrieve an array of attributions.
getLink [line 677]
Get an array of link elements for this playlist.
This method returns a list of link elements, which contain non-XSPF web resources, which still relate to this playlist.
getLocation [line 692]
Get the source URL for this playlist.
This methods returns the URL where this playlist may be found, such as the path to an FTP or HTTP server, or perhaps the path to a file on the users local machine.
getMeta [line 708]
Get an array of non-XSPF metadata.
This method returns an array of meta elements associated with this playlist. Meta elements contain metadata not covered by the XSPF specification without breaking XSPF validation.
getTitle [line 722]
Get the human-readable title of this playlist.
This method returns the human-readable title of this playlist, which may be a simple reference to what the playlist contains, e.g. "Favourites".
getTracks [line 738]
Get an array of tracks for this playlist.
This method returns an array of File_XSPF_Track objects belonging to this playlist, which directly represent individual tracks on this playlist.
parse [line 375]
mixed parse(
string
$text)
|
|
Parses an XSPF text stream.
This method parses an XSPF text stream into the current File_XSPF instance. If successful, this function returns true, otherwise it will return an instance of PEAR_Error.
Parameters:
parseFile [line 350]
bool|PEAR_Error parseFile(
string
$path)
|
|
Parses an existing XSPF file.
This method parses an existing XSPF file into the current File_XSPF instance. If successful, this function returns true, otherwise it will return an instance of PEAR_Error.
Parameters:
setAnnotation [line 754]
boolean setAnnotation(
string
$annotation)
|
|
Set an annotation for this playlist.
This method sets an annotation, or human-readable description of this playlist, e.g. "All the Radiohead tracks in my vast collection."
Parameters:
setCreator [line 776]
void setCreator(
string
$creator)
|
|
Set the creator of this playlist.
The method sets the creator element of this playlist, which is the human-readable name of the author of the resource, such as a person's name, or a company, or a group.
Parameters:
setDate [line 793]
void setDate(
mixed
$date)
|
|
Set the creation date of this playlist.
This method sets the creation date (not last-modified date) of this playlist. If the $date parameter contains only digits, this method will assume it is a timestamp, and format it accordingly.
Parameters:
setIdentifier [line 817]
bool setIdentifier(
string
$identifier)
|
|
Set the identifier for this playlist.
This method sets an identifier for this playlist, such as a SHA1 hash of the track listing. The $identifier must be a valid URN.
Parameters:
setImage [line 839]
bool setImage(
string
$image)
|
|
Set the image URL for this playlist.
This method sets the image URL for this playlist, which provides a fallback image if individual tracks do not themselves have image URLs set.
Parameters:
setInfo [line 860]
bool setInfo(
string
$info)
|
|
Set the URL of web page for this playlist.
This method sets the URL of a web page containing information about this playlist, and possibly links to other playlists by the same author.
Parameters:
setLicense [line 884]
bool setLicense(
string
$license)
|
|
Set the license for this playlist.
This method sets the URL of the license under which this playlist was released. If the license requires attribution, such as some Creative Commons licenses, such attributions can be added using the addAttribution method.
Parameters:
setLocation [line 907]
bool setLocation(
string
$location)
|
|
Set the source URL of this playlist.
This method sets the source URL of this playlist. For example, if one offered one's playlists for syndication over the Internet, one might add a URL to direct users to the original, such as http://www.example.org/list.xspf.
Parameters:
setTitle [line 928]
void setTitle(
string
$title)
|
|
Set the title of this playlist.
This method sets the human-readable title of this playlist. For example one might call a playlist 'Favourites', or the name of a band.
Parameters:
toFile [line 994]
mixed toFile(
string
$filename)
|
|
Save this playlist to a file.
This method outputs this playlist to a file, or any other location that can be written to by fopen and fwrite. If the file write is successful, this function will return true, otherwise it will return an instance of a PEAR_Error object.
Parameters:
toM3U [line 1025]
mixed toM3U(
string
$filename)
|
|
Save this playlist as an M3U playlist.
This method saves the current XSPF playlist in M3U format, providing a one-way conversion to the popular flat file playlist. Reverse conversion is considered to be beyond the scope of this package.
Parameters:
toSMIL [line 1063]
mixed toSMIL(
string
$filename)
|
|
Save this playlist as SMIL format.
This method saves this XSPF playlist as a SMIL file, which can be used as a playlist. This is a one-way conversion, as reading SMIL files is considered beyond the scope of this application.
Parameters:
toStream [line 1109]
Output this playlist as a stream.
This method outputs this playlist as a HTTP stream with a content type of 'application/xspf+xml', which could be passed off by a user agent to a XSPF-aware application.
toString [line 1123]
Output this playlist as a string.
This method outputs this playlist as a string using the XML_Tree package.