diff --git a/src/Config.h b/src/Config.h index 89aa838f..916162a5 100644 --- a/src/Config.h +++ b/src/Config.h @@ -19,8 +19,8 @@ class Config { bool FirstLoad; bool ServerEnabled; uint16_t ServerPort; - bool DebugEnabled; - bool AlertsEnabled; + std::atomic DebugEnabled; + std::atomic AlertsEnabled; bool AuthRequired; QString ServerPassword; diff --git a/src/obs-websocket.cpp b/src/obs-websocket.cpp index 1c636ce4..2241c028 100644 --- a/src/obs-websocket.cpp +++ b/src/obs-websocket.cpp @@ -102,3 +102,8 @@ os_cpu_usage_info_t* GetCpuUsageInfo() { return _cpuUsageInfo; } + +bool IsDebugMode() +{ + return !_config || _config->DebugEnabled; +} \ No newline at end of file diff --git a/src/obs-websocket.h b/src/obs-websocket.h index 5eb40916..13cf39f2 100644 --- a/src/obs-websocket.h +++ b/src/obs-websocket.h @@ -53,3 +53,5 @@ WebSocketServerPtr GetWebSocketServer(); EventHandlerPtr GetEventHandler(); os_cpu_usage_info_t* GetCpuUsageInfo(); + +bool IsDebugMode();