mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-25 18:00:37 -04:00
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.
34 lines
525 B
Go
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()
|
|
}
|