Add rAudio detection and MPD playback support

This commit is contained in:
maze committed 2026-10-29 17:30:04 +01:00
1 parent 9986c2447b
commit b82ad75ec4
6 files changed
+96

No files matched your search

+30
View File
@@ -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() }