Browse Source

Stop engine wprker threads when engine is paused.

tags/v1.1.5
Andrew Belt 4 years ago
parent
commit
618454e7c0
2 changed files with 13 additions and 5 deletions
  1. +2
    -0
      CHANGELOG.md
  2. +11
    -5
      src/engine/Engine.cpp

+ 2
- 0
CHANGELOG.md View File

@@ -6,6 +6,8 @@ In this document, Mod is Ctrl on Windows/Linux and Cmd on Mac.
- Swap order of tags and brands in Module Browser.
- Disable smoothing for MIDI CC buttons in MIDI-Map.
- Automatically unzip update on Mac.
- Core
- Fix sustain pedal release bug when using polyphonic mode in MIDI-CV.
- API
- Add libsamplerate library.



+ 11
- 5
src/engine/Engine.cpp View File

@@ -429,12 +429,12 @@ static void Engine_run(Engine* that) {
aheadTime = 0.0;
}

// Launch workers
if (internal->threadCount != settings::threadCount || internal->realTime != settings::realTime) {
Engine_relaunchWorkers(that, settings::threadCount, settings::realTime);
}

if (!internal->paused) {
// Launch workers
if (internal->threadCount != settings::threadCount || internal->realTime != settings::realTime) {
Engine_relaunchWorkers(that, settings::threadCount, settings::realTime);
}

std::lock_guard<std::recursive_mutex> lock(internal->mutex);

// Update expander pointers
@@ -448,6 +448,12 @@ static void Engine_run(Engine* that) {
Engine_step(that);
}
}
else {
// Stop workers while closed
if (internal->threadCount != 1) {
Engine_relaunchWorkers(that, 1, settings::realTime);
}
}

double stepTime = mutexSteps * internal->sampleTime;
aheadTime += stepTime;


Loading…
Cancel
Save