Skip to content

Commit c20d476

Browse files
Fix channel state retrieval on reset tempo (#373)
- Correctly reset tempo on frame change when retrieve channel state setting is used - Fixes #357. --------- Co-authored-by: Persune <[email protected]>
1 parent a59902a commit c20d476

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

Source/SoundGen.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,18 +1858,23 @@ void CSoundGen::ResetTempo()
18581858

18591859
m_iTempoAccum = 0;
18601860

1861-
if (m_pDocument->GetSongGroove(m_iPlayTrack) && m_pDocument->GetGroove(m_iSpeed) != NULL) { // // //
1862-
m_iGrooveIndex = m_iSpeed;
1863-
m_iGroovePosition = 0;
1864-
if (m_pDocument->GetGroove(m_iGrooveIndex) != NULL)
1865-
m_iSpeed = m_pDocument->GetGroove(m_iGrooveIndex)->GetEntry(m_iGroovePosition);
1866-
}
1861+
if (theApp.GetSettings()->General.bRetrieveChanState) // // //
1862+
ApplyGlobalState();
1863+
// Legacy behavior
18671864
else {
1868-
m_iGrooveIndex = -1;
1869-
if (m_pDocument->GetSongGroove(m_iPlayTrack))
1870-
m_iSpeed = DEFAULT_SPEED;
1865+
if (m_pDocument->GetSongGroove(m_iPlayTrack) && m_pDocument->GetGroove(m_iSpeed) != NULL) { // // //
1866+
m_iGrooveIndex = m_iSpeed;
1867+
m_iGroovePosition = 0;
1868+
if (m_pDocument->GetGroove(m_iGrooveIndex) != NULL)
1869+
m_iSpeed = m_pDocument->GetGroove(m_iGrooveIndex)->GetEntry(m_iGroovePosition);
1870+
}
1871+
else {
1872+
m_iGrooveIndex = -1;
1873+
if (m_pDocument->GetSongGroove(m_iPlayTrack))
1874+
m_iSpeed = DEFAULT_SPEED;
1875+
}
1876+
SetupSpeed();
18711877
}
1872-
SetupSpeed();
18731878

18741879
m_bUpdateRow = false;
18751880
}

0 commit comments

Comments
 (0)