Add rAudio detection and MPD playback support
This commit is contained in:
6 files changed
+96
No files matched your search
@@ -0,0 +1,30 @@
|
||||
// Package raudio detects rAudio installations and controls playback through MPD.
|
||||
package raudio
|
||||
|
||||
import (
|
||||
"github.com/BeatGlow/beatglow/config"
|
||||
"github.com/BeatGlow/beatglow/player"
|
||||
"github.com/BeatGlow/beatglow/player/mpd"
|
||||
)
|
||||
|
||||
func init() {
|
||||
player.Register("raudio", func(config *config.Player) (player.Player, error) {
|
||||
return New(config)
|
||||
}, Detect, 1)
|
||||
}
|
||||
|
||||
type Player struct {
|
||||
*mpd.Player
|
||||
}
|
||||
|
||||
func New(config *config.Player) (*Player, error) {
|
||||
p, err := mpd.New(config.Host, config.Password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Player{Player: p}, nil
|
||||
}
|
||||
|
||||
func (p *Player) Name() string { return "rAudio" }
|
||||
|
||||
func (p *Player) String() string { return "rAudio@" + p.Player.String() }
|
||||
Reference in new issue
Block a user