Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:29:41 +01:00
1 parent 85a9ec684c
commit c5d6137fab
160 files changed
+76293 -387

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package main
import (
"periph.io/x/host/v3"
"github.com/BeatGlow/BeatGlow/config"
"github.com/BeatGlow/BeatGlow/hardware"
"github.com/BeatGlow/BeatGlow/ui"
)
func main() {
if _, err := host.Init(); err != nil {
panic(err)
}
output, err := hardware.Display(&config.DisplayConfig{
Mode: "SPI",
Type: "SSD1322",
Reset: "GPIO25",
DC: "GPIO24",
})
if err != nil {
panic(err)
}
if err = ui.Boot(output); err != nil {
panic(err)
}
}
+43
View File
@@ -0,0 +1,43 @@
package main
import (
"fmt"
"github.com/BeatGlow/beatglow/player"
"github.com/BeatGlow/beatglow/player/mpd"
"github.com/sirupsen/logrus"
)
func main() {
logrus.SetLevel(logrus.TraceLevel)
p, err := mpd.New("localhost:6600", "")
if err != nil {
panic(err)
}
defer p.Halt()
events, err := p.Events()
if err != nil {
panic(err)
}
for event := range events {
fmt.Println("event: ", event)
switch event.(type) {
case player.ConnectedEvent:
fmt.Println("connected, requesting playlist...")
tracks, err := p.Playlist()
if err != nil {
panic(err)
}
fmt.Printf("%d tracks:\n", len(tracks))
for _, track := range tracks {
fmt.Println(" ", track.ID, track)
}
return
}
}
}