Optimizations to core modules

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-03-22 14:37:56 +00:00
parent dbbc955df6
commit cab2aa9862
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
13 changed files with 185 additions and 109 deletions

View file

@ -148,7 +148,7 @@ struct IldaeilModule : Module {
float audioDataOut1[BUFFER_SIZE];
float audioDataOut2[BUFFER_SIZE];
unsigned audioDataFill = 0;
int64_t lastBlockFrame = -1;
uint32_t lastProcessCounter = 0;
CardinalExpanderFromCarlaMIDIToCV* midiOutExpander = nullptr;
volatile bool resetMeterIn = true;
@ -359,12 +359,12 @@ struct IldaeilModule : Module {
if (audioDataFill == BUFFER_SIZE)
{
const int64_t blockFrame = pcontext->engine->getBlockFrame();
const uint32_t processCounter = pcontext->processCounter;
// Update time position if running a new audio block
if (lastBlockFrame != blockFrame)
if (lastProcessCounter != processCounter)
{
lastBlockFrame = blockFrame;
lastProcessCounter = processCounter;
fCarlaTimeInfo.playing = pcontext->playing;
fCarlaTimeInfo.frame = pcontext->frame;
fCarlaTimeInfo.bbt.valid = pcontext->bbtValid;