refactor(tracker): rename Notetracking to Follow

Notetracking was used in two completely different meanings: the
pitch/bpm notetracking in the delay unit and the cursor follow in
when playing. The word for the second meaning was changed to Follow,
to avoid confusion.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-12 21:35:45 +03:00
parent 59c04ed4a1
commit 4c096a3fac
8 changed files with 34 additions and 34 deletions

View File

@ -148,28 +148,28 @@ func (t *Tracker) KeyEvent(e key.Event, gtx C) {
case "RemoveUnused":
t.RemoveUnused().Do()
case "PlayCurrentPosFollow":
t.NoteTracking().Bool().Set(true)
t.Follow().Bool().Set(true)
t.PlayCurrentPos().Do()
case "PlayCurrentPosUnfollow":
t.NoteTracking().Bool().Set(false)
t.Follow().Bool().Set(false)
t.PlayCurrentPos().Do()
case "PlaySongStartFollow":
t.NoteTracking().Bool().Set(true)
t.Follow().Bool().Set(true)
t.PlaySongStart().Do()
case "PlaySongStartUnfollow":
t.NoteTracking().Bool().Set(false)
t.Follow().Bool().Set(false)
t.PlaySongStart().Do()
case "PlaySelectedFollow":
t.NoteTracking().Bool().Set(true)
t.Follow().Bool().Set(true)
t.PlaySelected().Do()
case "PlaySelectedUnfollow":
t.NoteTracking().Bool().Set(false)
t.Follow().Bool().Set(false)
t.PlaySelected().Do()
case "PlayLoopFollow":
t.NoteTracking().Bool().Set(true)
t.Follow().Bool().Set(true)
t.PlayFromLoopStart().Do()
case "PlayLoopUnfollow":
t.NoteTracking().Bool().Set(false)
t.Follow().Bool().Set(false)
t.PlayFromLoopStart().Do()
case "StopPlaying":
t.StopPlaying().Do()
@ -205,17 +205,17 @@ func (t *Tracker) KeyEvent(e key.Event, gtx C) {
case "RecordingToggle":
t.IsRecording().Bool().Toggle()
case "PlayingToggleFollow":
t.NoteTracking().Bool().Set(true)
t.Follow().Bool().Set(true)
t.Playing().Bool().Toggle()
case "PlayingToggleUnfollow":
t.NoteTracking().Bool().Set(false)
t.Follow().Bool().Set(false)
t.Playing().Bool().Toggle()
case "InstrEnlargedToggle":
t.InstrEnlarged().Bool().Toggle()
case "CommentExpandedToggle":
t.CommentExpanded().Bool().Toggle()
case "FollowToggle":
t.NoteTracking().Bool().Toggle()
t.Follow().Bool().Toggle()
case "UnitDisabledToggle":
t.UnitDisabled().Bool().Toggle()
case "LoopToggle":

View File

@ -22,12 +22,12 @@ type SongPanel struct {
Step *NumberInput
SongLength *NumberInput
RewindBtn *ActionClickable
PlayingBtn *BoolClickable
RecordBtn *BoolClickable
NoteTracking *BoolClickable
PanicBtn *BoolClickable
LoopBtn *BoolClickable
RewindBtn *ActionClickable
PlayingBtn *BoolClickable
RecordBtn *BoolClickable
FollowBtn *BoolClickable
PanicBtn *BoolClickable
LoopBtn *BoolClickable
// File menu items
fileMenuItems []MenuItem
@ -62,7 +62,7 @@ func NewSongPanel(model *tracker.Model) *SongPanel {
PanicBtn: NewBoolClickable(model.Panic().Bool()),
LoopBtn: NewBoolClickable(model.LoopToggle().Bool()),
RecordBtn: NewBoolClickable(model.IsRecording().Bool()),
NoteTracking: NewBoolClickable(model.NoteTracking().Bool()),
FollowBtn: NewBoolClickable(model.Follow().Bool()),
PlayingBtn: NewBoolClickable(model.Playing().Bool()),
RewindBtn: NewActionClickable(model.PlaySongStart()),
}
@ -124,7 +124,7 @@ func (t *SongPanel) layoutSongOptions(gtx C, tr *Tracker) D {
rewindBtnStyle := ActionIcon(gtx, tr.Theme, t.RewindBtn, icons.AVFastRewind, t.rewindHint)
playBtnStyle := ToggleIcon(gtx, tr.Theme, t.PlayingBtn, icons.AVPlayArrow, icons.AVStop, t.playHint, t.stopHint)
recordBtnStyle := ToggleIcon(gtx, tr.Theme, t.RecordBtn, icons.AVFiberManualRecord, icons.AVFiberSmartRecord, t.recordHint, t.stopRecordHint)
noteTrackBtnStyle := ToggleIcon(gtx, tr.Theme, t.NoteTracking, icons.ActionSpeakerNotesOff, icons.ActionSpeakerNotes, t.followOffHint, t.followOnHint)
noteTrackBtnStyle := ToggleIcon(gtx, tr.Theme, t.FollowBtn, icons.ActionSpeakerNotesOff, icons.ActionSpeakerNotes, t.followOffHint, t.followOnHint)
loopBtnStyle := ToggleIcon(gtx, tr.Theme, t.LoopBtn, icons.NavigationArrowForward, icons.AVLoop, t.loopOffHint, t.loopOnHint)
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,

View File

@ -142,7 +142,7 @@ func (t *Tracker) Main() {
}
}
gtx := app.NewContext(&ops, e)
if t.SongPanel.PlayingBtn.Bool.Value() && t.SongPanel.NoteTracking.Bool.Value() {
if t.SongPanel.PlayingBtn.Bool.Value() && t.SongPanel.FollowBtn.Bool.Value() {
t.TrackEditor.scrollTable.RowTitleList.CenterOn(t.PlaySongRow())
}
t.Layout(gtx, w)