lib

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSonos = struct{ ErrUnexpectedResponse, ErrInvalidIPAdress, ErrNoZonePlayerFound, ErrInvalidEndpoint, ErrTagNotFound, ErrInvalidContentType, ErrInvalidPlayMode error }{
		ErrUnexpectedResponse: errors.New("unexpected response"),
		ErrInvalidIPAdress:    errors.New("unable to discover zone player"),
		ErrNoZonePlayerFound:  errors.New("unable to find zone player"),
		ErrTagNotFound:        errors.New("tag not found in response"),
		ErrInvalidEndpoint:    errors.New("invalid endpoint"),
		ErrInvalidPlayMode:    errors.New("invalid play mode"),
	}
	ContentTypes = struct{ MusicLibrarys, Artist, AlbumArtist, Album, Genre, Composer, Tracks, Playlists, Share, SonosPlaylists, SonosFavorites, Radios, RadioStations, RadioShows, Queues, QueueMain, QueueSecond string }{
		MusicLibrarys:  "A:",
		Artist:         "A:ARTIST",
		AlbumArtist:    "A:ALBUMARTIST",
		Album:          "A:ALBUM",
		Genre:          "A:GENRE",
		Composer:       "A:COMPOSER",
		Tracks:         "A:TRACKS",
		Playlists:      "A:PLAYLISTS",
		Share:          "S:",
		SonosPlaylists: "SQ:",
		SonosFavorites: "FV:2",
		Radios:         "R:0",
		RadioStations:  "R:0/0",
		RadioShows:     "R:0/1",
		Queues:         "Q:",
		QueueMain:      "Q:0",
		QueueSecond:    "Q:1",
	}
	SeekModes = struct{ Track, Relative, Delta string }{
		Track:    "TRACK_NR",
		Relative: "REL_TIME",
		Delta:    "TIME_DELTA",
	}
	TransportStates = struct{ Stopped, Playing, PausedPlayback, Transitioning string }{
		Stopped:        "STOPPED",
		Playing:        "PLAYING",
		PausedPlayback: "PAUSED_PLAYBACK",
		Transitioning:  "TRANSITIONING",
	}
	PlayModes = struct{ Normal, RepeatAll, RepeatOne, ShuffleNorepeat, Shuffle, ShuffleRepeaOne string }{
		Normal:          "NORMAL",
		RepeatAll:       "REPEAT_ALL",
		RepeatOne:       "REPEAT_ONE",
		ShuffleNorepeat: "SHUFFLE_NOREPEAT",
		Shuffle:         "SHUFFLE",
		ShuffleRepeaOne: "SHUFFLE_REPEAT_ONE",
	}
	PlayModeMap = map[string][3]bool{

		PlayModes.Normal:          {false, false, false},
		PlayModes.RepeatAll:       {false, true, false},
		PlayModes.RepeatOne:       {false, false, true},
		PlayModes.ShuffleNorepeat: {true, false, false},
		PlayModes.Shuffle:         {true, true, false},
		PlayModes.ShuffleRepeaOne: {true, false, true},
	}
	PlayModeMapReversed = func() map[[3]bool]string {
		m := map[[3]bool]string{}
		for k, v := range PlayModeMap {
			m[v] = k
		}
		return m
	}()
	RecurrenceModes = struct{ Once, Weekdays, Weekends, Daily string }{
		Once:     "ONCE",
		Weekdays: "WEEKDAYS",
		Weekends: "WEEKENDS",
		Daily:    "DAILY",
	}
	AlbumArtistDisplayOptionModes = struct{ WMP, ITunes, None string }{
		WMP:    "WMP",
		ITunes: "ITUNES",
		None:   "NONE",
	}
	UpdateTypes = struct{ All, Software string }{
		All:      "All ",
		Software: "Software",
	}
)

Functions

func BoolTo10

func BoolTo10(b bool) string

func BoolToOnOff

func BoolToOnOff(b bool) string

func ExtractTag

func ExtractTag(data, tag string) (string, error)

func UnmarshalMetaData

func UnmarshalMetaData[T any](data string, v T) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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