Documentation
¶
Overview ¶
Package control lets another process on the same machine read and drive a running dotamp: one JSON request per connection on a localhost port, with a token published in control.json beside the config.
Index ¶
Constants ¶
const Usage = "" /* 218-byte string literal not displayed */
Variables ¶
var ErrNotRunning = errors.New("dotamp is not running")
Functions ¶
func PlaylistID ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes one call at a time to the player named by control.json.
type Player ¶
type Player interface {
Status() Status
Queue() []library.Track
QueueNames() []string // requester per queue row, "" for the DJ's own
Lanes() []audio.Lane
Search(ctx context.Context, q string) (library.SearchResult, []library.Playlist, error)
AlbumTracks(ctx context.Context, id string) ([]library.Track, error)
PlaylistTracks(ctx context.Context, id string) ([]library.Track, error)
Play(ctx context.Context, ts []library.Track) error
Add(ts []library.Track)
Request(ctx context.Context, name string, ts []library.Track) (pending int, err error)
Remove(ctx context.Context, i int) error
Clear() int
Next(ctx context.Context) error
Prev(ctx context.Context) error
TogglePause()
Playlists(ctx context.Context) ([]library.Playlist, error)
CreatePlaylist(ctx context.Context, name string, ts []library.Track) ([]library.Saved, error)
AddToPlaylist(ctx context.Context, id string, ts []library.Track) error
Notify(msg string)
}
Player is what the server drives; cmd/dotamp supplies it over the controller, engine and library.
type PlaylistInfo ¶
type Request ¶
type Request struct {
Token string `json:"token"`
Op string `json:"op"`
Q string `json:"q,omitempty"`
ID string `json:"id,omitempty"`
IDs []string `json:"ids,omitempty"`
As string `json:"as,omitempty"`
Name string `json:"name,omitempty"`
Index *int `json:"index,omitempty"`
}
Request is one call. Ids are typed: t:, a: or p: followed by the library's qualified id, as every listing returns them.
type SearchInfo ¶
type SearchInfo struct {
Tracks []TrackInfo `json:"tracks"`
Albums []AlbumInfo `json:"albums"`
Playlists []PlaylistInfo `json:"playlists"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server answers control requests for one running player.