Checkpoint
This commit is contained in:
138 files changed
+1898
-57607
No files matched your search
+10
-8
@@ -8,15 +8,16 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.maze.io/go/bragi/config"
|
||||
"git.maze.io/go/bragi/player"
|
||||
"git.maze.io/go/bragi/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"go.maze.io/harmon/config"
|
||||
"go.maze.io/harmon/internal/util"
|
||||
"go.maze.io/harmon/player"
|
||||
)
|
||||
|
||||
func init() {
|
||||
player.Register("mpd", func(config *config.Player) (player.Player, error) {
|
||||
return New(config.Host, config.Password, config.Name)
|
||||
player.Register("mpd", func(config config.Player) (player.Player, error) {
|
||||
return New(config.Host, config.Password)
|
||||
}, Detect, 10)
|
||||
}
|
||||
|
||||
@@ -87,13 +88,12 @@ func ParseVersion(s string) (Version, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func New(addr, password, name string) (*Player, error) {
|
||||
func New(addr, password string) (*Player, error) {
|
||||
addr = util.MakeAddr(addr, DefaultAddr)
|
||||
if _, err := net.ResolveTCPAddr("tcp", addr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p := &Player{
|
||||
name: name,
|
||||
addr: addr,
|
||||
commands: make(chan *Command, 16),
|
||||
errors: make(chan error, 1),
|
||||
@@ -160,7 +160,9 @@ func newConn(addr, password, kind, name string) (*clientConn, *Version, error) {
|
||||
return &clientConn{conn, kind}, &version, nil
|
||||
}
|
||||
|
||||
func (p *Player) Close() error {
|
||||
func (Player) Type() string { return "mpd" }
|
||||
|
||||
func (p *Player) Halt() error {
|
||||
for i := 0; i < 2; i++ {
|
||||
select {
|
||||
case p.quit <- struct{}{}:
|
||||
|
||||
Reference in new issue
Block a user