playlist

package
v0.0.0-...-af04dbd Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IconMap map[string]string

IconMap holds our icon-paths

Functions

func GenerateThumbnails

func GenerateThumbnails(mediaDir, outDir string)

GenerateThumbnails scans the availability of thumbs for all movies and genrates missing ones

func Init

func Init(baseDir string)

Init will initialize the module state, meaning it scans for movies, icons and saved playlists and inits the IconMap and Playlists variables

func Save

func Save(baseDir string)

Save will save the module state to one or more json-config files

func SetPlaylists

func SetPlaylists(p []*Playlist)

SetPlaylists looks up items in the provided playlist slice by path and updates all secondary lists with pointers from the global movieMap, if found

func UpdateMovieSettings

func UpdateMovieSettings(movie *Movie)

UpdateMovieSettings looks up the provided movie by path and updates its settings, if found

Types

type Movie

type Movie struct {
	Path     string  `json:"path"`
	Duration float64 `json:"duration"`
	Delay    float64 `json:"delay"`
	IconPath string  `json:"icon"`
}

Movie groups information about a movie-file

type PlaybackState

type PlaybackState struct {
	Connected     bool    `json:"connected"`
	Path          string  `json:"path"`
	PlaylistIndex int     `json:"playlist_index"`
	MovieIndex    int     `json:"movie_index"`
	Position      float64 `json:"position"`
	Duration      float64 `json:"duration"`
	Volume        float64 `json:"volume"`
	Rate          float64 `json:"rate"`
	Playing       bool    `json:"playing"`
}

PlaybackState groups information for the current playback state

func NewPlaybackState

func NewPlaybackState() *PlaybackState

NewPlaybackState creates the default playbackstate

type PlaybackStateUpdater

type PlaybackStateUpdater struct {
	Done    chan bool
	Address string
	// contains filtered or unexported fields
}

PlaybackStateUpdater is used to periodically update the playback-state and push the current state to a provided channel

func NewPlaybackStateUpdater

func NewPlaybackStateUpdater(
	ip string,
	timeOut time.Duration,
	output chan<- *PlaybackState) *PlaybackStateUpdater

NewPlaybackStateUpdater creates a new instance

func (*PlaybackStateUpdater) GetState

func (updater *PlaybackStateUpdater) GetState() PlaybackState

GetState returns the current state in a threadsafe way using a mutex

func (*PlaybackStateUpdater) Playback

func (updater *PlaybackStateUpdater) Playback(movieIndex int, playlistIndex int)

Playback sets a new playlist-index and optionally a new playlist

func (*PlaybackStateUpdater) SetState

func (updater *PlaybackStateUpdater) SetState(state PlaybackState)

SetState sets the current state in a threadsafe way using a mutex

type Playlist

type Playlist struct {
	Title  string   `json:"title"`
	Movies []*Movie `json:"movies"`
}

Playlist groups information for a playlist of movies

func GetPlaylists

func GetPlaylists() []*Playlist

GetPlaylists returns a slice of Playlists

Jump to

Keyboard shortcuts

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