feat(tracker): do not wrap around when playing or moving cursor

The wrapping was usually unwanted behaviour. The user can use the
looping (Ctrl-L) to loop the song forever if this is really desired.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-09-07 18:52:52 +03:00
parent 5e65410d27
commit 877556b428
4 changed files with 19 additions and 5 deletions

View File

@ -220,8 +220,8 @@ func (m *Model) change(kind string, t ChangeType, severity ChangeSeverity) func(
m.d.ChangedSinceRecovery = true
if m.changeType&ScoreChange != 0 {
m.updatePatternUseCount()
m.d.Cursor.SongPos = m.d.Song.Score.Wrap(m.d.Cursor.SongPos)
m.d.Cursor2.SongPos = m.d.Song.Score.Wrap(m.d.Cursor2.SongPos)
m.d.Cursor.SongPos = m.d.Song.Score.Clamp(m.d.Cursor.SongPos)
m.d.Cursor2.SongPos = m.d.Song.Score.Clamp(m.d.Cursor2.SongPos)
m.send(m.d.Song.Score.Copy())
}
if m.changeType&PatchChange != 0 {
@ -353,6 +353,8 @@ func (m *Model) ProcessPlayerMessage(msg PlayerMsg) {
m.instrEnlarged = false
case Alert:
m.Alerts().AddAlert(e)
case IsPlayingMsg:
m.playing = e.bool
default:
}
}