mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-14 02:54:37 -04:00
feat(tracker): hide playing row indicator when not playing
This commit is contained in:
@ -23,6 +23,11 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
|||||||
t.playRowPatMutex.RLock()
|
t.playRowPatMutex.RLock()
|
||||||
defer t.playRowPatMutex.RUnlock()
|
defer t.playRowPatMutex.RUnlock()
|
||||||
|
|
||||||
|
playPat := t.PlayPattern
|
||||||
|
if !t.Playing {
|
||||||
|
playPat = -1
|
||||||
|
}
|
||||||
|
|
||||||
for i, trk := range t.song.Tracks {
|
for i, trk := range t.song.Tracks {
|
||||||
flexTracks[i] = layout.Rigid(Lowered(t.layoutTrack(
|
flexTracks[i] = layout.Rigid(Lowered(t.layoutTrack(
|
||||||
trk.Patterns,
|
trk.Patterns,
|
||||||
@ -32,7 +37,7 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
|||||||
t.DisplayPattern,
|
t.DisplayPattern,
|
||||||
t.CursorColumn,
|
t.CursorColumn,
|
||||||
t.PlayRow,
|
t.PlayRow,
|
||||||
t.PlayPattern,
|
playPat,
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||||
@ -43,13 +48,19 @@ func (t *Tracker) layoutTracker(gtx layout.Context) layout.Dimensions {
|
|||||||
func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
||||||
gtx.Constraints.Min.Y = 200
|
gtx.Constraints.Min.Y = 200
|
||||||
gtx.Constraints.Max.Y = 200
|
gtx.Constraints.Max.Y = 200
|
||||||
|
|
||||||
|
playPat := t.PlayPattern
|
||||||
|
if !t.Playing {
|
||||||
|
playPat = -1
|
||||||
|
}
|
||||||
|
|
||||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||||
layout.Rigid(Raised(t.layoutPatterns(
|
layout.Rigid(Raised(t.layoutPatterns(
|
||||||
t.song.Tracks,
|
t.song.Tracks,
|
||||||
t.ActiveTrack,
|
t.ActiveTrack,
|
||||||
t.DisplayPattern,
|
t.DisplayPattern,
|
||||||
t.CursorColumn,
|
t.CursorColumn,
|
||||||
t.PlayPattern,
|
playPat,
|
||||||
))),
|
))),
|
||||||
layout.Rigid(t.darkLine(false)),
|
layout.Rigid(t.darkLine(false)),
|
||||||
layout.Flexed(1, Raised(Label(fmt.Sprintf("Current octave: %v", t.CurrentOctave), white))),
|
layout.Flexed(1, Raised(Label(fmt.Sprintf("Current octave: %v", t.CurrentOctave), white))),
|
||||||
|
@ -62,6 +62,8 @@ func (t *Tracker) TogglePlay() {
|
|||||||
t.Playing = !t.Playing
|
t.Playing = !t.Playing
|
||||||
if t.Playing {
|
if t.Playing {
|
||||||
t.NoteTracking = true
|
t.NoteTracking = true
|
||||||
|
t.PlayPattern = t.DisplayPattern
|
||||||
|
t.PlayRow = t.CursorRow - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user