class RemiAudio::Xspf::Track

Overview

The Track class represents a single track within a playlist.

Included Modules

Defined in:

remiaudio/xspf/xspf.cr

Constructors

Instance Method Summary

Constructor Detail

def self.fromXML(parent : XML::Node, ns : XML::Namespace | Nil) : Track #

Creates a new Track instance by parsing XML starting at parent. The parent node should be the <track> element itself.


[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new #

Creates a new Track instance.


[View source]
def self.new(*locationURIs : URI, title : String | Nil = nil, album : String | Nil = nil, creator : String | Nil = nil, trackNumber : UInt64 | Nil = nil) #

Creates a new Track instance.


[View source]

Instance Method Detail

def album : String | Nil #

The human-readable name of the album this track belongs to, if any. If this is nil, then no <album> element is emitted for the <track> element.


[View source]
def album=(album : String | Nil) #

The human-readable name of the album this track belongs to, if any. If this is nil, then no <album> element is emitted for the <track> element.


[View source]
def annotate : String | Nil #

A human-readable comment for this track, if any. If this is nil, then no <annotation> element is emitted for the <track> element. This should never contain markup.


[View source]
def annotate=(annotate : String | Nil) #

A human-readable comment for this track, if any. If this is nil, then no <annotation> element is emitted for the <track> element. This should never contain markup.


[View source]
def creator : String | Nil #

The human-readable name of the creator of this track, if any. If this is nil, then no <creator> element is emitted for the <track> element.


[View source]
def creator=(creator : String | Nil) #

The human-readable name of the creator of this track, if any. If this is nil, then no <creator> element is emitted for the <track> element.


[View source]
def duration : UInt64 | Nil #

The approximate length of this track. This length only serves as a hint and may not be accurate. If this is nil, then no <duration> element is emitted for the <track> element.


[View source]
def duration=(duration : UInt64 | Nil) #

The approximate length of this track. This length only serves as a hint and may not be accurate. If this is nil, then no <duration> element is emitted for the <track> element.


[View source]
def identifiers : Array(URI) #

An ordered list of URIs describing the cannonical identifier of this track.


[View source]
def identifiers=(identifiers : Array(URI)) #

An ordered list of URIs describing the cannonical identifier of this track.


[View source]
def image : URI | Nil #

A URI pointing to an image that can be displayed while this track is playing. If this is nil, then no <image> element is emitted for the <track> element.


[View source]
def image=(image : URI | Nil) #

A URI pointing to an image that can be displayed while this track is playing. If this is nil, then no <image> element is emitted for the <track> element.


[View source]
def info : URI | Nil #

A URI of a web page that provides more information about this track. If this is nil, then no <info> element is emitted for the <track> element.


[View source]
def info=(info : URI | Nil) #

A URI of a web page that provides more information about this track. If this is nil, then no <info> element is emitted for the <track> element.


[View source]
def links : Array(Link) #

An array of Link instances that allow track information to be extended without extra XML namespaces. If this is empty, then no <link> element is emitted for the <track> element.


[View source]
def links=(links : Array(Link)) #

An array of Link instances that allow track information to be extended without extra XML namespaces. If this is empty, then no <link> element is emitted for the <track> element.


[View source]
def locations : Array(URI) #

An ordered list of URIs that point to the actual data for this track, if any. This technically does not have to be a link to an audio resource.


[View source]
def locations=(locations : Array(URI)) #

An ordered list of URIs that point to the actual data for this track, if any. This technically does not have to be a link to an audio resource.


[View source]
def meta : Array(Meta) #

An array of Meta instances that specify metadata for a track. If this is empty, then no <meta> element is emitted for the <track> element.


[View source]
def meta=(meta : Array(Meta)) #

An array of Meta instances that specify metadata for a track. If this is empty, then no <meta> element is emitted for the <track> element.


[View source]
def title : String | Nil #

The human-readable name title of this track, if any. If this is nil, then no <title> element is emitted for the <track> element.


[View source]
def title=(title : String | Nil) #

The human-readable name title of this track, if any. If this is nil, then no <title> element is emitted for the <track> element.


[View source]
def trackNumber : UInt64 | Nil #

The ordinal position of this track within the #album, if any. If this is nil, then no <trackNum> element is emitted for the <track> element.


[View source]
def trackNumber=(trackNumber : UInt64 | Nil) #

The ordinal position of this track within the #album, if any. If this is nil, then no <trackNum> element is emitted for the <track> element.


[View source]
def write(xml : XML::Builder) : Nil #

Writes this instance to an XML::Builder for serialization.


[View source]