feat: UI work to facilitate future improvements in midi-into-track-input

This commit is contained in:
qm210
2024-11-22 13:48:25 +01:00
parent 4169356845
commit ad690c7697
12 changed files with 191 additions and 40 deletions

View File

@ -101,9 +101,7 @@ func NewTracker(model *tracker.Model) *Tracker {
func (t *Tracker) Main() {
titleFooter := ""
w := new(app.Window)
w.Option(app.Title("Sointu Tracker"))
w.Option(app.Size(unit.Dp(800), unit.Dp(600)))
w := NewWindow()
t.InstrumentEditor.Focus()
recoveryTicker := time.NewTicker(time.Second * 30)
t.Explorer = explorer.NewExplorer(w)
@ -127,9 +125,7 @@ func (t *Tracker) Main() {
}
if !t.Quitted() {
// TODO: uh oh, there's no way of canceling the destroyevent in gioui? so we create a new window just to show the dialog
w = new(app.Window)
w.Option(app.Title("Sointu Tracker"))
w.Option(app.Size(unit.Dp(800), unit.Dp(600)))
w = NewWindow()
t.Explorer = explorer.NewExplorer(w)
go eventLoop(w, events, acks)
}
@ -165,6 +161,16 @@ func (t *Tracker) Main() {
t.quitWG.Done()
}
func NewWindow() *app.Window {
w := new(app.Window)
w.Option(app.Title("Sointu Tracker"))
w.Option(
app.Size(unit.Dp(800), unit.Dp(600)),
app.Fullscreen.Option(),
)
return w
}
func eventLoop(w *app.Window, events chan<- event.Event, acks <-chan struct{}) {
// Iterate window events, sending each to the old event loop and waiting for
// a signal that processing is complete before iterating again.