From 28a734886367992c877983e989fbe63cdf88051b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 6 Feb 2022 16:29:30 -0500 Subject: [PATCH] add failsafe --- src/engine/engine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index c77183958..27bf2ad36 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -4830,6 +4830,9 @@ int DivEngine::calcFreq(int base, int pitch, bool period, int octave) { void DivEngine::play() { isBusy.lock(); + sPreview.sample=-1; + sPreview.wave=-1; + sPreview.pos=0; if (stepPlay==0) { freelance=false; playSub(false); @@ -4841,6 +4844,9 @@ void DivEngine::play() { void DivEngine::playToRow(int row) { isBusy.lock(); + sPreview.sample=-1; + sPreview.wave=-1; + sPreview.pos=0; freelance=false; playSub(false,row); isBusy.unlock(); @@ -4864,6 +4870,9 @@ void DivEngine::stop() { extValuePresent=false; stepPlay=0; remainingLoops=-1; + sPreview.sample=-1; + sPreview.wave=-1; + sPreview.pos=0; isBusy.unlock(); }