Fix call to ipc_server_main, add config options for debug GUI and steamvr_lh
* Add config option for SteamVR lighthouse device support * Add dashboard toggles for debug window and steamvr_lh * clang-format * Hide advanced toggles if not enabled during build
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
|
||||
#cmakedefine01 WIVRN_CHECK_CAPSYSNICE
|
||||
|
||||
#cmakedefine01 WIVRN_FEATURE_DEBUG_GUI
|
||||
#cmakedefine01 WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
|
||||
|
||||
#cmakedefine01 WIVRN_USE_NVENC
|
||||
#cmakedefine01 WIVRN_USE_VAAPI
|
||||
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
|
||||
|
||||
@@ -316,6 +316,22 @@ Kirigami.ScrollablePage {
|
||||
Kirigami.FormData.isSection: true
|
||||
}
|
||||
|
||||
Kirigami.Heading {
|
||||
text: i18n("Advanced options")
|
||||
level: 1
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
}
|
||||
Controls.CheckBox {
|
||||
id: debug_gui
|
||||
text: i18n("Enable debug window")
|
||||
visible: config.debug_gui_supported
|
||||
}
|
||||
Controls.CheckBox {
|
||||
id: steamvr_lh
|
||||
text: i18n("Enable SteamVR tracked devices support")
|
||||
visible: config.steamvr_lh_supported
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: adb_custom
|
||||
Layout.row: 0
|
||||
@@ -452,6 +468,9 @@ Kirigami.ScrollablePage {
|
||||
settings.adb_custom = adb_custom.checked;
|
||||
settings.adb_location = adb_location.text;
|
||||
Adb.setPath(adb_custom.checked ? adb_location.text : "adb");
|
||||
|
||||
config.debugGui = debug_gui.checked;
|
||||
config.steamVrLh = steamvr_lh.checked;
|
||||
}
|
||||
|
||||
function load() {
|
||||
@@ -471,6 +490,10 @@ Kirigami.ScrollablePage {
|
||||
// auto_encoders.checked = true;
|
||||
encoder_layout.currentIndex = 0;
|
||||
}
|
||||
|
||||
debug_gui.checked = config.debugGui;
|
||||
steamvr_lh.checked = config.steamVrLh;
|
||||
|
||||
openvr_combobox.load()
|
||||
|
||||
adb_custom.checked = settings.adb_custom;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "settings.h"
|
||||
|
||||
#include "escape_string.h"
|
||||
#include "gui_config.h"
|
||||
#include "utils/flatpak.h"
|
||||
#include "wivrn_server.h"
|
||||
#include <QList>
|
||||
@@ -213,6 +214,25 @@ void Settings::load(const wivrn_server * server)
|
||||
set_application("");
|
||||
}
|
||||
|
||||
// Advanced options (debug window, steamvr_lh)
|
||||
try
|
||||
{
|
||||
set_debugGui(json_doc.value("debug-gui", false));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
set_debugGui(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
set_steamVrLh(json_doc.value("use-steamvr-lh", false));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
set_steamVrLh(false);
|
||||
}
|
||||
|
||||
// OpenVR compat library
|
||||
try
|
||||
{
|
||||
@@ -298,6 +318,9 @@ void Settings::save(wivrn_server * server)
|
||||
if (application() != "")
|
||||
json_doc["application"] = unescape_string(application());
|
||||
|
||||
json_doc["debug-gui"] = debugGui();
|
||||
json_doc["use-steamvr-lh"] = steamVrLh();
|
||||
|
||||
if (openvr() == "-")
|
||||
json_doc["openvr-compat-path"] = nullptr;
|
||||
else if (openvr() == "")
|
||||
@@ -315,6 +338,8 @@ void Settings::restore_defaults()
|
||||
set_bitrate(50'000'000);
|
||||
set_scale(-1);
|
||||
set_application("");
|
||||
set_debugGui(false);
|
||||
set_steamVrLh(false);
|
||||
set_tcpOnly(false);
|
||||
}
|
||||
|
||||
@@ -347,4 +372,21 @@ bool Settings::flatpak() const
|
||||
return wivrn::is_flatpak();
|
||||
}
|
||||
|
||||
bool Settings::debug_gui() const
|
||||
{
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
bool Settings::steamvr_lh() const
|
||||
{
|
||||
#if WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_settings.cpp"
|
||||
|
||||
@@ -122,10 +122,14 @@ class Settings : public QObject
|
||||
Q_PROPERTY(int bitrate READ bitrate WRITE set_bitrate NOTIFY bitrateChanged)
|
||||
Q_PROPERTY(float scale READ scale WRITE set_scale NOTIFY scaleChanged)
|
||||
Q_PROPERTY(QString application READ application WRITE set_application NOTIFY applicationChanged)
|
||||
Q_PROPERTY(bool debugGui READ debugGui WRITE set_debugGui NOTIFY debugGuiChanged)
|
||||
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
|
||||
Q_PROPERTY(bool tcpOnly READ tcpOnly WRITE set_tcpOnly NOTIFY tcpOnlyChanged)
|
||||
Q_PROPERTY(QString openvr READ openvr WRITE set_openvr NOTIFY openvrChanged)
|
||||
|
||||
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
|
||||
Q_PROPERTY(bool debug_gui_supported READ debug_gui CONSTANT)
|
||||
Q_PROPERTY(bool steamvr_lh_supported READ steamvr_lh CONSTANT)
|
||||
|
||||
SETTER_GETTER_NOTIFY(bool, manualEncoders)
|
||||
SETTER_GETTER_NOTIFY(std::vector<encoder>, encoders)
|
||||
@@ -133,6 +137,8 @@ class Settings : public QObject
|
||||
SETTER_GETTER_NOTIFY(int, bitrate)
|
||||
SETTER_GETTER_NOTIFY(float, scale)
|
||||
SETTER_GETTER_NOTIFY(QString, application)
|
||||
SETTER_GETTER_NOTIFY(bool, debugGui)
|
||||
SETTER_GETTER_NOTIFY(bool, steamVrLh)
|
||||
SETTER_GETTER_NOTIFY(bool, tcpOnly)
|
||||
SETTER_GETTER_NOTIFY(QString, openvr)
|
||||
|
||||
@@ -146,6 +152,8 @@ public:
|
||||
Q_INVOKABLE void set_encoder_preset(QJSValue preset);
|
||||
|
||||
bool flatpak() const;
|
||||
bool debug_gui() const;
|
||||
bool steamvr_lh() const;
|
||||
|
||||
static std::optional<encoder::encoder_name> encoder_id_from_string(std::string_view s);
|
||||
static std::optional<encoder::video_codec> codec_id_from_string(std::string_view s);
|
||||
|
||||
Reference in New Issue
Block a user