class

PLS::Playlist

Inherits Reference < Object

https://en.wikipedia.org/wiki/PLS_(file_format)

Constants

FILE_KEY = /\AFile\d+\z/
LENGTH_KEY = /\ALength\d+\z/
TITLE_KEY = /\ATitle\d+\z/

Constructors

new(data : Hash(String, String) = {} of String => String)

Creates a new Playlist object.

Source

Class methods

parse(string : String)

Parses the given string (with the contents of a PLS playlist) and returns a Playlist object.

Source

Instance methods

empty?

Returns true if the Playlist has no entries.

Source
entries

Returns an Array of PLS::Entry objects.

Source
files

Returns all file fields.

Source
lengths

Returns all length values. A length is defined in seconds. A value of -1 indicates indefinite length (streaming). (optional)

Source
number_of_entries

Return the number of entries as stored in the PLS.

Source
titles

Returns track titles. (Track titles are optional in a PLS).

Source
to_s(io : IO)

Output all entries to io.

Source
version_field

Retturns the Playlist version. Currently only a value of 2 is valid. It will return "1" if the field is missing.

Source