mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-21 15:43:30 -05:00
refactor(tracker): group Model methods, with each group in one source file
This commit is contained in:
parent
b93304adab
commit
86ca3fb300
@ -8,7 +8,6 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"time"
|
||||
|
||||
"gioui.org/app"
|
||||
"github.com/vsariola/sointu"
|
||||
@ -60,15 +59,11 @@ func main() {
|
||||
}
|
||||
model := tracker.NewModel(broker, cmd.Synthers, midiContext, recoveryFile)
|
||||
player := tracker.NewPlayer(broker, cmd.Synthers[0])
|
||||
detector := tracker.NewDetector(broker)
|
||||
specan := tracker.NewSpecAnalyzer(broker)
|
||||
go detector.Run()
|
||||
go specan.Run()
|
||||
|
||||
if a := flag.Args(); len(a) > 0 {
|
||||
f, err := os.Open(a[0])
|
||||
if err == nil {
|
||||
model.ReadSong(f)
|
||||
model.Song().Read(f)
|
||||
}
|
||||
f.Close()
|
||||
}
|
||||
@ -82,10 +77,7 @@ func main() {
|
||||
go func() {
|
||||
trackerUi.Main()
|
||||
audioCloser.Close()
|
||||
tracker.TrySend(broker.CloseDetector, struct{}{})
|
||||
tracker.TrySend(broker.CloseSpecAn, struct{}{})
|
||||
tracker.TimeoutReceive(broker.FinishedDetector, 3*time.Second)
|
||||
tracker.TimeoutReceive(broker.FinishedSpecAn, 3*time.Second)
|
||||
model.Close()
|
||||
if *cpuprofile != "" {
|
||||
pprof.StopCPUProfile()
|
||||
f.Close()
|
||||
|
||||
Reference in New Issue
Block a user