From af0103d76e9f43b92c2ac34e237802b97f794d8a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 5 Jun 2022 16:24:12 -0500 Subject: [PATCH] macroInt: add hasRelease variable --- src/engine/macroInt.cpp | 8 +++++++- src/engine/macroInt.h | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/engine/macroInt.cpp b/src/engine/macroInt.cpp index 6f853bff..06f04682 100644 --- a/src/engine/macroInt.cpp +++ b/src/engine/macroInt.cpp @@ -101,6 +101,7 @@ void DivMacroInt::init(DivInstrument* which) { macroListLen=0; subTick=1; + hasRelease=false; released=false; if (ins==NULL) return; @@ -236,7 +237,12 @@ void DivMacroInt::init(DivInstrument* which) { } for (size_t i=0; iprepare(*macroSource[i],e); + if (macroSource[i]!=NULL) { + macroList[i]->prepare(*macroSource[i],e); + hasRelease=(macroSource[i]->rel>=0 && macroSource[i]->rellen); + } else { + hasRelease=false; + } } } diff --git a/src/engine/macroInt.h b/src/engine/macroInt.h index d82cb2b2..83962555 100644 --- a/src/engine/macroInt.h +++ b/src/engine/macroInt.h @@ -96,6 +96,9 @@ class DivMacroInt { ksr() {} } op[4]; + // state + bool hasRelease; + /** * trigger macro release. */ @@ -149,7 +152,8 @@ class DivMacroInt { ex5(), ex6(), ex7(), - ex8() { + ex8(), + hasRelease(false) { memset(macroList,0,128*sizeof(void*)); memset(macroSource,0,128*sizeof(void*)); }