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.
This commit is contained in:
Veikko Sariola
2020-12-18 14:18:00 +02:00
parent 2d00640e06
commit 7f049acf88
11 changed files with 513 additions and 365 deletions

33
cmd/sointu-track/main.go Normal file
View File

@ -0,0 +1,33 @@
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()
}