Documentation ¶
Index ¶
- Constants
- type Audio
- type AudioConfig
- type Awaiter
- func (a *Awaiter) Close() *StateUpdate
- func (a *Awaiter) Closed() bool
- func (a *Awaiter) GetChannel() chan *StateUpdate
- func (a *Awaiter) GetDeltaCount() int
- func (a *Awaiter) GetDeltas() []*JookiState
- func (a *Awaiter) GetInitialState() *JookiState
- func (a *Awaiter) GetState() *JookiState
- func (a *Awaiter) Read(timer *time.Timer) (*StateUpdate, bool)
- func (a *Awaiter) WaitFor(f func(state *JookiState) bool, timeout time.Duration) (*JookiState, error)
- func (a *Awaiter) Write(update *StateUpdate) error
- type Client
- func (c *Client) AddAwaiter() (*Awaiter, error)
- func (c *Client) AddTrackToPlaylist(playlistId, trackId string) (*Playlist, error)
- func (c *Client) Await(timeout time.Duration) (*StateUpdate, error)
- func (c *Client) Closed() bool
- func (c *Client) CreatePlaylist(title string) (*Playlist, error)
- func (c *Client) DeletePlaylist(id string) error
- func (c *Client) Disconnect()
- func (c *Client) Error() error
- func (c *Client) GetState() *JookiState
- func (c *Client) IP() string
- func (c *Client) Pause() (*Audio, error)
- func (c *Client) Play() (*Audio, error)
- func (c *Client) PlayPlaylist(id string, idx int) (*Audio, error)
- func (c *Client) Reconnect() (*Client, error)
- func (c *Client) RemoveAwaiter(id int)
- func (c *Client) RenamePlaylist(id, title string) (*Playlist, error)
- func (c *Client) Seek(ms int) (*Audio, error)
- func (c *Client) SetPlayMode(mode int) (*Audio, error)
- func (c *Client) SetRepeatMode(mode RepeatMode) (*Audio, error)
- func (c *Client) SetShuffleMode(on bool) (*Audio, error)
- func (c *Client) SetVolume(vol int) (*Audio, error)
- func (c *Client) SkipNext() (*Audio, error)
- func (c *Client) SkipPrev() (*Audio, error)
- func (c *Client) UpdatePlaylist(update *PlaylistUpdate) (*Playlist, error)
- func (c *Client) UpdatePlaylistToken(id, token string) (*Playlist, error)
- func (c *Client) UpdatePlaylistTracks(id string, trackIds []string) (*Playlist, error)
- func (c *Client) UploadToPlaylist(id string, track TrackUpload, ch chan ProgressUpdate) (*Track, error)
- type ConnectPayload
- type Device
- type DiscoveryInfo
- type DiscoveryPingInfo
- type DiskUsage
- type FloatStr
- type ImageWrapper
- type IntStr
- type JookiIP
- type JookiInfo
- type JookiSettings
- type JookiState
- type Library
- type Mender
- type NowPlaying
- type Owner
- type Playback
- type Playlist
- type PlaylistAddTrack
- type PlaylistAddUpload
- type PlaylistCreate
- type PlaylistDelete
- type PlaylistPlay
- type PlaylistUpdate
- type PlaylistUpdateWrapper
- type Power
- type PowerLevel
- type ProgressBody
- type ProgressUpdate
- type QuietTime
- type RepeatMode
- type SetRepeat
- type SetSeek
- type SetShuffle
- type SetVol
- type Spotify
- type StateUpdate
- type TimeOfDay
- type Token
- type Track
- type TrackSearch
- type TrackUpload
- type WiFi
Constants ¶
View Source
const ( PlayModeShuffle = 1 PlayModeRepeat = 2 RepeatModeOff = RepeatMode(0) RepeatModeOn = RepeatMode(1) RepeatModeOnce = RepeatMode(2) )
View Source
const ( PlaybackStateStarting = "STARTING" PlaybackStateEnded = "ENDED" PlaybackStatePlaying = "PLAYING" PlaybackStatePaused = "PAUSED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct { Config *AudioConfig `json:"config"` NowPlaying *NowPlaying `json:"nowPlaying"` Playback *Playback `json:"playback"` }
func (*Audio) UnmarshalJSON ¶ added in v0.1.1
type AudioConfig ¶
type AudioConfig struct { RepeatMode RepeatMode `json:"repeat_mode"` ShuffleMode bool `json:"shuffle_mode"` Volume uint8 `json:"volume"` }
func (*AudioConfig) Clone ¶
func (a *AudioConfig) Clone() *AudioConfig
type Awaiter ¶
type Awaiter struct {
// contains filtered or unexported fields
}
func NewAwaiter ¶
func NewAwaiter(client *Client, id int, ch chan *StateUpdate) *Awaiter
func (*Awaiter) Close ¶
func (a *Awaiter) Close() *StateUpdate
func (*Awaiter) GetChannel ¶
func (a *Awaiter) GetChannel() chan *StateUpdate
func (*Awaiter) GetDeltaCount ¶
func (*Awaiter) GetDeltas ¶
func (a *Awaiter) GetDeltas() []*JookiState
func (*Awaiter) GetInitialState ¶
func (a *Awaiter) GetInitialState() *JookiState
func (*Awaiter) GetState ¶
func (a *Awaiter) GetState() *JookiState
func (*Awaiter) WaitFor ¶
func (a *Awaiter) WaitFor(f func(state *JookiState) bool, timeout time.Duration) (*JookiState, error)
func (*Awaiter) Write ¶
func (a *Awaiter) Write(update *StateUpdate) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(device *DiscoveryInfo, dpi *DiscoveryPingInfo) (*Client, error)
func (*Client) AddAwaiter ¶
func (*Client) AddTrackToPlaylist ¶
func (*Client) DeletePlaylist ¶
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
func (*Client) GetState ¶
func (c *Client) GetState() *JookiState
func (*Client) RemoveAwaiter ¶
func (*Client) RenamePlaylist ¶
func (*Client) SetRepeatMode ¶
func (c *Client) SetRepeatMode(mode RepeatMode) (*Audio, error)
func (*Client) UpdatePlaylist ¶
func (c *Client) UpdatePlaylist(update *PlaylistUpdate) (*Playlist, error)
func (*Client) UpdatePlaylistToken ¶
func (*Client) UpdatePlaylistTracks ¶
func (*Client) UploadToPlaylist ¶
func (c *Client) UploadToPlaylist(id string, track TrackUpload, ch chan ProgressUpdate) (*Track, error)
type ConnectPayload ¶
type ConnectPayload struct {
Jooki *JookiInfo `json:"jooki"`
}
type Device ¶
type Device struct { DiskUsage *DiskUsage `json:"diskUsage"` Firmware string `json:"firmware"` Flags []interface{} `json:"flags"` Hostname string `json:"hostname"` ID string `json:"id"` IP string `json:"ip"` Machine string `json:"machine"` ToySafe bool `json:"toy_safe"` Usage string `json:"usage"` WebApp string `json:"webapp"` WiFiMac string `json:"wifi_mac"` }
type DiscoveryInfo ¶
type DiscoveryPingInfo ¶
type DiscoveryPingInfo struct {
Version string `json:"version"`
}
type DiskUsage ¶
type FloatStr ¶
type FloatStr float64
func (FloatStr) MarshalJSON ¶
func (*FloatStr) UnmarshalJSON ¶
type ImageWrapper ¶
type ImageWrapper string
func (*ImageWrapper) MarshalJSON ¶
func (iw *ImageWrapper) MarshalJSON() ([]byte, error)
func (*ImageWrapper) UnmarshalJSON ¶
func (iw *ImageWrapper) UnmarshalJSON(data []byte) error
type JookiSettings ¶
type JookiSettings struct {
QuietTime *QuietTime `json:"quietTime"`
}
func (*JookiSettings) Clone ¶
func (s *JookiSettings) Clone() *JookiSettings
type JookiState ¶
type JookiState struct { Settings *JookiSettings `json:"DISABLEDsettings"` Audio *Audio `json:"audio"` Bluetooth string `json:"bt"` Library *Library `json:"db"` Deezer []interface{} `json:"deezer"` Device *Device `json:"device"` Mender *Mender `json:"mender"` NFC interface{} `json:"nfc"` Owner *Owner `json:"owner"` Power *Power `json:"power"` Spotify *Spotify `json:"spotify"` UserMessages []interface{} `json:"userMessages"` WiFi *WiFi `json:"wifi"` }
func (*JookiState) Clone ¶
func (s *JookiState) Clone() *JookiState
type Library ¶
type Library struct { Playlists map[string]*Playlist `json:"playlists"` Tokens map[string]*Token `json:"tokens"` Tracks map[string]*Track `json:"tracks"` }
func (*Library) FindTrack ¶
func (l *Library) FindTrack(tr TrackSearch) *Track
func (*Library) UnmarshalJSON ¶ added in v0.1.1
type NowPlaying ¶
type NowPlaying struct { Album *string `json:"album"` Artist *string `json:"artist"` Audiobook bool `json:"audiobook"` Duration *float64 `json:"duration_ms"` HasNext bool `json:"hasNext"` HasPrev bool `json:"hasPrev"` Image *ImageWrapper `json:"image"` PlaylistID *string `json:"playlistId"` Service *string `json:"service"` Source *string `json:"source"` Title *string `json:"track"` TrackID *string `json:"trackId"` TrackIndex *int `json:"trackIndex"` URI *string `json:"uri"` }
func (*NowPlaying) Clone ¶
func (n *NowPlaying) Clone() *NowPlaying
type Owner ¶
type Playlist ¶
type PlaylistAddTrack ¶
type PlaylistAddUpload ¶
type PlaylistCreate ¶
type PlaylistDelete ¶
type PlaylistDelete struct {
ID string `json:"playlistId"`
}
type PlaylistPlay ¶
type PlaylistUpdate ¶
type PlaylistUpdateWrapper ¶
type PlaylistUpdateWrapper struct {
Playlist *PlaylistUpdate `json:"playlist"`
}
type Power ¶
type Power struct { Charging bool `json:"charging"` Connected bool `json:"connected"` Level *PowerLevel `json:"level"` }
type PowerLevel ¶
func (*PowerLevel) Clone ¶
func (p *PowerLevel) Clone() *PowerLevel
type ProgressBody ¶
type ProgressBody struct { Progress chan float64 // contains filtered or unexported fields }
func NewProgressBody ¶
func NewProgressBody() *ProgressBody
func (*ProgressBody) Len ¶
func (pb *ProgressBody) Len() int
func (*ProgressBody) UploadProgress ¶
func (pb *ProgressBody) UploadProgress() float64
type ProgressUpdate ¶
type RepeatMode ¶
type RepeatMode uint8
func (RepeatMode) MarshalJSON ¶
func (rm RepeatMode) MarshalJSON() ([]byte, error)
func (*RepeatMode) UnmarshalJSON ¶
func (rm *RepeatMode) UnmarshalJSON(data []byte) error
type SetShuffle ¶
type SetShuffle struct {
ShuffleMode bool `json:"shuffle_mode"`
}
type StateUpdate ¶
type StateUpdate struct { Before *JookiState After *JookiState Deltas []*JookiState }
type Track ¶
type Track struct { ID *string `json:"-"` Album *string `json:"album"` Artist *string `json:"artist"` Codec *string `json:"codec"` Duration *FloatStr `json:"duration"` Location *string `json:"filename"` Format *string `json:"format"` HasImage bool `json:"hasImage"` Size *IntStr `json:"size"` Name *string `json:"title"` }
type TrackSearch ¶
type TrackUpload ¶
Click to show internal directories.
Click to hide internal directories.