From b0190e90b3f9909bf58b8b150efa788bdc9e9e85 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 25 Aug 2023 11:13:37 +0200 Subject: Add config option to set low latency mode --- depends/mglpp | 2 +- example-config.json | 4 +++- include/Config.hpp | 1 + src/Config.cpp | 1 + src/QuickMedia.cpp | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/depends/mglpp b/depends/mglpp index 9928836..f273d44 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit 99288368ebe3d1f170a102c1dbd4330c6cc92d0a +Subproject commit f273d44d325a50631698865f6b863b4685e0cb2a diff --git a/example-config.json b/example-config.json index ece1aa8..2c47264 100644 --- a/example-config.json +++ b/example-config.json @@ -128,5 +128,7 @@ // Font scale (only fonts) "font_scale": 1.0, // Spacing scale (only scaling the spacing between elements, nothing else) - "spacing_scale": 1.0 + "spacing_scale": 1.0, + // Can reduce latency, but might increase cpu usage a bit + "low_latency_mode": false } diff --git a/include/Config.hpp b/include/Config.hpp index a9a36c2..306b535 100644 --- a/include/Config.hpp +++ b/include/Config.hpp @@ -110,6 +110,7 @@ namespace QuickMedia { float scale = 1.0f; float font_scale = 1.0f; float spacing_scale = 1.0f; + bool low_latency_mode = false; }; const Config& get_config(); diff --git a/src/Config.cpp b/src/Config.cpp index c79249d..4f8d4d1 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -321,6 +321,7 @@ namespace QuickMedia { get_json_value(json_root, "scale", config->scale); get_json_value(json_root, "font_scale", config->font_scale); get_json_value(json_root, "spacing_scale", config->spacing_scale); + get_json_value(json_root, "low_latency_mode", config->low_latency_mode); } const Config& get_config() { diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 14efedb..79684ed 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -743,6 +743,8 @@ namespace QuickMedia { abort(); } + window.set_low_latency(get_config().low_latency_mode); + if(!program_path.empty() && program_path.back() != '/') program_path += '/'; -- cgit v1.2.3