mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-25 16:34:45 -04:00
feat(tracker): hook up audio to tracker, we have liftoff
audio still a bit crackly; should probably decouple actual row ticking and rendering of audio (but how does that work with tempo ops?) sequencer goroutine is a bit weird, too, should rethink
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
||||
const trackRowHeight = 16
|
||||
const trackWidth = 100
|
||||
|
||||
func (t *Tracker) layoutTrack(notes []byte, active bool, cursorRow, cursorCol int) layout.Widget {
|
||||
func (t *Tracker) layoutTrack(notes []byte, active bool, cursorRow, cursorCol, playingRow int) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
gtx.Constraints.Min.X = trackWidth
|
||||
gtx.Constraints.Max.X = trackWidth
|
||||
@ -45,6 +45,9 @@ func (t *Tracker) layoutTrack(notes []byte, active bool, cursorRow, cursorCol in
|
||||
}
|
||||
op.Offset(f32.Pt(0, (-1*trackRowHeight)*float32(cursorRow))).Add(gtx.Ops)
|
||||
for i, c := range notes {
|
||||
if i == playingRow {
|
||||
paint.FillShape(gtx.Ops, trackerPlayColor, clip.Rect{Max: image.Pt(trackWidth, trackRowHeight)}.Op())
|
||||
}
|
||||
if i == cursorRow {
|
||||
paint.ColorOp{Color: trackerActiveTextColor}.Add(gtx.Ops)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user