@@ -28,7 +28,6 @@ extern bool invertZoom; | |||||
extern float cableOpacity; | extern float cableOpacity; | ||||
extern float cableTension; | extern float cableTension; | ||||
extern bool allowCursorLock; | extern bool allowCursorLock; | ||||
extern bool realTime; | |||||
extern float sampleRate; | extern float sampleRate; | ||||
extern int threadCount; | extern int threadCount; | ||||
extern bool paramTooltip; | extern bool paramTooltip; | ||||
@@ -456,12 +456,6 @@ struct SampleRateItem : ui::MenuItem { | |||||
} | } | ||||
}; | }; | ||||
struct RealTimeItem : ui::MenuItem { | |||||
void onAction(const event::Action& e) override { | |||||
settings::realTime ^= true; | |||||
} | |||||
}; | |||||
struct ThreadCountValueItem : ui::MenuItem { | struct ThreadCountValueItem : ui::MenuItem { | ||||
int threadCount; | int threadCount; | ||||
void setThreadCount(int threadCount) { | void setThreadCount(int threadCount) { | ||||
@@ -482,11 +476,6 @@ struct ThreadCountItem : ui::MenuItem { | |||||
ui::Menu* createChildMenu() override { | ui::Menu* createChildMenu() override { | ||||
ui::Menu* menu = new ui::Menu; | ui::Menu* menu = new ui::Menu; | ||||
RealTimeItem* realTimeItem = new RealTimeItem; | |||||
realTimeItem->text = "Real-time priority"; | |||||
realTimeItem->rightText = CHECKMARK(settings::realTime); | |||||
menu->addChild(realTimeItem); | |||||
int coreCount = system::getLogicalCoreCount(); | int coreCount = system::getLogicalCoreCount(); | ||||
for (int i = 1; i <= coreCount; i++) { | for (int i = 1; i <= coreCount; i++) { | ||||
ThreadCountValueItem* item = new ThreadCountValueItem; | ThreadCountValueItem* item = new ThreadCountValueItem; | ||||
@@ -165,7 +165,6 @@ struct Engine::Internal { | |||||
std::recursive_mutex mutex; | std::recursive_mutex mutex; | ||||
bool realTime = false; | |||||
int threadCount = 0; | int threadCount = 0; | ||||
std::vector<EngineWorker> workers; | std::vector<EngineWorker> workers; | ||||
HybridBarrier engineBarrier; | HybridBarrier engineBarrier; | ||||
@@ -341,7 +340,7 @@ static void Engine_updateExpander(Engine* that, Module::Expander* expander) { | |||||
} | } | ||||
static void Engine_relaunchWorkers(Engine* that, int threadCount, bool realTime) { | |||||
static void Engine_relaunchWorkers(Engine* that, int threadCount) { | |||||
Engine::Internal* internal = that->internal; | Engine::Internal* internal = that->internal; | ||||
if (internal->threadCount > 0) { | if (internal->threadCount > 0) { | ||||
@@ -360,15 +359,11 @@ static void Engine_relaunchWorkers(Engine* that, int threadCount, bool realTime) | |||||
// Configure engine | // Configure engine | ||||
internal->threadCount = threadCount; | internal->threadCount = threadCount; | ||||
internal->realTime = realTime; | |||||
// Set barrier counts | // Set barrier counts | ||||
internal->engineBarrier.total = threadCount; | internal->engineBarrier.total = threadCount; | ||||
internal->workerBarrier.total = threadCount; | internal->workerBarrier.total = threadCount; | ||||
// Configure main thread | |||||
system::setThreadRealTime(realTime); | |||||
if (threadCount > 0) { | if (threadCount > 0) { | ||||
// Create and start engine workers | // Create and start engine workers | ||||
internal->workers.resize(threadCount - 1); | internal->workers.resize(threadCount - 1); | ||||
@@ -391,7 +386,7 @@ Engine::Engine() { | |||||
Engine::~Engine() { | Engine::~Engine() { | ||||
Engine_relaunchWorkers(this, 0, false); | |||||
Engine_relaunchWorkers(this, 0); | |||||
clear(); | clear(); | ||||
// Make sure there are no cables or modules in the rack on destruction. | // Make sure there are no cables or modules in the rack on destruction. | ||||
@@ -444,8 +439,8 @@ void Engine::step(int frames) { | |||||
if (!internal->paused) { | if (!internal->paused) { | ||||
// Launch workers | // Launch workers | ||||
if (internal->threadCount != settings::threadCount || internal->realTime != settings::realTime) { | |||||
Engine_relaunchWorkers(this, settings::threadCount, settings::realTime); | |||||
if (internal->threadCount != settings::threadCount) { | |||||
Engine_relaunchWorkers(this, settings::threadCount); | |||||
} | } | ||||
std::lock_guard<std::recursive_mutex> lock(internal->mutex); | std::lock_guard<std::recursive_mutex> lock(internal->mutex); | ||||
@@ -464,7 +459,7 @@ void Engine::step(int frames) { | |||||
else { | else { | ||||
// Stop workers while paused | // Stop workers while paused | ||||
if (internal->threadCount != 1) { | if (internal->threadCount != 1) { | ||||
Engine_relaunchWorkers(this, 1, settings::realTime); | |||||
Engine_relaunchWorkers(this, 1); | |||||
} | } | ||||
} | } | ||||
@@ -23,7 +23,6 @@ bool invertZoom = false; | |||||
float cableOpacity = 0.5; | float cableOpacity = 0.5; | ||||
float cableTension = 0.5; | float cableTension = 0.5; | ||||
bool allowCursorLock = true; | bool allowCursorLock = true; | ||||
bool realTime = false; | |||||
float sampleRate = 44100.0; | float sampleRate = 44100.0; | ||||
int threadCount = 1; | int threadCount = 1; | ||||
bool paramTooltip = false; | bool paramTooltip = false; | ||||
@@ -67,8 +66,6 @@ json_t* toJson() { | |||||
json_object_set_new(rootJ, "allowCursorLock", json_boolean(allowCursorLock)); | json_object_set_new(rootJ, "allowCursorLock", json_boolean(allowCursorLock)); | ||||
json_object_set_new(rootJ, "realTime", json_boolean(realTime)); | |||||
json_object_set_new(rootJ, "sampleRate", json_real(sampleRate)); | json_object_set_new(rootJ, "sampleRate", json_real(sampleRate)); | ||||
json_object_set_new(rootJ, "threadCount", json_integer(threadCount)); | json_object_set_new(rootJ, "threadCount", json_integer(threadCount)); | ||||
@@ -138,10 +135,6 @@ void fromJson(json_t* rootJ) { | |||||
if (allowCursorLockJ) | if (allowCursorLockJ) | ||||
allowCursorLock = json_is_true(allowCursorLockJ); | allowCursorLock = json_is_true(allowCursorLockJ); | ||||
json_t* realTimeJ = json_object_get(rootJ, "realTime"); | |||||
if (realTimeJ) | |||||
realTime = json_boolean_value(realTimeJ); | |||||
json_t* sampleRateJ = json_object_get(rootJ, "sampleRate"); | json_t* sampleRateJ = json_object_get(rootJ, "sampleRate"); | ||||
if (sampleRateJ) | if (sampleRateJ) | ||||
sampleRate = json_number_value(sampleRateJ); | sampleRate = json_number_value(sampleRateJ); | ||||