sointu/cmd/sointu-track/main.go
Veikko Sariola 7f049acf88 feat(cli): Re-engineer CLIs, split play & compile
Play depends on bridge and compile on compiler package. Before, the compiler depended on bridge, but we could not use the compiler to build the library, as the bridge depends on the library. Also, play can now start having slightly more options e.g. wav out etc.
2020-12-18 20:25:49 +02:00

34 lines
525 B
Go

package main
import (
"fmt"
"gioui.org/app"
"gioui.org/unit"
"github.com/vsariola/sointu/audio/oto"
"github.com/vsariola/sointu/tracker"
"os"
)
func main() {
plr, err := oto.NewPlayer()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer plr.Close()
go func() {
w := app.NewWindow(
app.Size(unit.Dp(800), unit.Dp(600)),
app.Title("Sointu Tracker"),
)
t := tracker.New(plr)
defer t.Close()
if err := t.Run(w); err != nil {
fmt.Println(err)
os.Exit(1)
}
os.Exit(0)
}()
app.Main()
}