fix(piano-roll): loop only on btn + instant stop

- Sub-tab selection loop only active when st.isLooping is true
- End-of-playback loop uses st.isLooping, not global isLoopingSelection
- SonicSF.stopAll() sets gain 0 and stops oscillators immediately
This commit is contained in:
2026-07-26 12:16:01 +07:00
parent 653c0747cb
commit b0d7f35a1e
4 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -9529,7 +9529,7 @@ const App = () => {
const bufferPos = startBufferOffsetRef.current + elapsed * speedFactor;
// Loop sub-tab selection (bufferPos is buffer-time)
if (st.selectionStart !== null && st.selectionEnd !== null && st.selectionStart !== st.selectionEnd && (st.isLooping || isLoopingSelection)) {
if (st.selectionStart !== null && st.selectionEnd !== null && st.selectionStart !== st.selectionEnd && st.isLooping) {
const start = Math.min(st.selectionStart, st.selectionEnd);
const end = Math.max(st.selectionStart, st.selectionEnd);
if (bufferPos >= end) {
@@ -9559,7 +9559,7 @@ const App = () => {
})() : st.buffer.duration;
if (bufferPos >= effectiveDuration) {
stopAllPlayback();
if (isLoopingSelection) {
if (st.isLooping) {
setSubTabs(prev => prev.map(s => s.id === activeTabRef.current ? {
...s,
currentTime: 0,