Checkpoint
This commit is contained in:
160 files changed
+76293
-387
No files matched your search
@@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
configFileBase = "harmon.conf"
|
||||
configFileBaseAlt = "harmon.cfg"
|
||||
configFileBase = "beatglow.conf"
|
||||
configFileBaseAlt = "beatglow.cfg"
|
||||
)
|
||||
|
||||
func findConfigFile() string {
|
||||
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
var installCommand = &cli.Command{
|
||||
Name: "install",
|
||||
Usage: "Install BeatGlow for your local player",
|
||||
Action: installFunc,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{Name: "player", Usage: "Player type", Value: "auto"},
|
||||
},
|
||||
}
|
||||
|
||||
func installFunc(ctx context.Context, cmd *cli.Command) error {
|
||||
return nil
|
||||
}
|
||||
@@ -9,17 +9,16 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli/v3"
|
||||
|
||||
"go.maze.io/harmon"
|
||||
"go.maze.io/harmon/config"
|
||||
harmon "github.com/BeatGlow/beatglow"
|
||||
"github.com/BeatGlow/beatglow/config"
|
||||
|
||||
_ "go.maze.io/harmon/hardware/display/all" // Display drivers
|
||||
_ "go.maze.io/harmon/player/all" // Player drivers
|
||||
_ "github.com/BeatGlow/beatglow/player/all" // Player drivers
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := &cli.Command{
|
||||
Name: "harmon",
|
||||
Usage: "Harmon is a playful music player frontend",
|
||||
Name: "beatglow",
|
||||
Usage: "BeatGlow is a playful music player frontend",
|
||||
Action: runFunc,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{Name: "config", Usage: "configuration file path"},
|
||||
@@ -28,6 +27,7 @@ func main() {
|
||||
},
|
||||
Commands: []*cli.Command{
|
||||
scanCommand,
|
||||
installCommand,
|
||||
},
|
||||
}
|
||||
|
||||
File renamed without changes.
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user