lib

package
v0.0.0-...-6a390e4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_SLEEP_TIME     = 15 * time.Second
	MIN_SLEEP_TIME     = 5 * time.Second
	DEEP_SLEEP_TIME    = 1 * time.Minute
	DEEP_SLEEP_COUNTER = 20 // 5 minutes
)

Variables

View Source
var (
	LogFilter *logutils.LevelFilter
)

Functions

func Authenticate

func Authenticate()

func FiltersEnabled

func FiltersEnabled() bool

func GetAuthURL

func GetAuthURL() string

func GetFilter

func GetFilter(w http.ResponseWriter, req *http.Request)

func HandleUpdate

func HandleUpdate(w http.ResponseWriter, req *http.Request)

func InitializeSonos

func InitializeSonos()

func LoadConfig

func LoadConfig(file string)

func Monitor

func Monitor()

func ParentalControlsEnabled

func ParentalControlsEnabled() bool

func Rules

func Rules(track *spotify.FullTrack, device string) bool

func Server

func Server()

func SetParentalControls

func SetParentalControls(b bool)

func SetupEvents

func SetupEvents(mgr ssdp.Manager)

func StartMonitor

func StartMonitor()

func StartServer

func StartServer()

func ToggleFilter

func ToggleFilter(w http.ResponseWriter, req *http.Request)

Types

type Config

type Config struct {
	Ignored         []string          `json:"ignored"`
	ClientId        string            `json:"client_id"`
	ClientSecret    string            `json:"client_secret"`
	RedirectURI     string            `json:"redirect_uri"`
	AuthTokenURI    string            `json:"auth_token_uri"`
	CertificateFile string            `json:"cert"`
	KeyFile         string            `json:"key"`
	Port            string            `json:"port"`
	LogLevel        logutils.LogLevel `json:"log_level"`
}

type Equalizer

type Equalizer struct {
	Bass              int  `json:"bass"`
	Treble            int  `json:"treble"`
	SpeechEnhancement bool `json:"speechEnhancement"`
	NightMode         bool `json:"nightMode"`
	Loudness          bool `json:"loudness"`
}

type GroupState

type GroupState struct {
	Volume int  `json:"volume"`
	Mute   bool `json:"mute"`
}

type MuteChange

type MuteChange struct {
	Uuid         string `json:"uuid"`
	PreviousMute int    `json:"previousMute"`
	NewMute      int    `json:"newMute"`
	RoomName     string `json:"roomName"`
}

type PlayMode

type PlayMode struct {
	Repeat    string `json:"repeat"`
	Shuffle   bool   `json:"shuffle"`
	CrossFade bool   `json:"crossfade"`
}

type Player

type Player struct {
	Uuid                   string     `json:"uuid"`
	Coordinator            string     `json:"coordinator"`
	RoomName               string     `json:"roomName"`
	State                  State      `json:"state"`
	GroupState             GroupState `json:"groupState"`
	AvTransportUri         string     `json:"avTransportUri"`
	AvTransportUriMetadata string     `json:"avTransportUriMetadata"`
}

type Rule

type Rule struct {
	Explicit bool
}

type State

type State struct {
	CurrentTrack         Track     `json:"currentTrack"`
	NextTrack            Track     `json:"nextTrack"`
	PlayMode             PlayMode  `json:"playMode"`
	PlaylistName         string    `json:"playlistName"`
	RelTime              int       `json:"relTime"`
	StateTime            int       `json:"stateTime"`
	Volume               int       `json:"volume"`
	Mute                 bool      `json:"mute"`
	TrackNo              int       `json:"trackNo"`
	PlaybackState        string    `json:"playbackState"`
	Equalizer            Equalizer `json:"equalizer"`
	ElapsedTime          int       `json:"elapsedTime"`
	ElapsedTimeFormatted string    `json:"elapsedTimeFormatted"`
}

type Track

type Track struct {
	Artist              string `json:"artist"`
	Title               string `json:"title"`
	Album               string `json:"album"`
	AlbumArtUri         string `json:"albumArtUri"`
	Duration            int    `json:"duration"`
	Uri                 string `json:"uri"`
	Type                string `json:"type"`
	StationName         string `json:"stationName"`
	AbsoluteAlbumArtUri string `json:"absoluteAlbumArtUri"`
}

type TransportState

type TransportState struct {
	Player Player `json:"data"`
}

type Update

type Update struct {
	Type string `json:"type"`
}

type VolumeChange

type VolumeChange struct {
	Uuid           string `json:"uuid"`
	PreviousVolume int    `json:"previousVolume"`
	NewVolume      int    `json:"newVolume"`
	RoomName       string `json:"roomName"`
}

Jump to

Keyboard shortcuts

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