This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-07-05 18:54:51 +03:00
parent 3c6c24c6af
commit 53af773815
12 changed files with 336 additions and 600 deletions

View File

@ -190,7 +190,7 @@ func NewModel(broker *Broker, synther sointu.Synther, midiContext MIDIContext, r
}
TrySend(broker.ToPlayer, any(m.d.Song.Copy())) // we should be non-blocking in the constructor
m.signalAnalyzer = NewScopeModel(broker, m.d.Song.BPM)
m.initDerivedData()
m.updateDeriveData(SongChange)
return m
}
@ -224,7 +224,6 @@ func (m *Model) change(kind string, t ChangeType, severity ChangeSeverity) func(
if m.changeType&ScoreChange != 0 {
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.updateDerivedScoreData()
TrySend(m.broker.ToPlayer, any(m.d.Song.Score.Copy()))
}
if m.changeType&PatchChange != 0 {
@ -241,7 +240,6 @@ func (m *Model) change(kind string, t ChangeType, severity ChangeSeverity) func(
m.d.UnitSearching = false // if we change anything in the patch, reset the unit searching
m.d.UnitSearchString = ""
m.d.SendSource = 0
m.updateDerivedPatchData()
TrySend(m.broker.ToPlayer, any(m.d.Song.Patch.Copy()))
}
if m.changeType&BPMChange != 0 {
@ -251,6 +249,7 @@ func (m *Model) change(kind string, t ChangeType, severity ChangeSeverity) func(
if m.changeType&RowsPerBeatChange != 0 {
TrySend(m.broker.ToPlayer, any(RowsPerBeatMsg{m.d.Song.RowsPerBeat}))
}
m.updateDeriveData(m.changeType)
m.undoSkipCounter++
var limit int
switch m.changeSeverity {
@ -331,7 +330,7 @@ func (m *Model) UnmarshalRecovery(bytes []byte) {
}
m.d.ChangedSinceRecovery = false
TrySend(m.broker.ToPlayer, any(m.d.Song.Copy()))
m.initDerivedData()
m.updateDeriveData(SongChange)
}
func (m *Model) ProcessMsg(msg MsgToModel) {