didl

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerClassAlbum      = "object.container.alnum"
	ContainerClassMusicAlbum = "object.container.alnum.musicAlbum"
	ContainerClassPhotoAlbum = "object.container.alnum.photoAlbum"

	ContainerClassGenre      = "object.container.genre"
	ContainerClassMusicGenre = "object.container.genre.musicGenre"
	ContainerClassMovieGenre = "object.container.genre.movieGenre"

	ContainerClassPlaylist = "object.container.playlistContainer"

	ContainerClassPerson      = "object.container.person"
	ContainerClassMusicArtist = "object.container.person.musicArtist"

	ContainerClassStorageSystem = "object.container.storageSystem"
	ContainerClassStorageVolume = "object.container.storageVolume"
	ContainerClassStorageFolder = "object.container.storageFolder"
)
View Source
const (
	ItemClassAudio          = "object.item.audioItem"
	ItemClassMusicTrack     = "object.item.audioItem.musicTrack"
	ItemClassAudioBroadcast = "object.item.audioItem.audioBroadcast"
	ItemClassAudioBook      = "object.item.audioItem.audioBook"

	ItemClassVideo          = "object.item.videoItem"
	ItemClassMovie          = "object.item.videoItem.movie"
	ItemClassVideoBroadcast = "object.item.videoItem.videoBroadcast"
	ItemClassMusicVideoClip = "object.item.videoItem.musicVideoClip"

	ItemClassImage = "object.item.imageItem"
	ItemClassPhoto = "object.item.imageItem.photo"

	ItemClassPlaylistItem = "object.item.playlistItem"

	ItemClassText = "object.item.textItem"
)

Variables

This section is empty.

Functions

func FormatDuration added in v1.0.3

func FormatDuration(seconds float64) string

Types

type AudioItem added in v1.0.3

type AudioItem struct {
	// contains filtered or unexported fields
}

func (*AudioItem) Init added in v1.0.3

func (o *AudioItem) Init() *AudioItem

type Container

type Container interface {
	// contains filtered or unexported methods
}

type Document

type Document struct {
	XMLName       xml.Name `xml:"DIDL-Lite"`
	Namespace     string   `xml:"xmlns,attr"`
	NamespaceDc   string   `xml:"xmlns:dc,attr"`
	NamespaceUpnp string   `xml:"xmlns:upnp,attr"`
	NamespaceDlna string   `xml:"xmlns:dlna,attr"`

	// Container objects
	Container []Container `xml:"container,omitempty"`
	// Item objects
	Item []Item `xml:"item,omitempty"`
}

func (*Document) AppendContainer

func (d *Document) AppendContainer(container Container)

func (*Document) AppendItem

func (d *Document) AppendItem(item Item)

func (*Document) Init

func (d *Document) Init() *Document

type ImageItem added in v1.0.3

type ImageItem struct {
	// contains filtered or unexported fields
}

func (*ImageItem) Init added in v1.0.3

func (o *ImageItem) Init() *ImageItem

type Item

type Item interface {
	// contains filtered or unexported methods
}

type Object

type Object struct {
	// Attributes
	ID         string `xml:"id,attr"`
	ParentID   string `xml:"parentID,attr"`
	Restricted string `xml:"restricted,attr"`
	// Children
	Title   string `xml:"dc:title"`
	Class   string `xml:"upnp:class"`
	Creator string `xml:"creator,omitempty"`
}

type Res

type Res struct {
	XMLName xml.Name `xml:"res"`

	ProtocolInfo string `xml:"protocolInfo,attr"`
	// File size
	Size int64 `xml:"size,attr"`
	// Media duration
	Duration string `xml:"duration,attr,omitempty"`
	// Media bitrate
	Bitrate int `xml:"bitrate,attr,omitempty"`
	// Audio channels
	NrAudioChannels int `xml:"nrAudioChannels,attr,omitempty"`
	// Audio samplerate
	SampleFrequency int `xml:"sampleFrequency,attr,omitempty"`
	// Video resolution
	Resolution string `xml:"resolution,attr,omitempty"`

	URL string `xml:",chardata"`
}

type StorageFolderContainer

type StorageFolderContainer struct {
	StorageUsed int `xml:"upnp:storageUsed"`
	// contains filtered or unexported fields
}

Ref: 7.12 @ UPnP-av-ContentDirectory-v1-Service.pdf

func (*StorageFolderContainer) Init

type StorageVolumeContainer

type StorageVolumeContainer struct {
	StorageTotal  int64  `xml:"upnp:storageTotal"`
	StorageUsed   int64  `xml:"upnp:storageUsed"`
	StorageFree   int64  `xml:"upnp:storageFree"`
	StorageMedium string `xml:"upnp:storageMedium"`
	// contains filtered or unexported fields
}

Ref: 7.11 @ UPnP-av-ContentDirectory-v1-Service.pdf

func (*StorageVolumeContainer) Init

type VideoItem

type VideoItem struct {
	// contains filtered or unexported fields
}

func (*VideoItem) Init

func (o *VideoItem) Init() *VideoItem

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL