Remove old dashboard
This commit is contained in:
@@ -1,106 +0,0 @@
|
||||
# Qt 6.7 changed qt_add_translations()
|
||||
try_compile(AT_LEAST_QT67 SOURCE_FROM_CONTENT check-qt-version.cpp "
|
||||
#include <QtGlobal>
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||
#error
|
||||
#endif
|
||||
|
||||
int main() {}
|
||||
" LINK_LIBRARIES Qt6::Core)
|
||||
|
||||
qt_add_executable(wivrn-dashboard
|
||||
main.cpp
|
||||
main_window.cpp
|
||||
main_window.h
|
||||
main_window.ui
|
||||
manage_headsets.cpp
|
||||
manage_headsets.h
|
||||
manage_headsets.ui
|
||||
settings.cpp
|
||||
settings.h
|
||||
settings.ui
|
||||
wivrn_server.cpp
|
||||
wivrn_server.h
|
||||
wizard.cpp
|
||||
wizard.h
|
||||
wizard.ui
|
||||
rectangle_partitionner.cpp
|
||||
rectangle_partitionner.h
|
||||
steam_app.cpp
|
||||
steam_app.h
|
||||
adb.cpp
|
||||
adb.h
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png
|
||||
COMMAND ${RSVG_CONVERT} ${CMAKE_CURRENT_SOURCE_DIR}/../images/wivrn.svg -w 540 -h 540 -o ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../images/wivrn.svg)
|
||||
|
||||
add_custom_target(dashboard-assets ALL DEPENDS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wivrn.png
|
||||
)
|
||||
|
||||
add_dependencies(wivrn-dashboard dashboard-assets)
|
||||
|
||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/../images/wivrn.svg PROPERTIES QT_RESOURCE_ALIAS "images/wivrn.svg")
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/wivrn.png PROPERTIES QT_RESOURCE_ALIAS "images/wivrn.png")
|
||||
|
||||
qt_add_resources(wivrn-dashboard wivrn-dashboard-resources PREFIX / FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../images/wivrn.svg
|
||||
${CMAKE_CURRENT_BINARY_DIR}/wivrn.png
|
||||
)
|
||||
|
||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/../dbus/io.github.wivrn.Server.xml PROPERTIES INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/wivrn_qdbus_types.h")
|
||||
qt_add_dbus_interface(DBUS_INTERFACE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../dbus/io.github.wivrn.Server.xml wivrn_server_dbus)
|
||||
target_sources(wivrn-dashboard PRIVATE ${DBUS_INTERFACE_SRC})
|
||||
|
||||
target_compile_features(wivrn-dashboard PRIVATE cxx_std_20)
|
||||
target_include_directories(wivrn-dashboard PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
configure_file(gui_config.h.in gui_config.h)
|
||||
configure_file(io.github.wivrn.wivrn.desktop.in io.github.wivrn.wivrn.desktop)
|
||||
|
||||
target_link_libraries(wivrn-dashboard PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
Qt6::DBus
|
||||
Qt6::Network
|
||||
nlohmann_json
|
||||
wivrn-common-base
|
||||
Vulkan::Vulkan
|
||||
)
|
||||
|
||||
target_compile_definitions(wivrn-dashboard PRIVATE JSON_DIAGNOSTICS=1)
|
||||
|
||||
if (WIVRN_CHECK_CAPSYSNICE)
|
||||
target_link_libraries(wivrn-dashboard PRIVATE PkgConfig::libcap)
|
||||
endif()
|
||||
|
||||
file(GLOB TRANSLATION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/wivrn_*.ts)
|
||||
|
||||
if (AT_LEAST_QT67)
|
||||
qt_add_translations(wivrn-dashboard SOURCE_TARGETS wivrn-dashboard TS_FILES ${TRANSLATION_FILES})
|
||||
else()
|
||||
qt_add_translations(wivrn-dashboard TS_FILES ${TRANSLATION_FILES})
|
||||
endif()
|
||||
|
||||
# https://16bpp.net/blog/post/localizing-a-qt-app-or-anything-else-for-that-matter/, CMake Setup
|
||||
# https://gist.github.com/define-private-public/f01ff2f9bbb74eded144558a2e02966c#file-cmakelists-2-txt
|
||||
add_dependencies(wivrn-dashboard release_translations)
|
||||
|
||||
install(TARGETS wivrn-dashboard)
|
||||
|
||||
install(FILES io.github.wivrn.wivrn.metainfo.xml
|
||||
DESTINATION share/metainfo
|
||||
)
|
||||
|
||||
install(FILES ../images/wivrn.svg
|
||||
DESTINATION share/icons/hicolor/scalable/apps
|
||||
RENAME io.github.wivrn.wivrn.svg
|
||||
)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/io.github.wivrn.wivrn.desktop
|
||||
DESTINATION share/applications
|
||||
)
|
||||
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "adb.h"
|
||||
|
||||
#include "utils/flatpak.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QProcess>
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
template <typename... Args>
|
||||
std::unique_ptr<QProcess> escape_sandbox(const std::string & executable, Args &&... args_orig)
|
||||
{
|
||||
auto process = std::make_unique<QProcess>();
|
||||
QStringList args;
|
||||
|
||||
if (wivrn::flatpak_key(wivrn::flatpak::section::session_bus_policy, "org.freedesktop.Flatpak") == "talk")
|
||||
{
|
||||
process->setProgram("flatpak-spawn");
|
||||
args.push_back("--host");
|
||||
args.push_back(QString::fromStdString(executable));
|
||||
}
|
||||
else
|
||||
{
|
||||
process->setProgram(QString::fromStdString(executable));
|
||||
}
|
||||
|
||||
(args.push_back(QString::fromStdString(args_orig)), ...);
|
||||
|
||||
process->setArguments(args);
|
||||
|
||||
return process;
|
||||
}
|
||||
|
||||
adb::adb()
|
||||
{
|
||||
poll_devices_timer.setInterval(500ms);
|
||||
connect(&poll_devices_timer, &QTimer::timeout, this, &adb::on_poll_devices_timeout);
|
||||
|
||||
on_poll_devices_timeout();
|
||||
poll_devices_timer.start();
|
||||
}
|
||||
|
||||
void adb::on_poll_devices_timeout()
|
||||
{
|
||||
if (poll_devices_process)
|
||||
return;
|
||||
|
||||
poll_devices_process = escape_sandbox("adb", "devices", "-l");
|
||||
connect(poll_devices_process.get(), &QProcess::finished, this, &adb::on_poll_devices_process_finished);
|
||||
poll_devices_process->start();
|
||||
}
|
||||
|
||||
void adb::on_poll_devices_process_finished(int exit_code, QProcess::ExitStatus exit_status)
|
||||
{
|
||||
if (exit_code != 0 or exit_status != QProcess::NormalExit)
|
||||
{
|
||||
qDebug() << "adb devices exited with code" << exit_code << ", status" << exit_status;
|
||||
|
||||
QString out = poll_devices_process->readAllStandardOutput();
|
||||
qDebug() << "stdout:" << out;
|
||||
|
||||
QString err = poll_devices_process->readAllStandardError();
|
||||
qDebug() << "stderr:" << err;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto out = poll_devices_process->readAllStandardOutput();
|
||||
auto lines = QString{out}.split('\n');
|
||||
|
||||
if (not lines.empty())
|
||||
lines.pop_front();
|
||||
|
||||
std::vector<adb::device> devs;
|
||||
for (auto & line: lines)
|
||||
{
|
||||
auto words = line.split(' ', Qt::SkipEmptyParts);
|
||||
device dev;
|
||||
|
||||
if (words.empty())
|
||||
continue;
|
||||
dev._serial = words.front().toStdString();
|
||||
words.pop_front();
|
||||
|
||||
if (words.empty())
|
||||
continue;
|
||||
dev._state = words.front().toStdString();
|
||||
words.pop_front();
|
||||
|
||||
for (auto & word: words)
|
||||
{
|
||||
auto idx = word.indexOf(':');
|
||||
if (idx >= 0)
|
||||
{
|
||||
dev._properties[word.left(idx).toStdString()] = word.mid(idx + 1).toStdString();
|
||||
}
|
||||
}
|
||||
|
||||
devs.push_back(dev);
|
||||
}
|
||||
|
||||
_android_devices = std::move(devs);
|
||||
android_devices_changed(_android_devices);
|
||||
}
|
||||
|
||||
poll_devices_process.release()->deleteLater();
|
||||
}
|
||||
|
||||
std::unique_ptr<QProcess> adb::device::install(const std::filesystem::path & path)
|
||||
{
|
||||
return escape_sandbox("adb", "-s", _serial, "install", "-r", path);
|
||||
}
|
||||
|
||||
std::unique_ptr<QProcess> adb::device::uninstall(const std::string & app)
|
||||
{
|
||||
return escape_sandbox("adb", "-s", _serial, "uninstall", app);
|
||||
}
|
||||
|
||||
std::vector<std::string> adb::device::installed_apps()
|
||||
{
|
||||
auto process = escape_sandbox("adb", "-s", _serial, "shell", "pm", "list", "packages");
|
||||
process->start();
|
||||
process->waitForFinished();
|
||||
|
||||
if (process->exitCode() != 0 or process->exitStatus() != QProcess::NormalExit)
|
||||
throw std::runtime_error("Cannot list packages");
|
||||
|
||||
auto out = process->readAllStandardOutput();
|
||||
auto lines = QString{out}.split('\n');
|
||||
|
||||
std::vector<std::string> apps;
|
||||
|
||||
for (auto & line: lines)
|
||||
{
|
||||
QString prefix = "package:";
|
||||
if (line.startsWith(prefix))
|
||||
{
|
||||
apps.push_back(line.toStdString().substr(prefix.size()));
|
||||
}
|
||||
}
|
||||
|
||||
return apps;
|
||||
}
|
||||
|
||||
// void adb::device::start(const std::string& app)
|
||||
// {
|
||||
// auto process = escape_sandbox("adb", "-s", _serial, "shell", "am", "start", app);
|
||||
// process->start();
|
||||
// process->waitForFinished();
|
||||
// }
|
||||
//
|
||||
// void adb::device::stop(const std::string& app)
|
||||
// {
|
||||
// auto process = escape_sandbox("adb", "-s", _serial, "shell", "am", "force-stop", app);
|
||||
// process->start();
|
||||
// process->waitForFinished();
|
||||
// }
|
||||
//
|
||||
void adb::device::start(const std::string & app, const std::string & action, const std::string & uri)
|
||||
{
|
||||
// action: "android.intent.action.VIEW" or "android.intent.action.MAIN"
|
||||
auto process = escape_sandbox("adb", "-s", _serial, "shell", "am", "start", "-a", action, "-d", uri, app);
|
||||
process->start();
|
||||
process->waitForFinished();
|
||||
}
|
||||
|
||||
void adb::device::reverse_forward(int local_port, int device_port)
|
||||
{
|
||||
auto process = escape_sandbox("adb", "-s", _serial, "reverse", "tcp:" + std::to_string(local_port), "tcp:" + std::to_string(device_port));
|
||||
process->start();
|
||||
process->waitForFinished();
|
||||
}
|
||||
|
||||
#include "moc_adb.cpp"
|
||||
-113
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class QProcess;
|
||||
|
||||
class adb : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
class device
|
||||
{
|
||||
std::string _serial;
|
||||
std::string _state;
|
||||
std::map<std::string, std::string> _properties;
|
||||
|
||||
friend class adb;
|
||||
|
||||
public:
|
||||
device() = default;
|
||||
device(const device &) = default;
|
||||
device(device &&) = default;
|
||||
device & operator=(const device &) = default;
|
||||
device & operator=(device &&) = default;
|
||||
|
||||
const auto & serial() const
|
||||
{
|
||||
return _serial;
|
||||
};
|
||||
|
||||
const auto & state() const
|
||||
{
|
||||
return _state;
|
||||
};
|
||||
|
||||
const auto & properties() const
|
||||
{
|
||||
return _properties;
|
||||
};
|
||||
|
||||
bool operator==(const device & other) const
|
||||
{
|
||||
return _serial == other._serial;
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return _serial != "";
|
||||
}
|
||||
|
||||
std::unique_ptr<QProcess> install(const std::filesystem::path & path);
|
||||
std::unique_ptr<QProcess> uninstall(const std::string & app);
|
||||
void start(const std::string & app, const std::string & action, const std::string & uri);
|
||||
void reverse_forward(int local_port, int device_port);
|
||||
std::vector<std::string> installed_apps();
|
||||
};
|
||||
|
||||
private:
|
||||
QTimer poll_devices_timer;
|
||||
std::unique_ptr<QProcess> poll_devices_process;
|
||||
std::vector<adb::device> _android_devices;
|
||||
|
||||
void on_poll_devices_timeout();
|
||||
void on_poll_devices_process_finished(int exit_code, QProcess::ExitStatus exit_status);
|
||||
|
||||
public:
|
||||
adb();
|
||||
adb(const adb &) = delete;
|
||||
adb & operator=(const adb &) = delete;
|
||||
|
||||
const std::vector<adb::device> & devices() const
|
||||
{
|
||||
return _android_devices;
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
poll_devices_timer.start();
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
poll_devices_timer.stop();
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void android_devices_changed(const std::vector<adb::device> &);
|
||||
};
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
constexpr std::string escape_string(const std::vector<std::string> & app)
|
||||
{
|
||||
constexpr std::string_view escaped_chars = R"( '"\)";
|
||||
std::string app_string;
|
||||
for (const auto & i: app)
|
||||
{
|
||||
for (char c: i)
|
||||
{
|
||||
if (escaped_chars.find(c) == std::string_view::npos)
|
||||
{
|
||||
app_string += c;
|
||||
}
|
||||
else
|
||||
{
|
||||
app_string += '\\';
|
||||
app_string += c;
|
||||
}
|
||||
}
|
||||
|
||||
app_string += ' ';
|
||||
}
|
||||
app_string.resize(app_string.size() - 1);
|
||||
|
||||
return app_string;
|
||||
}
|
||||
|
||||
constexpr std::vector<std::string> unescape_string(const std::string & app_string)
|
||||
{
|
||||
std::vector<std::string> app;
|
||||
app.emplace_back();
|
||||
|
||||
bool seen_backslash = false;
|
||||
bool seen_single_quote = false;
|
||||
bool seen_double_quote = false;
|
||||
for (auto c: app_string)
|
||||
{
|
||||
if (seen_backslash)
|
||||
{
|
||||
app.back() += c;
|
||||
seen_backslash = false;
|
||||
}
|
||||
else if (seen_single_quote)
|
||||
{
|
||||
if (c == '\'')
|
||||
seen_single_quote = false;
|
||||
else if (c == '\\')
|
||||
seen_backslash = true;
|
||||
else
|
||||
app.back() += c;
|
||||
}
|
||||
else if (seen_double_quote)
|
||||
{
|
||||
if (c == '"')
|
||||
seen_double_quote = false;
|
||||
else if (c == '\\')
|
||||
seen_backslash = true;
|
||||
else
|
||||
app.back() += c;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
seen_backslash = true;
|
||||
break;
|
||||
case '\'':
|
||||
seen_single_quote = true;
|
||||
break;
|
||||
case '"':
|
||||
seen_double_quote = true;
|
||||
break;
|
||||
case ' ':
|
||||
if (not app.back().empty())
|
||||
app.emplace_back();
|
||||
break;
|
||||
default:
|
||||
app.back() += c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (app.back().empty())
|
||||
app.pop_back();
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
static_assert(escape_string({"abc", "def"}) == R"(abc def)");
|
||||
static_assert(escape_string({"ab\"c", "def"}) == R"(ab\"c def)");
|
||||
static_assert(escape_string({"ab'c", "def"}) == R"(ab\'c def)");
|
||||
static_assert(escape_string({"ab\\c", "def"}) == R"(ab\\c def)");
|
||||
|
||||
static_assert(unescape_string(R"(abc def)") == std::vector<std::string>{"abc", "def"});
|
||||
static_assert(unescape_string(R"(ab\"c def)") == std::vector<std::string>{"ab\"c", "def"});
|
||||
static_assert(unescape_string(R"(ab\'c def)") == std::vector<std::string>{"ab'c", "def"});
|
||||
static_assert(unescape_string(R"(ab\\c def)") == std::vector<std::string>{"ab\\c", "def"});
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
* Copyright (C) 2024 Patrick Nicolas <patricknicolas@laposte.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#cmakedefine01 WIVRN_CHECK_CAPSYSNICE
|
||||
|
||||
#cmakedefine01 WIVRN_USE_NVENC
|
||||
#cmakedefine01 WIVRN_USE_VAAPI
|
||||
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
|
||||
#cmakedefine01 WIVRN_USE_X264
|
||||
@@ -1,8 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Name=WiVRn server
|
||||
Comment=Play your PC VR games on a standalone headset
|
||||
GenericName=WiVRn dashboard
|
||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/wivrn-dashboard
|
||||
Icon=io.github.wivrn.wivrn
|
||||
Type=Application
|
||||
Categories=Network
|
||||
@@ -1,162 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>io.github.wivrn.wivrn</id>
|
||||
<name>WiVRn server</name>
|
||||
<metadata_license>FSFAP</metadata_license>
|
||||
<project_license>GPL-3.0-or-later</project_license>
|
||||
<summary>Play your PC VR games on a standalone headset</summary>
|
||||
<description>
|
||||
<p>WiVRn allows you to run your VR games from your PC and play them from a standalone headset.</p>
|
||||
|
||||
<p>You will need to install the WiVRn client on your headset from the Meta Store or by following the wizard in the application.</p>
|
||||
|
||||
<p>Supported headsets:</p>
|
||||
<ul>
|
||||
<li>Meta Quest 1</li>
|
||||
<li>Meta Quest 2</li>
|
||||
<li>Meta Quest 3</li>
|
||||
<li>Meta Quest 3S</li>
|
||||
<li>Meta Quest Pro</li>
|
||||
<li>Pico Neo 4</li>
|
||||
<li>HTC Vive Focus 3</li>
|
||||
<li>HTC Vive XR Elite</li>
|
||||
</ul>
|
||||
<p>Features:</p>
|
||||
<ul>
|
||||
<li>Supports OpenXR and OpenVR applications</li>
|
||||
<li>Controller tracking, hand tracking, eye gaze tracking (if supported by the headset)</li>
|
||||
<li>Audio streaming and microphone</li>
|
||||
<li>Video streaming with H264 / HEVC / AV1 compression</li>
|
||||
<li>Hardware accelerated compression with VAAPI or NVENC</li>
|
||||
<li>Software compression with x264</li>
|
||||
</ul>
|
||||
</description>
|
||||
<developer id="io.github.wivrn.wivrn">
|
||||
<name>Guillaume Meunier, Patrick Nicolas et al</name>
|
||||
</developer>
|
||||
<branding>
|
||||
<color type="primary" scheme_preference="light">#F6F5F5</color>
|
||||
<color type="primary" scheme_preference="dark">#424242</color>
|
||||
</branding>
|
||||
|
||||
<launchable type="desktop-id">io.github.wivrn.wivrn.desktop</launchable>
|
||||
|
||||
<categories>
|
||||
<category>Game</category>
|
||||
<category>Network</category>
|
||||
</categories>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image type="source">https://wivrn.github.io/screenshots/dashboard-2-orig.png</image>
|
||||
<caption>Dashboard</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image type="source">https://wivrn.github.io/screenshots/dashboard-1-orig.png</image>
|
||||
<caption>Wizard</caption>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image type="source">https://wivrn.github.io/screenshots/dashboard-3-orig.png</image>
|
||||
<caption>Settings</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<url type="homepage">https://wivrn.github.io</url>
|
||||
<url type="vcs-browser">https://www.github.com/WiVRn/WiVRn</url>
|
||||
<url type="bugtracker">https://github.com/WiVRn/WiVRn/issues</url>
|
||||
<url type="donation">https://opencollective.com/wivrn</url>
|
||||
|
||||
<content_rating type="oars-1.1" />
|
||||
|
||||
<releases>
|
||||
<release version="0.22" date="2024-12-05">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.22</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Passthrough streaming support</li>
|
||||
<li>Fully encrypted connection</li>
|
||||
<li>Improved compositor pacing</li>
|
||||
<li>Add support for Quest 3S</li>
|
||||
<li>Add wivrnctl utility to control server</li>
|
||||
<li>Add Spanish translation for headset app</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.21" date="2024-11-03">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.21</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Fixed multiple dashboard issues</li>
|
||||
<li>Improved compositor pacing</li>
|
||||
<li>Changed default encoder configuration</li>
|
||||
<li>Inhibit sleeping while a session is active</li>
|
||||
<li>Avahi publication is now optional</li>
|
||||
<li>Always set the active runtime even if there was already one</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.20" date="2024-10-14">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.20</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Added server dashboard</li>
|
||||
<li>Added optional SolarXR support</li>
|
||||
<li>Network latency improvements</li>
|
||||
<li>More accurate frame pacing</li>
|
||||
<li>Smarter default configuration</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.19.1" date="2024-09-21">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.19.1</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Fix possible crash when requesting Android permissions on client</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.19" date="2024-09-19">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.19</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Added support for eye-tracked foveation</li>
|
||||
<li>Added support for FB_face_tracking2</li>
|
||||
<li>More fluid experience with improved frame and input pacing</li>
|
||||
<li>AV1 support with VAAPI</li>
|
||||
<li>Reduced aliasing with high foveation</li>
|
||||
<li>Improved server and client performance</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.18" date="2024-08-13">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.18</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>The standard APK is now compatible with Pico headsets</li>
|
||||
<li>Fixes for position on start and reconnect</li>
|
||||
<li>Support for EXT_eye_gaze_interaction by @galister</li>
|
||||
<li>Better support for libmonado, now discoverable in manifest</li>
|
||||
<li>Server can now be distributed as a flatpak</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
|
||||
<release version="0.17" date="2024-07-14">
|
||||
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v0.17</url>
|
||||
<description>
|
||||
<ul>
|
||||
<li>Add systemd hardening options by @Pandapip1</li>
|
||||
<li>update monado to 24.0.0 by @galister</li>
|
||||
<li>Update building doc by @SanyaNya</li>
|
||||
<li>Multiple tweaks for controller tracking, audio resync</li>
|
||||
<li>Minor performance improvements</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
</component>
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFile>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "main_window.h"
|
||||
#include "version.h"
|
||||
#include "wizard.h"
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
app.setApplicationName("wivrn-dashboard");
|
||||
app.setOrganizationName("wivrn");
|
||||
app.setApplicationVersion(wivrn::git_version);
|
||||
app.setDesktopFileName("io.github.wivrn.wivrn");
|
||||
|
||||
QTranslator translator;
|
||||
|
||||
QLocale locale = QLocale::system();
|
||||
if (translator.load(locale, "wivrn", "_", ":/i18n"))
|
||||
{
|
||||
qDebug() << "Adding translator for " << locale;
|
||||
app.installTranslator(&translator);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Cannot add translator for " << locale;
|
||||
}
|
||||
|
||||
app.setApplicationDisplayName(QObject::tr("WiVRn dashboard"));
|
||||
|
||||
std::unique_ptr<wizard> wizard_window;
|
||||
|
||||
// The main window is created before QWizard::finished so that the
|
||||
// server is started in the wizard
|
||||
auto main = std::make_unique<main_window>();
|
||||
|
||||
QSettings settings;
|
||||
if (settings.value("wizard/first_run", true).toBool())
|
||||
{
|
||||
wizard_window.reset(new wizard);
|
||||
wizard_window->show();
|
||||
|
||||
QObject::connect(wizard_window.get(), &QWizard::finished, [&](int value) {
|
||||
settings.setValue("wizard/first_run", false);
|
||||
|
||||
wizard_window.release()->deleteLater();
|
||||
main->show();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
main->show();
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -1,868 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "main_window.h"
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QCloseEvent>
|
||||
#include <QCoreApplication>
|
||||
#include <QDBusConnection>
|
||||
#include <QEvent>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
|
||||
#include "adb.h"
|
||||
#include "gui_config.h"
|
||||
#include "manage_headsets.h"
|
||||
#include "settings.h"
|
||||
#include "ui_main_window.h"
|
||||
#include "utils/flatpak.h"
|
||||
#include "utils/strings.h"
|
||||
#include "utils/xdg_base_directory.h"
|
||||
#include "wivrn_server.h"
|
||||
#include "wizard.h"
|
||||
|
||||
#if WIVRN_CHECK_CAPSYSNICE
|
||||
#include <sys/capability.h>
|
||||
#endif
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
#include <vulkan/vulkan_raii.hpp>
|
||||
|
||||
Q_LOGGING_CATEGORY(wivrn_log_category, "wivrn")
|
||||
|
||||
enum class server_state
|
||||
{
|
||||
stopped = 0,
|
||||
started = 1
|
||||
};
|
||||
|
||||
static QString server_path()
|
||||
{
|
||||
return QCoreApplication::applicationDirPath() + "/wivrn-server";
|
||||
}
|
||||
|
||||
#if WIVRN_CHECK_CAPSYSNICE
|
||||
static bool server_has_cap_sys_nice()
|
||||
{
|
||||
auto caps = cap_get_file(server_path().toStdString().c_str());
|
||||
|
||||
if (not caps)
|
||||
return false;
|
||||
|
||||
char * cap_text = cap_to_text(caps, nullptr);
|
||||
qDebug() << "Server capabilities:" << cap_text;
|
||||
cap_free(cap_text);
|
||||
|
||||
cap_flag_value_t value{};
|
||||
if (cap_get_flag(caps, CAP_SYS_NICE, CAP_EFFECTIVE, &value) < 0)
|
||||
return false;
|
||||
|
||||
cap_free(caps);
|
||||
|
||||
return value == CAP_SET;
|
||||
}
|
||||
#endif
|
||||
|
||||
std::vector<std::filesystem::path> layer_dirs()
|
||||
{
|
||||
// See https://vulkan.lunarg.com/doc/view/latest/linux/loader_and_layer_interface.html#user-content-linux-layer-discovery
|
||||
std::vector<std::filesystem::path> dirs;
|
||||
|
||||
dirs.push_back(xdg_config_home() / "vulkan/implicit_layer.d");
|
||||
|
||||
for (auto dir: xdg_config_dirs())
|
||||
dirs.push_back(dir / "vulkan/implicit_layer.d");
|
||||
|
||||
dirs.push_back("/etc/vulkan/implicit_layer.d");
|
||||
|
||||
dirs.push_back(xdg_data_home() / "vulkan/implicit_layer.d");
|
||||
|
||||
for (auto dir: xdg_data_dirs())
|
||||
dirs.push_back(dir / "vulkan/implicit_layer.d");
|
||||
|
||||
return dirs;
|
||||
}
|
||||
|
||||
static std::string read_file(const std::filesystem::path & path)
|
||||
{
|
||||
if (wivrn::flatpak_key(wivrn::flatpak::section::session_bus_policy, "org.freedesktop.Flatpak") == "talk")
|
||||
{
|
||||
QProcess flatpak_spawn;
|
||||
flatpak_spawn.start("flatpak-spawn", {"--host", "cat", QString::fromStdString(path)});
|
||||
flatpak_spawn.waitForFinished();
|
||||
return flatpak_spawn.readAllStandardOutput().toStdString();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ifstream f(path);
|
||||
std::istreambuf_iterator<char> begin{f}, end;
|
||||
|
||||
return {begin, end};
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<std::filesystem::path> list_files(const std::vector<std::filesystem::path> & dirs)
|
||||
{
|
||||
std::vector<std::filesystem::path> files;
|
||||
|
||||
if (wivrn::flatpak_key(wivrn::flatpak::section::session_bus_policy, "org.freedesktop.Flatpak") == "talk")
|
||||
{
|
||||
QProcess flatpak_spawn;
|
||||
QStringList args{"--host", "find"};
|
||||
for (const std::filesystem::path & dir: dirs)
|
||||
args.push_back(QString::fromStdString(dir));
|
||||
args.push_back("-name");
|
||||
args.push_back("*.json");
|
||||
|
||||
flatpak_spawn.start("flatpak-spawn", args);
|
||||
flatpak_spawn.waitForFinished();
|
||||
|
||||
qDebug() << args;
|
||||
|
||||
for (const std::string & file: utils::split(flatpak_spawn.readAllStandardOutput().toStdString()))
|
||||
{
|
||||
if (file != "")
|
||||
files.push_back(file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const std::filesystem::path & dir: dirs)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (auto const & dir_entry: std::filesystem::directory_iterator{dir})
|
||||
{
|
||||
if (dir_entry.path().extension() != ".json")
|
||||
continue;
|
||||
|
||||
files.push_back(dir / dir_entry.path());
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Ignore non existing directories
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
static bool nvidia_layer_missing()
|
||||
{
|
||||
vk::raii::Context context;
|
||||
|
||||
vk::ApplicationInfo app_info{"WiVRn dashboard", 1, "No engine", 1, VK_API_VERSION_1_0};
|
||||
vk::InstanceCreateInfo instance_info{vk::InstanceCreateFlags{0}, &app_info};
|
||||
vk::raii::Instance vulkan{context, instance_info};
|
||||
|
||||
// Check if an nvidia GPU is present
|
||||
if (not std::ranges::any_of(vulkan.enumeratePhysicalDevices(), [](vk::raii::PhysicalDevice & device) { return device.getProperties().vendorID == 0x10de; }))
|
||||
return false;
|
||||
|
||||
// Check if the monado vulkan layer is present
|
||||
for (auto file: list_files(layer_dirs()))
|
||||
{
|
||||
try
|
||||
{
|
||||
nlohmann::json json = nlohmann::json::parse(read_file(file));
|
||||
if (json["layer"]["name"] == "VK_LAYER_MND_enable_timeline_semaphore")
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
main_window::main_window()
|
||||
{
|
||||
ui = new Ui::MainWindow;
|
||||
ui->setupUi(this);
|
||||
|
||||
if (QSystemTrayIcon::isSystemTrayAvailable())
|
||||
{
|
||||
action_show.setIcon(QIcon::fromTheme("settings-configure"));
|
||||
action_hide.setIcon(QIcon::fromTheme("settings-configure"));
|
||||
action_exit.setIcon(QIcon::fromTheme("application-exit"));
|
||||
|
||||
systray_menu.addAction(&action_show);
|
||||
systray_menu.addAction(&action_hide);
|
||||
systray_menu.addAction(&action_exit);
|
||||
|
||||
systray.setToolTip("WiVRn");
|
||||
systray.setContextMenu(&systray_menu);
|
||||
systray.show();
|
||||
|
||||
connect(&action_show, &QAction::triggered, this, &QMainWindow::show);
|
||||
connect(&action_hide, &QAction::triggered, this, &QMainWindow::hide);
|
||||
connect(&action_exit, &QAction::triggered, this, [&]() { QApplication::quit(); });
|
||||
|
||||
connect(&systray, &QSystemTrayIcon::activated, this, [&](QSystemTrayIcon::ActivationReason reason) {
|
||||
switch (reason)
|
||||
{
|
||||
case QSystemTrayIcon::ActivationReason::Trigger:
|
||||
setVisible(!isVisible());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
server_process_timeout = new QTimer;
|
||||
server_process_timeout->setInterval(std::chrono::seconds(1));
|
||||
server_process_timeout->setSingleShot(true);
|
||||
connect(server_process_timeout, &QTimer::timeout, this, &main_window::on_server_start_timeout);
|
||||
|
||||
server_interface = new wivrn_server(this);
|
||||
|
||||
connect(server_interface, &wivrn_server::serverRunningChanged, this, &main_window::on_server_running_changed);
|
||||
connect(server_interface, &wivrn_server::headsetConnectedChanged, this, &main_window::on_headset_connected_changed);
|
||||
|
||||
on_server_running_changed(server_interface->isServerRunning());
|
||||
if (not server_interface->isServerRunning())
|
||||
start_server();
|
||||
|
||||
connect(server_interface, &wivrn_server::recommendedEyeSizeChanged, this, &main_window::on_recommended_eye_size_changed);
|
||||
connect(server_interface, &wivrn_server::availableRefreshRatesChanged, this, &main_window::on_available_refresh_rates_changed);
|
||||
connect(server_interface, &wivrn_server::preferredRefreshRateChanged, this, &main_window::on_preferred_refresh_rate_changed);
|
||||
connect(server_interface, &wivrn_server::eyeGazeChanged, this, &main_window::on_eye_gaze_changed);
|
||||
connect(server_interface, &wivrn_server::faceTrackingChanged, this, &main_window::on_face_tracking_changed);
|
||||
connect(server_interface, &wivrn_server::fieldOfViewChanged, this, &main_window::on_field_of_view_changed);
|
||||
connect(server_interface, &wivrn_server::handTrackingChanged, this, &main_window::on_hand_tracking_changed);
|
||||
connect(server_interface, &wivrn_server::micChannelsChanged, this, &main_window::on_mic_changed);
|
||||
connect(server_interface, &wivrn_server::micSampleRateChanged, this, &main_window::on_mic_changed);
|
||||
connect(server_interface, &wivrn_server::speakerChannelsChanged, this, &main_window::on_speaker_changed);
|
||||
connect(server_interface, &wivrn_server::speakerSampleRateChanged, this, &main_window::on_speaker_changed);
|
||||
connect(server_interface, &wivrn_server::supportedCodecsChanged, this, &main_window::on_supported_codecs_changed);
|
||||
connect(server_interface, &wivrn_server::steamCommandChanged, this, &main_window::on_steam_command_changed);
|
||||
|
||||
connect(server_interface, &wivrn_server::encryptionEnabledChanged, ui->widget_authentication, &QWidget::setVisible);
|
||||
connect(server_interface, &wivrn_server::pinChanged, this, &main_window::on_pin_changed);
|
||||
on_pin_changed(server_interface->pin());
|
||||
|
||||
connect(server_interface, &wivrn_server::pairingEnabledChanged, ui->button_cancel_pairing, &QWidget::setVisible);
|
||||
connect(server_interface, &wivrn_server::pairingEnabledChanged, ui->button_pair_headset, &QWidget::setHidden);
|
||||
connect(ui->button_cancel_pairing, &QPushButton::clicked, server_interface, &wivrn_server::disable_pairing);
|
||||
connect(ui->button_pair_headset, &QPushButton::clicked, server_interface, &wivrn_server::enable_pairing);
|
||||
connect(ui->button_manage_headsets, &QPushButton::clicked, this, &main_window::on_action_manage_headsets);
|
||||
|
||||
connect(ui->button_start, &QPushButton::clicked, this, &main_window::start_server);
|
||||
connect(ui->button_stop, &QPushButton::clicked, this, &main_window::stop_server);
|
||||
connect(ui->button_settings, &QPushButton::clicked, this, &main_window::on_action_settings);
|
||||
connect(ui->button_disconnect, &QPushButton::clicked, this, &main_window::disconnect_client);
|
||||
connect(ui->button_wizard, &QPushButton::clicked, this, &main_window::on_action_wizard);
|
||||
connect(ui->button_details, &QPushButton::toggled, this, &main_window::on_button_details_toggled);
|
||||
|
||||
connect(ui->button_about, &QPushButton::clicked, this, []() { QApplication::aboutQt(); });
|
||||
connect(ui->button_exit, &QPushButton::clicked, this, []() { QApplication::quit(); });
|
||||
|
||||
connect(ui->copy_steam_command, &QPushButton::clicked, this, [&]() {
|
||||
QGuiApplication::clipboard()->setText(ui->label_steam_command->text());
|
||||
});
|
||||
|
||||
usb_device_menu = new QMenu(this);
|
||||
ui->button_usb->setMenu(usb_device_menu);
|
||||
connect(&adb_service, &adb::android_devices_changed, this, &main_window::on_android_device_list_changed);
|
||||
on_android_device_list_changed(adb_service.devices());
|
||||
|
||||
#if WIVRN_CHECK_CAPSYSNICE
|
||||
ui->banner_capsysnice_icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(ui->banner_capsysnice_dismiss->height()));
|
||||
connect(ui->banner_capsysnice_text, &QLabel::linkActivated, this, &main_window::on_banner_capsysnice);
|
||||
|
||||
if (server_has_cap_sys_nice())
|
||||
ui->banner_capsysnice->hide();
|
||||
#else
|
||||
ui->banner_capsysnice->hide();
|
||||
#endif
|
||||
|
||||
ui->banner_nvidia_layer_icon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(ui->banner_nvidia_layer_dismiss->height()));
|
||||
if (not nvidia_layer_missing())
|
||||
ui->banner_nvidia_layer->hide();
|
||||
|
||||
retranslate();
|
||||
}
|
||||
|
||||
main_window::~main_window()
|
||||
{
|
||||
delete server_process_timeout;
|
||||
server_process_timeout = nullptr;
|
||||
|
||||
if (server_process)
|
||||
{
|
||||
// Disconnect signals to avoid receiving signals about the server crashing
|
||||
disconnect(server_process, &QProcess::finished, this, &main_window::on_server_finished);
|
||||
disconnect(server_process, &QProcess::errorOccurred, this, &main_window::on_server_error_occurred);
|
||||
server_process->terminate();
|
||||
server_process->waitForFinished();
|
||||
delete server_process;
|
||||
server_process = nullptr;
|
||||
}
|
||||
|
||||
delete ui;
|
||||
ui = nullptr;
|
||||
}
|
||||
|
||||
void main_window::changeEvent(QEvent * e)
|
||||
{
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
switch (e->type())
|
||||
{
|
||||
case QEvent::LanguageChange:
|
||||
retranslate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::retranslate()
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
ui->label_how_to_connect->setText(tr("Start the WiVRn app on your headset and connect to \"%1\".").arg(server_interface->hostname()) + "\n\n" + tr("If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall."));
|
||||
|
||||
action_show.setText(tr("&Show GUI"));
|
||||
action_hide.setText(tr("&Hide GUI"));
|
||||
action_exit.setText(tr("&Exit"));
|
||||
|
||||
if (server_interface->isHeadsetConnected())
|
||||
{
|
||||
on_headset_connected_changed(true);
|
||||
|
||||
on_recommended_eye_size_changed(server_interface->recommendedEyeSize());
|
||||
on_available_refresh_rates_changed(server_interface->availableRefreshRates());
|
||||
on_preferred_refresh_rate_changed(server_interface->preferredRefreshRate());
|
||||
on_eye_gaze_changed(server_interface->eyeGaze());
|
||||
on_face_tracking_changed(server_interface->faceTracking());
|
||||
on_field_of_view_changed(server_interface->fieldOfView());
|
||||
on_hand_tracking_changed(server_interface->handTracking());
|
||||
on_mic_changed();
|
||||
on_speaker_changed();
|
||||
on_supported_codecs_changed(server_interface->supportedCodecs());
|
||||
on_steam_command_changed(server_interface->steamCommand());
|
||||
}
|
||||
else
|
||||
{
|
||||
on_headset_connected_changed(false);
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::closeEvent(QCloseEvent * event)
|
||||
{
|
||||
QMainWindow::closeEvent(event);
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
void main_window::setVisible(bool visible)
|
||||
{
|
||||
if (visible)
|
||||
{
|
||||
action_show.setVisible(false);
|
||||
action_hide.setVisible(true);
|
||||
adb_service.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
action_show.setVisible(true);
|
||||
action_hide.setVisible(false);
|
||||
adb_service.stop();
|
||||
}
|
||||
|
||||
QMainWindow::setVisible(visible);
|
||||
}
|
||||
|
||||
void main_window::on_android_device_list_changed(const std::vector<adb::device> & devices)
|
||||
{
|
||||
ui->button_usb->setDisabled(devices.empty());
|
||||
|
||||
if (devices.empty())
|
||||
ui->button_usb->setToolTip(tr("No device detected"));
|
||||
else
|
||||
ui->button_usb->setToolTip("");
|
||||
|
||||
std::vector<std::string> to_be_removed;
|
||||
for (auto & [serial, action]: usb_actions)
|
||||
{
|
||||
if (std::ranges::none_of(devices, [&](const adb::device & x) { return x.serial() == serial; }))
|
||||
{
|
||||
qDebug() << "Removed" << QString::fromStdString(serial);
|
||||
|
||||
usb_device_menu->removeAction(action.get());
|
||||
to_be_removed.push_back(serial);
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto & serial: to_be_removed)
|
||||
{
|
||||
usb_actions.erase(serial);
|
||||
}
|
||||
|
||||
for (auto & device: devices)
|
||||
{
|
||||
if (std::ranges::none_of(usb_actions, [&](const std::pair<const std::string, std::unique_ptr<QAction>> & x) { return x.first == device.serial(); }))
|
||||
{
|
||||
qDebug() << "Detected" << QString::fromStdString(device.serial());
|
||||
for (auto & [key, value]: device.properties())
|
||||
{
|
||||
qDebug() << " " << QString::fromStdString(key) << ":" << QString::fromStdString(value);
|
||||
}
|
||||
|
||||
std::unique_ptr<QAction> device_action = std::make_unique<QAction>(this);
|
||||
|
||||
if (auto model = device.properties().find("model"); model != device.properties().end())
|
||||
device_action->setText(QString::fromStdString(model->second));
|
||||
else
|
||||
device_action->setText("Unknown model");
|
||||
|
||||
usb_device_menu->addAction(device_action.get());
|
||||
|
||||
device_action->setData(QString::fromStdString(device.serial()));
|
||||
connect(device_action.get(), &QAction::triggered, this, [this, serial = device.serial()]() {
|
||||
on_action_usb(serial);
|
||||
});
|
||||
|
||||
usb_actions.insert(std::make_pair(device.serial(), std::move(device_action)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::on_banner_capsysnice(const QString & link)
|
||||
{
|
||||
#if WIVRN_CHECK_CAPSYSNICE
|
||||
if (link == "setcap" and not setcap_process)
|
||||
{
|
||||
setcap_process = new QProcess(this);
|
||||
setcap_process->setProgram("pkexec");
|
||||
setcap_process->setArguments({"setcap", "CAP_SYS_NICE=+ep", server_path()});
|
||||
setcap_process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
setcap_process->start();
|
||||
|
||||
connect(setcap_process, &QProcess::finished, this, [this](int exit_code, QProcess::ExitStatus exit_status) {
|
||||
// Exit codes:
|
||||
// 0: setcap successful
|
||||
// 1: setcap failed
|
||||
// 126: pkexec: not authorized or authentication error
|
||||
// 127: pkexec: dismissed by user
|
||||
qDebug() << "pkexec setcap exited with code" << exit_code << "and status" << exit_status;
|
||||
|
||||
qDebug() << "--------";
|
||||
for (auto line: setcap_process->readAllStandardOutput().split('\n'))
|
||||
{
|
||||
QDebug dbg = qDebug();
|
||||
dbg.noquote();
|
||||
dbg << " " << QString::fromStdString(line.toStdString());
|
||||
}
|
||||
qDebug() << "--------";
|
||||
|
||||
if (exit_status == QProcess::NormalExit)
|
||||
{
|
||||
if (exit_code == 0)
|
||||
{
|
||||
if (not server_has_cap_sys_nice())
|
||||
{
|
||||
qDebug() << "pkexec setcap returned successfully but the server does not have the CAP_SYS_NICE capability";
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->banner_capsysnice->hide();
|
||||
|
||||
// Don't restart if it wasn't already started
|
||||
if (server_interface)
|
||||
{
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Information);
|
||||
msgbox.setText(tr("You have to restart the WiVRn server to use the CAP_SYS_NICE capability.\nDo you want to restart it now?"));
|
||||
|
||||
if (server_interface->isHeadsetConnected())
|
||||
{
|
||||
msgbox.setText(msgbox.text() + "\n\n" + tr("This will disconnect the currently connected headset."));
|
||||
}
|
||||
|
||||
auto restart_button = msgbox.addButton(tr("Restart WiVRn"), QMessageBox::YesRole);
|
||||
auto close_button = msgbox.addButton(QMessageBox::Close);
|
||||
|
||||
msgbox.exec();
|
||||
|
||||
if (msgbox.clickedButton() == restart_button)
|
||||
{
|
||||
server_process_restart = true;
|
||||
stop_server();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("Cannot start setcap: %1").arg(exit_status));
|
||||
|
||||
auto close_button = msgbox.addButton(QMessageBox::Close);
|
||||
|
||||
msgbox.exec();
|
||||
}
|
||||
|
||||
setcap_process->deleteLater();
|
||||
setcap_process = nullptr;
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void main_window::on_server_running_changed(bool running)
|
||||
{
|
||||
if (running)
|
||||
{
|
||||
qDebug() << "Server started";
|
||||
server_process_timeout->stop();
|
||||
|
||||
ui->stacked_widget_server->setCurrentIndex((int)server_state::started);
|
||||
ui->group_client->setEnabled(true);
|
||||
|
||||
ui->button_stop->setEnabled(true);
|
||||
ui->button_settings->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Server stopped";
|
||||
ui->stacked_widget_server->setCurrentIndex((int)server_state::stopped);
|
||||
ui->group_client->setEnabled(false);
|
||||
|
||||
ui->button_start->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::on_headset_connected_changed(bool connected)
|
||||
{
|
||||
if (connected)
|
||||
{
|
||||
qDebug() << "Headset connected";
|
||||
ui->label_client_status->setText(tr("Connected"));
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Headset disconnected";
|
||||
ui->label_client_status->setText(tr("Not connected"));
|
||||
}
|
||||
|
||||
ui->button_disconnect->setVisible(connected);
|
||||
ui->button_wizard->setHidden(connected);
|
||||
ui->button_details->setVisible(connected);
|
||||
ui->button_usb->setHidden(connected);
|
||||
ui->headset_properties->setVisible(connected and ui->button_details->isChecked());
|
||||
|
||||
ui->label_how_to_connect->setHidden(connected);
|
||||
}
|
||||
|
||||
void main_window::on_button_details_toggled(bool checked)
|
||||
{
|
||||
ui->headset_properties->setVisible(server_interface->isHeadsetConnected() and checked);
|
||||
}
|
||||
|
||||
void main_window::on_recommended_eye_size_changed(QSize size)
|
||||
{
|
||||
ui->label_eye_size->setText(tr("%1 \u2a2f %2").arg(size.width()).arg(size.height()));
|
||||
}
|
||||
|
||||
void main_window::on_available_refresh_rates_changed(const std::vector<float> & rates)
|
||||
{
|
||||
QStringList rates_str;
|
||||
for (float size: rates)
|
||||
rates_str.push_back(tr("%1 Hz").arg(size));
|
||||
|
||||
ui->label_refresh_rates->setText(rates_str.join(", "));
|
||||
}
|
||||
|
||||
void main_window::on_preferred_refresh_rate_changed(float rate)
|
||||
{
|
||||
ui->label_prefered_refresh_rate->setText(tr("%1 Hz").arg(std::round(rate)));
|
||||
}
|
||||
|
||||
void main_window::on_eye_gaze_changed(bool supported)
|
||||
{
|
||||
ui->label_eye_gaze_tracking->setText(supported ? tr("Supported") : tr("Not supported"));
|
||||
}
|
||||
|
||||
void main_window::on_face_tracking_changed(bool supported)
|
||||
{
|
||||
ui->label_face_tracking->setText(supported ? tr("Supported") : tr("Not supported"));
|
||||
}
|
||||
|
||||
void main_window::on_field_of_view_changed(const std::vector<field_of_view> & fovs)
|
||||
{
|
||||
if (fovs.size() >= 2)
|
||||
{
|
||||
ui->label_field_of_view->setText(tr("Left eye: %1° \u2a2f %2°, right eye: %3° \u2a2f %4°")
|
||||
.arg((fovs[0].angleRight - fovs[0].angleLeft) * 180 / M_PI, 0, 'f', 1)
|
||||
.arg((fovs[0].angleUp - fovs[0].angleDown) * 180 / M_PI, 0, 'f', 1)
|
||||
.arg((fovs[1].angleRight - fovs[1].angleLeft) * 180 / M_PI, 0, 'f', 1)
|
||||
.arg((fovs[1].angleUp - fovs[1].angleDown) * 180 / M_PI, 0, 'f', 1));
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::on_hand_tracking_changed(bool supported)
|
||||
{
|
||||
ui->label_hand_tracking->setText(supported ? tr("Supported") : tr("Not supported"));
|
||||
}
|
||||
|
||||
void main_window::on_mic_changed()
|
||||
{
|
||||
auto channels = server_interface->micChannels();
|
||||
auto sample_rate = server_interface->micSampleRate();
|
||||
|
||||
if (channels and sample_rate)
|
||||
ui->label_mic->setText(tr("%n channel(s), %1 Hz", nullptr, channels).arg(sample_rate));
|
||||
else
|
||||
ui->label_mic->setText(tr("N/A"));
|
||||
}
|
||||
|
||||
void main_window::on_speaker_changed()
|
||||
{
|
||||
auto channels = server_interface->speakerChannels();
|
||||
auto sample_rate = server_interface->speakerSampleRate();
|
||||
|
||||
if (channels and sample_rate)
|
||||
ui->label_speaker->setText(tr("%n channel(s), %1 Hz", nullptr, channels).arg(sample_rate));
|
||||
else
|
||||
ui->label_speaker->setText(tr("N/A"));
|
||||
}
|
||||
|
||||
void main_window::on_supported_codecs_changed(QStringList value)
|
||||
{
|
||||
ui->label_codecs->setText(value.join(", "));
|
||||
}
|
||||
|
||||
void main_window::on_steam_command_changed(QString value)
|
||||
{
|
||||
ui->label_steam_command->setText(value);
|
||||
}
|
||||
|
||||
void main_window::on_pin_changed(QString value)
|
||||
{
|
||||
if (value == "")
|
||||
ui->label_pin->setText("");
|
||||
else
|
||||
ui->label_pin->setText(tr("To pair your headset use the following PIN: %1").arg(value));
|
||||
}
|
||||
|
||||
void main_window::on_server_finished(int exit_code, QProcess::ExitStatus status)
|
||||
{
|
||||
qDebug() << "Server exited with code" << exit_code << ", status" << status;
|
||||
server_process_timeout->stop();
|
||||
|
||||
disconnect(server_process, &QProcess::finished, this, &main_window::on_server_finished);
|
||||
disconnect(server_process, &QProcess::errorOccurred, this, &main_window::on_server_error_occurred);
|
||||
server_process->deleteLater();
|
||||
server_process = nullptr;
|
||||
|
||||
if (exit_code != 0)
|
||||
{
|
||||
QString error_message = tr("Unknown error (%1), check logs").arg(exit_code);
|
||||
switch (exit_code)
|
||||
{
|
||||
case EXIT_SUCCESS:
|
||||
case EXIT_FAILURE:
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
error_message = tr("Insufficient system resources");
|
||||
break;
|
||||
case 4:
|
||||
error_message = tr("Cannot connect to avahi, make sure avahi-daemon service is started with \"disable-user-service-publishing\" set to no");
|
||||
break;
|
||||
}
|
||||
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("Server crashed:\n%1").arg(error_message));
|
||||
msgbox.setStandardButtons(QMessageBox::Close);
|
||||
msgbox.exec();
|
||||
}
|
||||
|
||||
if (server_process_restart)
|
||||
{
|
||||
server_process_restart = false;
|
||||
start_server();
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::on_server_error_occurred(QProcess::ProcessError error)
|
||||
{
|
||||
qDebug() << "on_server_error_occurred" << error;
|
||||
server_process_timeout->stop();
|
||||
|
||||
QString error_message;
|
||||
switch (error)
|
||||
{
|
||||
case QProcess::ProcessError::FailedToStart:
|
||||
error_message = tr("Failed to start");
|
||||
break;
|
||||
case QProcess::ProcessError::Crashed:
|
||||
error_message = tr("Crashed");
|
||||
break;
|
||||
case QProcess::ProcessError::Timedout:
|
||||
error_message = tr("Time out");
|
||||
break;
|
||||
case QProcess::ProcessError::ReadError:
|
||||
error_message = tr("Read error");
|
||||
break;
|
||||
case QProcess::ProcessError::WriteError:
|
||||
error_message = tr("Write error");
|
||||
break;
|
||||
case QProcess::ProcessError::UnknownError:
|
||||
error_message = tr("Unknown error");
|
||||
break;
|
||||
}
|
||||
|
||||
QMessageBox msgbox /*(this)*/;
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("Failed to start server:\n%1").arg(error_message));
|
||||
msgbox.setStandardButtons(QMessageBox::Close);
|
||||
msgbox.exec();
|
||||
}
|
||||
|
||||
void main_window::on_server_start_timeout()
|
||||
{
|
||||
qDebug() << "on_server_start_timeout";
|
||||
|
||||
if (server_process)
|
||||
{
|
||||
// Disconnect signals to avoid receiving signals about the server crashing
|
||||
disconnect(server_process, &QProcess::finished, this, &main_window::on_server_finished);
|
||||
disconnect(server_process, &QProcess::errorOccurred, this, &main_window::on_server_error_occurred);
|
||||
server_process->terminate();
|
||||
server_process->deleteLater();
|
||||
server_process = nullptr;
|
||||
}
|
||||
|
||||
QMessageBox msgbox /*(this)*/;
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("Timeout starting server"));
|
||||
msgbox.setStandardButtons(QMessageBox::Close);
|
||||
|
||||
msgbox.exec();
|
||||
}
|
||||
|
||||
void main_window::on_action_settings()
|
||||
{
|
||||
settings{server_interface}.exec();
|
||||
}
|
||||
|
||||
void main_window::on_action_wizard()
|
||||
{
|
||||
wizard{}.exec();
|
||||
}
|
||||
|
||||
void main_window::on_action_manage_headsets()
|
||||
{
|
||||
manage_headsets{server_interface}.exec();
|
||||
}
|
||||
|
||||
void main_window::on_action_usb(const std::string & serial)
|
||||
{
|
||||
auto devs = adb_service.devices();
|
||||
|
||||
if (devs.empty())
|
||||
return;
|
||||
|
||||
adb::device dev;
|
||||
for (auto & i: adb_service.devices())
|
||||
{
|
||||
if (i.serial() == serial)
|
||||
{
|
||||
dev = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
// TODO: in another thread
|
||||
// TODO: check if adb works
|
||||
bool ok = false;
|
||||
for (auto & app: dev.installed_apps())
|
||||
{
|
||||
if (app.starts_with("org.meumeu.wivrn.") or app == "org.meumeu.wivrn")
|
||||
{
|
||||
dev.reverse_forward(9757, 9757);
|
||||
dev.start(app, "android.intent.action.VIEW", "wivrn+tcp://127.0.0.1:9757");
|
||||
ok = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (not ok)
|
||||
{
|
||||
QMessageBox msgbox /*(this)*/;
|
||||
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("The WiVRn app is not installed on your headset."));
|
||||
msgbox.setStandardButtons(QMessageBox::Close);
|
||||
msgbox.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::start_server()
|
||||
{
|
||||
qDebug() << "Starting server";
|
||||
|
||||
// TODO activate by dbus?
|
||||
server_process = new QProcess;
|
||||
connect(server_process, &QProcess::finished, this, &main_window::on_server_finished);
|
||||
connect(server_process, &QProcess::errorOccurred, this, &main_window::on_server_error_occurred);
|
||||
|
||||
server_process->setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
|
||||
server_process->start(server_path(), QApplication::arguments().mid(1));
|
||||
server_process_timeout->start();
|
||||
|
||||
ui->button_start->setEnabled(false);
|
||||
}
|
||||
|
||||
void main_window::stop_server()
|
||||
{
|
||||
qDebug() << "Stopping server";
|
||||
|
||||
if (server_interface)
|
||||
server_interface->quit() /*.waitForFinished()*/;
|
||||
// server_process.terminate(); // TODO timer and kill
|
||||
ui->button_stop->setEnabled(false);
|
||||
}
|
||||
|
||||
void main_window::disconnect_client()
|
||||
{
|
||||
qDebug() << "Disconnecting client";
|
||||
|
||||
if (server_interface)
|
||||
server_interface->disconnect_headset();
|
||||
}
|
||||
|
||||
#include "moc_main_window.cpp"
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QProcess>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QVariantMap>
|
||||
|
||||
#include "adb.h"
|
||||
#include "wivrn_qdbus_types.h"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(wivrn_log_category)
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
class IoGithubWivrnServerInterface;
|
||||
class OrgFreedesktopDBusPropertiesInterface;
|
||||
|
||||
class settings;
|
||||
class wivrn_server;
|
||||
class wizard;
|
||||
|
||||
class main_window : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Ui::MainWindow * ui = nullptr;
|
||||
wivrn_server * server_interface = nullptr;
|
||||
|
||||
QIcon icon{":/images/wivrn.png"};
|
||||
QSystemTrayIcon systray{icon};
|
||||
|
||||
QMenu systray_menu;
|
||||
QAction action_show;
|
||||
QAction action_hide;
|
||||
QAction action_exit;
|
||||
|
||||
QProcess * server_process = nullptr;
|
||||
QTimer * server_process_timeout = nullptr;
|
||||
bool server_process_restart = false;
|
||||
|
||||
QMenu * usb_device_menu;
|
||||
std::map<std::string, std::unique_ptr<QAction>> usb_actions;
|
||||
|
||||
adb adb_service;
|
||||
|
||||
QProcess * setcap_process = nullptr;
|
||||
|
||||
public:
|
||||
main_window();
|
||||
~main_window();
|
||||
|
||||
void changeEvent(QEvent * e) override;
|
||||
void closeEvent(QCloseEvent * event) override;
|
||||
void setVisible(bool visible) override;
|
||||
|
||||
private:
|
||||
void on_server_finished(int exit_code, QProcess::ExitStatus status);
|
||||
void on_server_error_occurred(QProcess::ProcessError error);
|
||||
void on_server_start_timeout();
|
||||
|
||||
void on_button_details_toggled(bool);
|
||||
void on_banner_capsysnice(const QString & link);
|
||||
|
||||
void on_server_running_changed(bool running);
|
||||
void on_headset_connected_changed(bool connected);
|
||||
void on_recommended_eye_size_changed(QSize size);
|
||||
void on_available_refresh_rates_changed(const std::vector<float> & rates);
|
||||
void on_preferred_refresh_rate_changed(float rate);
|
||||
void on_eye_gaze_changed(bool supported);
|
||||
void on_face_tracking_changed(bool supported);
|
||||
void on_field_of_view_changed(const std::vector<field_of_view> & fov);
|
||||
void on_hand_tracking_changed(bool supported);
|
||||
void on_mic_changed();
|
||||
void on_speaker_changed();
|
||||
void on_supported_codecs_changed(QStringList value);
|
||||
void on_steam_command_changed(QString value);
|
||||
void on_pin_changed(QString value);
|
||||
|
||||
void on_android_device_list_changed(const std::vector<adb::device> &);
|
||||
|
||||
void on_action_settings();
|
||||
void on_action_wizard();
|
||||
void on_action_manage_headsets();
|
||||
void on_action_usb(const std::string & serial);
|
||||
void start_server();
|
||||
void stop_server();
|
||||
void disconnect_client();
|
||||
|
||||
void retranslate();
|
||||
};
|
||||
@@ -1,685 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>895</width>
|
||||
<height>842</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WiVRn dashboard</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>:/images/wivrn.svg</normaloff>:/images/wivrn.svg</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="banner_capsysnice">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">.QFrame
|
||||
{
|
||||
background-color: rgb(255, 170, 127);
|
||||
border: 1px solid rgb(255, 127, 127);
|
||||
border-radius: 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::Box</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="banner_capsysnice_icon">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="banner_capsysnice_text">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>The server does not have CAP_SYS_NICE capabilities. Click <a href="setcap"><span style=" text-decoration: underline; color:#2980b9;">here</span></a> to grant it.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="banner_capsysnice_dismiss">
|
||||
<property name="icon">
|
||||
<iconset theme="window-close"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="banner_nvidia_layer">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">.QFrame
|
||||
{
|
||||
background-color: rgb(255, 170, 127);
|
||||
border: 1px solid rgb(255, 127, 127);
|
||||
border-radius: 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::Box</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_10" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="banner_nvidia_layer_icon">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="banner_nvidia_layer_text">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>The <a href="https://github.com/WiVRn/WiVRn/issues/180"><span style=" text-decoration: underline; color:#2980b9;">Monado NVIDIA layer</span></a> is not installed.</p></body></html></string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="banner_nvidia_layer_dismiss">
|
||||
<property name="icon">
|
||||
<iconset theme="window-close"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="group_server">
|
||||
<property name="title">
|
||||
<string>Server status</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stacked_widget_server">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="server_stopped">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>:/images/wivrn.svg</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stopped</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_start">
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="media-playback-start"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="server_running">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>:/images/wivrn.svg</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="1,0,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Running</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_settings">
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="preferences-system-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_stop">
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="media-playback-stop-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_authentication"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>For Steam games, set the launch options to:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::PlainText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextInteractionFlag::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="copy_steam_command">
|
||||
<property name="toolTip">
|
||||
<string>Copy to clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="edit-copy-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_steam_command">
|
||||
<property name="cursor">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextInteractionFlag::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="group_client">
|
||||
<property name="title">
|
||||
<string>Headset status</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,0,0,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_client_status">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">client_status</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_usb">
|
||||
<property name="text">
|
||||
<string>Connect by USB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_wizard">
|
||||
<property name="text">
|
||||
<string>Wizard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_disconnect">
|
||||
<property name="text">
|
||||
<string>Disconnect</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="network-disconnect-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_details">
|
||||
<property name="text">
|
||||
<string>Details</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_authentication" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8" stretch="1,0,0,0">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pin">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">label_pin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_pair_headset">
|
||||
<property name="text">
|
||||
<string>Pair headset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_cancel_pairing">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_manage_headsets">
|
||||
<property name="text">
|
||||
<string>Manage headsets</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_how_to_connect">
|
||||
<property name="text">
|
||||
<string notr="true">connect_to_this_server</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="headset_properties" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Eye gaze tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Eye resolution</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Speaker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Field of view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_refresh_rates">
|
||||
<property name="text">
|
||||
<string notr="true">refresh_rates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_eye_size">
|
||||
<property name="text">
|
||||
<string notr="true">eye_size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Microphone</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Available refresh rates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Supported codecs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Hand tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Preferred refresh rate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Face tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_prefered_refresh_rate">
|
||||
<property name="text">
|
||||
<string notr="true">preferrred_refresh_rate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_speaker">
|
||||
<property name="text">
|
||||
<string notr="true">speaker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_mic">
|
||||
<property name="text">
|
||||
<string notr="true">mic</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_field_of_view">
|
||||
<property name="text">
|
||||
<string notr="true">field_of_view</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_hand_tracking">
|
||||
<property name="text">
|
||||
<string notr="true">hand_tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label_eye_gaze_tracking">
|
||||
<property name="text">
|
||||
<string notr="true">eye_gaze_tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="label_face_tracking">
|
||||
<property name="text">
|
||||
<string notr="true">face_tracking</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_codecs">
|
||||
<property name="text">
|
||||
<string notr="true">codecs</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>104</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_about">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="help-about-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_exit">
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<action name="action_systray_show">
|
||||
<property name="icon">
|
||||
<iconset theme="settings-configure-symbolic"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Show</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_systray_hide">
|
||||
<property name="icon">
|
||||
<iconset theme="preferences-system-symbolic"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Hide</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_systray_exit">
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit-symbolic"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Exit</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../wivrn-dashboard.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>banner_capsysnice_dismiss</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>banner_capsysnice</receiver>
|
||||
<slot>hide()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>881</x>
|
||||
<y>44</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>805</x>
|
||||
<y>51</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>banner_nvidia_layer_dismiss</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>banner_nvidia_layer</receiver>
|
||||
<slot>hide()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>869</x>
|
||||
<y>82</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>852</x>
|
||||
<y>102</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "manage_headsets.h"
|
||||
#include "ui_manage_headsets.h"
|
||||
#include "wivrn_server.h"
|
||||
#include <QStandardItemModel>
|
||||
#include <algorithm>
|
||||
|
||||
manage_headsets::manage_headsets(wivrn_server * server_interface) :
|
||||
server_interface(server_interface)
|
||||
{
|
||||
ui = new Ui::ManageHeadsets;
|
||||
ui->setupUi(this);
|
||||
ui->headset_list->setModel(new QStandardItemModel);
|
||||
|
||||
connect(server_interface, &wivrn_server::knownKeysChanged, this, &manage_headsets::update_headet_list);
|
||||
connect(ui->headset_list->selectionModel(), &QItemSelectionModel::selectionChanged, this, &manage_headsets::on_selection_changed);
|
||||
connect(ui->button_remove, &QPushButton::clicked, this, &manage_headsets::on_remove_selected);
|
||||
|
||||
QStandardItemModel * headsets = dynamic_cast<QStandardItemModel *>(ui->headset_list->model());
|
||||
connect(headsets, &QStandardItemModel::itemChanged, this, &manage_headsets::on_rename_selected);
|
||||
|
||||
update_headet_list(server_interface->knownKeys());
|
||||
}
|
||||
|
||||
void manage_headsets::update_headet_list(const std::vector<wivrn_server::HeadsetKey> & new_headsets)
|
||||
{
|
||||
QStandardItemModel * current_headsets = dynamic_cast<QStandardItemModel *>(ui->headset_list->model());
|
||||
assert(current_headsets);
|
||||
|
||||
for (int i = 0; i < current_headsets->rowCount();)
|
||||
{
|
||||
QString key = current_headsets->item(i)->data().toString();
|
||||
if (not std::ranges::any_of(new_headsets, [&](const wivrn_server::HeadsetKey & x) { return x.public_key == key; }))
|
||||
current_headsets->removeRow(i);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
|
||||
for (const wivrn_server::HeadsetKey & key: new_headsets)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < current_headsets->rowCount(); i++)
|
||||
{
|
||||
if (current_headsets->item(i)->data().toString() == key.public_key)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (not found)
|
||||
{
|
||||
QStandardItem * item = new QStandardItem;
|
||||
item->setText(key.name);
|
||||
item->setData(key.public_key);
|
||||
current_headsets->appendRow(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void manage_headsets::on_selection_changed()
|
||||
{
|
||||
ui->button_remove->setDisabled(ui->headset_list->selectionModel()->selection().empty());
|
||||
}
|
||||
|
||||
void manage_headsets::on_remove_selected()
|
||||
{
|
||||
QStandardItemModel * current_headsets = dynamic_cast<QStandardItemModel *>(ui->headset_list->model());
|
||||
assert(current_headsets);
|
||||
|
||||
std::vector<QString> keys_to_remove;
|
||||
for (QItemSelectionRange item: ui->headset_list->selectionModel()->selection())
|
||||
{
|
||||
for (QModelIndex index: item.indexes())
|
||||
{
|
||||
keys_to_remove.push_back(current_headsets->item(index.row())->data().toString());
|
||||
}
|
||||
}
|
||||
|
||||
for (QString key: keys_to_remove)
|
||||
server_interface->revoke_key(key);
|
||||
}
|
||||
|
||||
void manage_headsets::on_rename_selected(QStandardItem * item)
|
||||
{
|
||||
server_interface->rename_key(item->data().toString(), item->text());
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wivrn_server.h"
|
||||
#include <QDialog>
|
||||
#include <QStandardItem>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class ManageHeadsets;
|
||||
}
|
||||
class IoGithubWivrnServerInterface;
|
||||
class OrgFreedesktopDBusPropertiesInterface;
|
||||
|
||||
class settings;
|
||||
class wivrn_server;
|
||||
class wizard;
|
||||
|
||||
class manage_headsets : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Ui::ManageHeadsets * ui;
|
||||
wivrn_server * server_interface;
|
||||
|
||||
public:
|
||||
manage_headsets(wivrn_server * server_interface);
|
||||
|
||||
private:
|
||||
void update_headet_list(const std::vector<wivrn_server::HeadsetKey> & keys);
|
||||
void on_selection_changed();
|
||||
void on_remove_selected();
|
||||
void on_rename_selected(QStandardItem * item);
|
||||
};
|
||||
@@ -1,81 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ManageHeadsets</class>
|
||||
<widget class="QDialog" name="ManageHeadsets">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>541</width>
|
||||
<height>446</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Manage headsets</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListView" name="headset_list"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_remove">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_close">
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="window-close"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>button_close</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ManageHeadsets</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>516</x>
|
||||
<y>426</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>494</x>
|
||||
<y>443</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -1,827 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rectangle_partitionner.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPalette>
|
||||
#include <QStyleOptionFocusRect>
|
||||
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
namespace
|
||||
{
|
||||
const double split_edge_threshold = 0.05;
|
||||
const double move_edge_threshold = 0.02;
|
||||
const double magnetism_threshold = 0.05;
|
||||
const int num_subdiv = 20;
|
||||
const double epsilon = 1.0 / (2 * num_subdiv);
|
||||
|
||||
enum class side
|
||||
{
|
||||
top,
|
||||
bottom,
|
||||
left,
|
||||
right
|
||||
};
|
||||
|
||||
struct edge
|
||||
{
|
||||
side edge_side;
|
||||
int rectangle_index;
|
||||
|
||||
bool operator==(const edge & other) const noexcept
|
||||
{
|
||||
return edge_side == other.edge_side and rectangle_index == other.rectangle_index;
|
||||
}
|
||||
|
||||
double position = 0;
|
||||
double min = std::numeric_limits<double>::max();
|
||||
double max = std::numeric_limits<double>::lowest();
|
||||
};
|
||||
} // namespace
|
||||
|
||||
struct rectangle_partitionner_private
|
||||
{
|
||||
std::vector<edge> selection;
|
||||
std::vector<edge> hovered;
|
||||
|
||||
double min_drag_position;
|
||||
double max_drag_position;
|
||||
|
||||
QLine split_line;
|
||||
|
||||
enum class mouse_event_type
|
||||
{
|
||||
move,
|
||||
press,
|
||||
release
|
||||
};
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
int hovered_rectangle(QPointF position, std::vector<QRectF> rectangles)
|
||||
{
|
||||
int n = 0;
|
||||
for (const QRectF & i: rectangles)
|
||||
{
|
||||
if (i.contains(position))
|
||||
return n;
|
||||
n++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
Qt::CursorShape get_cursor_shape(QPointF position, std::vector<QRectF> rectangles)
|
||||
{
|
||||
for (QRectF & i: rectangles)
|
||||
{
|
||||
if (i.contains(position))
|
||||
{
|
||||
QPointF rel_pos = position - i.topLeft();
|
||||
double dx = std::min(rel_pos.x(), i.width() - rel_pos.x());
|
||||
double dy = std::min(rel_pos.y(), i.height() - rel_pos.y());
|
||||
|
||||
if (dx < move_edge_threshold and position.x() >= epsilon and position.x() <= 1 - epsilon)
|
||||
return Qt::SizeHorCursor;
|
||||
else if (dy < move_edge_threshold and position.y() >= epsilon and position.y() <= 1 - epsilon)
|
||||
return Qt::SizeVerCursor;
|
||||
else if (dx < split_edge_threshold and position.y() >= epsilon and position.y() <= 1 - epsilon)
|
||||
return Qt::SplitVCursor;
|
||||
else if (dy < split_edge_threshold and position.x() >= epsilon and position.x() <= 1 - epsilon)
|
||||
return Qt::SplitHCursor;
|
||||
else
|
||||
return Qt::ArrowCursor;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Qt::ArrowCursor;
|
||||
}
|
||||
|
||||
std::vector<edge> horizontal_edges(std::vector<QRectF> rectangles)
|
||||
{
|
||||
std::vector<edge> edges;
|
||||
|
||||
for (int i = 0, n = rectangles.size(); i < n; i++)
|
||||
{
|
||||
if (rectangles[i].top() > epsilon)
|
||||
{
|
||||
edges.emplace_back(side::top, i, rectangles[i].top(), rectangles[i].left(), rectangles[i].right());
|
||||
}
|
||||
|
||||
if (rectangles[i].bottom() < 1 - epsilon)
|
||||
{
|
||||
edges.emplace_back(side::bottom, i, rectangles[i].bottom(), rectangles[i].left(), rectangles[i].right());
|
||||
}
|
||||
}
|
||||
|
||||
return edges;
|
||||
}
|
||||
|
||||
std::vector<edge> vertical_edges(std::vector<QRectF> rectangles)
|
||||
{
|
||||
std::vector<edge> edges;
|
||||
|
||||
for (int i = 0, n = rectangles.size(); i < n; i++)
|
||||
{
|
||||
if (rectangles[i].left() > epsilon)
|
||||
{
|
||||
edges.emplace_back(side::left, i, rectangles[i].left(), rectangles[i].top(), rectangles[i].bottom());
|
||||
}
|
||||
|
||||
if (rectangles[i].right() < 1 - epsilon)
|
||||
{
|
||||
edges.emplace_back(side::right, i, rectangles[i].right(), rectangles[i].top(), rectangles[i].bottom());
|
||||
}
|
||||
}
|
||||
|
||||
return edges;
|
||||
}
|
||||
|
||||
std::vector<std::vector<edge>> partition_edges(std::vector<edge> edges)
|
||||
{
|
||||
auto comp = [](const edge & a, const edge & b) {
|
||||
if (a.position < b.position)
|
||||
return true;
|
||||
if (a.position > b.position)
|
||||
return false;
|
||||
|
||||
if (a.min < b.min)
|
||||
return true;
|
||||
if (a.min > b.min)
|
||||
return false;
|
||||
|
||||
if (a.max < b.max)
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
std::ranges::sort(edges, comp);
|
||||
|
||||
std::vector<std::vector<edge>> partitionned;
|
||||
|
||||
double current_position = std::numeric_limits<double>::lowest();
|
||||
double current_max = 0;
|
||||
|
||||
for (auto & e: edges)
|
||||
{
|
||||
if (e.position != current_position)
|
||||
{
|
||||
current_position = e.position;
|
||||
current_max = e.max;
|
||||
partitionned.push_back({e});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.min >= current_max)
|
||||
{
|
||||
// All the following edges will be after the last partition
|
||||
current_max = e.max;
|
||||
partitionned.push_back({e});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add the edge to the current partition
|
||||
current_max = std::max(current_max, e.max);
|
||||
partitionned.back().push_back(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return partitionned;
|
||||
}
|
||||
|
||||
std::vector<edge> hovered_edges(QPointF position, const std::vector<std::vector<edge>> & partitionned_edges, bool horizontal)
|
||||
{
|
||||
if (horizontal)
|
||||
position = position.transposed();
|
||||
|
||||
for (const auto & edge_list: partitionned_edges)
|
||||
{
|
||||
for (const auto & edge: edge_list)
|
||||
{
|
||||
if (std::abs(position.x() - edge.position) < move_edge_threshold and position.y() >= edge.min and position.y() <= edge.max)
|
||||
{
|
||||
return edge_list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
bool assert_rectangle_list_is_partition(const std::vector<QRectF> & rectangles)
|
||||
{
|
||||
return true;
|
||||
|
||||
bool ok = true;
|
||||
|
||||
QRectF bounding_box{0, 0, 1, 1};
|
||||
|
||||
for (const auto & i: rectangles)
|
||||
{
|
||||
if (i.width() < 0 or i.height() < 0)
|
||||
{
|
||||
qDebug() << "Invalid rectangle" << i;
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<double> rectangle_y_boundaries;
|
||||
for (auto & i: rectangles)
|
||||
{
|
||||
rectangle_y_boundaries.push_back(i.top());
|
||||
rectangle_y_boundaries.push_back(i.bottom());
|
||||
}
|
||||
|
||||
// for (int y = bounding_box.top(); y < bounding_box.bottom(); ++y)
|
||||
for (double y: rectangle_y_boundaries)
|
||||
{
|
||||
if (y < bounding_box.top())
|
||||
continue;
|
||||
if (y >= bounding_box.bottom())
|
||||
continue;
|
||||
|
||||
qDebug() << "Checking line" << y;
|
||||
std::vector<std::pair<double, double>> horizontal_segments;
|
||||
for (const auto & i: rectangles)
|
||||
{
|
||||
if (y >= i.top() and y < i.bottom())
|
||||
{
|
||||
horizontal_segments.emplace_back(i.left(), i.right());
|
||||
qDebug() << " Adding segment" << i.left() << "-" << i.right();
|
||||
}
|
||||
}
|
||||
|
||||
std::ranges::sort(horizontal_segments);
|
||||
|
||||
if (horizontal_segments.empty())
|
||||
{
|
||||
qDebug() << "Line" << y << "empty";
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (horizontal_segments.front().first != bounding_box.left())
|
||||
{
|
||||
qDebug() << "Line" << y << "does not start at the left of the bounding box" << (horizontal_segments.front().first - bounding_box.left());
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (horizontal_segments.back().second != bounding_box.right())
|
||||
{
|
||||
qDebug() << "Last rectangle of line" << y << "does not end at the right of the bounding box" << (horizontal_segments.back().second - bounding_box.right());
|
||||
ok = false;
|
||||
}
|
||||
|
||||
for (int i = 1; i < horizontal_segments.size(); ++i)
|
||||
{
|
||||
if (horizontal_segments[i - 1].second < horizontal_segments[i].first)
|
||||
{
|
||||
qDebug() << "Overlap in line" << y << (horizontal_segments[i - 1].second - horizontal_segments[i].first);
|
||||
ok = false;
|
||||
}
|
||||
else if (horizontal_segments[i - 1].second > horizontal_segments[i].first)
|
||||
{
|
||||
qDebug() << "Gap in line" << y << (horizontal_segments[i - 1].second - horizontal_segments[i].first);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
qDebug() << "Bounding box:" << bounding_box;
|
||||
int n = 1;
|
||||
for (auto & i: rectangles)
|
||||
{
|
||||
qDebug() << "Rectangle" << (n++) << ":" << i.topLeft() << "-" << i.bottomRight();
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
rectangle_partitionner::rectangle_partitionner(QWidget * parent) :
|
||||
QFrame(parent)
|
||||
{
|
||||
p = new rectangle_partitionner_private;
|
||||
|
||||
setMouseTracking(true);
|
||||
|
||||
std::vector<QRectF> encoders;
|
||||
|
||||
encoders.push_back(QRectF{0, 0, 1, 1});
|
||||
set_rectangles(encoders);
|
||||
|
||||
m_paint = [](QPainter & painter, QRect rect, const QVariant & data, int index, bool selected) {
|
||||
if (selected)
|
||||
{
|
||||
painter.fillRect(rect.adjusted(1, 1, 0, 0), QColorConstants::Cyan);
|
||||
}
|
||||
|
||||
QString text = QString("%1").arg(index + 1);
|
||||
painter.drawText(rect, Qt::AlignCenter, text);
|
||||
};
|
||||
}
|
||||
|
||||
rectangle_partitionner::~rectangle_partitionner()
|
||||
{
|
||||
delete p;
|
||||
}
|
||||
|
||||
void rectangle_partitionner::paintEvent(QPaintEvent * event)
|
||||
{
|
||||
QFrame::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
auto positions = rectangles_position();
|
||||
|
||||
{
|
||||
QList<QLine> lines;
|
||||
for (int i = 1; i < num_subdiv; i++)
|
||||
{
|
||||
QPoint p1 = to_position({0, double(i) / num_subdiv});
|
||||
QPoint p2 = to_position({1, double(i) / num_subdiv});
|
||||
lines.emplace_back(p1, p2);
|
||||
|
||||
QPoint p3 = to_position({double(i) / num_subdiv, 0});
|
||||
QPoint p4 = to_position({double(i) / num_subdiv, 1});
|
||||
lines.emplace_back(p3, p4);
|
||||
}
|
||||
|
||||
QPen pen = painter.pen();
|
||||
painter.setPen(QPen(Qt::lightGray, 1, Qt::SolidLine));
|
||||
painter.drawLines(lines);
|
||||
painter.setPen(pen);
|
||||
}
|
||||
|
||||
if (m_paint)
|
||||
{
|
||||
int n = 0;
|
||||
for (QRect & i: positions)
|
||||
{
|
||||
painter.drawRect(i);
|
||||
bool is_selected = n == m_selected_index and isEnabled();
|
||||
m_paint(painter, i, m_rectangles_data.at(n), n, is_selected);
|
||||
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
if (not p->hovered.empty() and p->selection.empty())
|
||||
{
|
||||
painter.setPen(QPen(Qt::blue, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
QList<QLine> lines;
|
||||
lines.reserve(p->hovered.size());
|
||||
for (const edge & i: p->hovered)
|
||||
{
|
||||
QLineF line;
|
||||
switch (i.edge_side)
|
||||
{
|
||||
case side::top:
|
||||
case side::bottom:
|
||||
line = QLineF(i.min, i.position, i.max, i.position);
|
||||
break;
|
||||
|
||||
case side::left:
|
||||
case side::right:
|
||||
line = QLineF(i.position, i.min, i.position, i.max);
|
||||
break;
|
||||
}
|
||||
|
||||
int x1 = std::round(r.x() + line.x1() * (r.width() - 1));
|
||||
int x2 = std::round(r.x() + line.x2() * (r.width() - 1));
|
||||
|
||||
int y1 = std::round(r.y() + line.y1() * (r.height() - 1));
|
||||
int y2 = std::round(r.y() + line.y2() * (r.height() - 1));
|
||||
|
||||
lines.emplace_back(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
painter.drawLines(lines);
|
||||
|
||||
auto horz_partitionned = partition_edges(horizontal_edges(m_rectangles));
|
||||
auto vert_partitionned = partition_edges(vertical_edges(m_rectangles));
|
||||
}
|
||||
else if ((cursor() == Qt::SplitHCursor or cursor() == Qt::SplitVCursor) and not p->split_line.isNull())
|
||||
{
|
||||
auto now = std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now().time_since_epoch()).count();
|
||||
|
||||
QPen pen(Qt::black, 2, Qt::DashLine, Qt::RoundCap, Qt::RoundJoin);
|
||||
pen.setDashPattern({5, 5});
|
||||
pen.setDashOffset(-now * 15);
|
||||
painter.setPen(pen);
|
||||
|
||||
painter.drawLine(p->split_line);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void rectangle_partitionner::mouseMoveEvent(QMouseEvent * event)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
if (not p->selection.empty())
|
||||
{
|
||||
double position;
|
||||
|
||||
if (p->selection.front().edge_side == side::top or p->selection.front().edge_side == side::bottom)
|
||||
position = from_position(event->pos()).y();
|
||||
else
|
||||
position = from_position(event->pos()).x();
|
||||
|
||||
position = std::clamp(position, p->min_drag_position, p->max_drag_position);
|
||||
position = std::round(position * num_subdiv) / num_subdiv; // magnetism
|
||||
|
||||
for (edge & e: p->selection)
|
||||
{
|
||||
switch (e.edge_side)
|
||||
{
|
||||
case side::top:
|
||||
m_rectangles[e.rectangle_index].setTop(position);
|
||||
break;
|
||||
|
||||
case side::bottom:
|
||||
m_rectangles[e.rectangle_index].setBottom(position);
|
||||
break;
|
||||
|
||||
case side::left:
|
||||
m_rectangles[e.rectangle_index].setLeft(position);
|
||||
break;
|
||||
|
||||
case side::right:
|
||||
m_rectangles[e.rectangle_index].setRight(position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if (not assert_rectangle_list_is_partition(m_rectangles))
|
||||
// {
|
||||
// abort();
|
||||
// }
|
||||
|
||||
update();
|
||||
rectangles_change(m_rectangles);
|
||||
}
|
||||
else
|
||||
{
|
||||
p->hovered.clear();
|
||||
|
||||
if (auto horz_edges = hovered_edges(from_position(event->pos()), partition_edges(horizontal_edges(m_rectangles)), true); not horz_edges.empty())
|
||||
{
|
||||
p->hovered = std::move(horz_edges);
|
||||
update();
|
||||
}
|
||||
else if (auto vert_edges = hovered_edges(from_position(event->pos()), partition_edges(vertical_edges(m_rectangles)), false); not vert_edges.empty())
|
||||
{
|
||||
p->hovered = std::move(vert_edges);
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
int n = hovered_rectangle(from_position(event->pos()), m_rectangles);
|
||||
}
|
||||
|
||||
auto new_cursor = get_cursor_shape(from_position(event->pos()), m_rectangles);
|
||||
if (new_cursor != cursor())
|
||||
{
|
||||
update();
|
||||
setCursor(new_cursor);
|
||||
}
|
||||
}
|
||||
|
||||
if (cursor() == Qt::SplitHCursor)
|
||||
{
|
||||
int n = hovered_rectangle(from_position(event->pos()), m_rectangles);
|
||||
|
||||
double x = std::round(from_position(event->pos()).x() * num_subdiv) / num_subdiv; // magnetism
|
||||
int px = to_position({x, 0}).x();
|
||||
|
||||
p->split_line = {px, rectangles_position()[n].top(), px, rectangles_position()[n].bottom()};
|
||||
update();
|
||||
}
|
||||
else if (cursor() == Qt::SplitVCursor)
|
||||
{
|
||||
int n = hovered_rectangle(from_position(event->pos()), m_rectangles);
|
||||
|
||||
double y = std::round(from_position(event->pos()).y() * num_subdiv) / num_subdiv; // magnetism
|
||||
int py = to_position({0, y}).y();
|
||||
|
||||
p->split_line = {rectangles_position()[n].left(), py, rectangles_position()[n].right(), py};
|
||||
update();
|
||||
}
|
||||
else
|
||||
{
|
||||
p->split_line = {0, 0, 0, 0};
|
||||
}
|
||||
}
|
||||
|
||||
void rectangle_partitionner::mousePressEvent(QMouseEvent * event)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
p->selection.clear();
|
||||
p->split_line = {0, 0, 0, 0};
|
||||
|
||||
if (auto horz_edges = hovered_edges(from_position(event->pos()), partition_edges(horizontal_edges(m_rectangles)), true); not horz_edges.empty())
|
||||
{
|
||||
p->selection = std::move(horz_edges);
|
||||
}
|
||||
else if (auto vert_edges = hovered_edges(from_position(event->pos()), partition_edges(vertical_edges(m_rectangles)), false); not vert_edges.empty())
|
||||
{
|
||||
p->selection = std::move(vert_edges);
|
||||
}
|
||||
else if (int n = hovered_rectangle(from_position(event->pos()), m_rectangles); n >= 0)
|
||||
{
|
||||
QRectF & hovered = m_rectangles[n];
|
||||
|
||||
// Compute distance to edges
|
||||
auto pos = from_position(event->pos());
|
||||
|
||||
double dx = std::min(pos.x() - hovered.left(), hovered.right() - pos.x());
|
||||
double dy = std::min(pos.y() - hovered.top(), hovered.bottom() - pos.y());
|
||||
|
||||
if (dx < split_edge_threshold)
|
||||
{
|
||||
double y = std::round(pos.y() * num_subdiv) / num_subdiv; // magnetism
|
||||
|
||||
// Split vertically
|
||||
QRectF new_rectangle = hovered;
|
||||
|
||||
hovered.setBottom(y);
|
||||
new_rectangle.setTop(hovered.bottom());
|
||||
|
||||
m_rectangles.push_back(new_rectangle);
|
||||
m_rectangles_data.push_back(m_rectangles_data[n]);
|
||||
update();
|
||||
rectangles_change(m_rectangles);
|
||||
|
||||
if (not assert_rectangle_list_is_partition(m_rectangles))
|
||||
abort();
|
||||
}
|
||||
else if (dy < split_edge_threshold)
|
||||
{
|
||||
double x = std::round(pos.x() * num_subdiv) / num_subdiv; // magnetism
|
||||
|
||||
// Split horizontally
|
||||
QRectF new_rectangle = hovered;
|
||||
|
||||
hovered.setRight(x);
|
||||
new_rectangle.setLeft(hovered.right());
|
||||
|
||||
m_rectangles.push_back(new_rectangle);
|
||||
m_rectangles_data.push_back(m_rectangles_data[n]);
|
||||
update();
|
||||
rectangles_change(m_rectangles);
|
||||
|
||||
if (not assert_rectangle_list_is_partition(m_rectangles))
|
||||
abort();
|
||||
}
|
||||
else
|
||||
{
|
||||
set_selected_index(n);
|
||||
}
|
||||
}
|
||||
|
||||
if (not p->selection.empty())
|
||||
{
|
||||
p->hovered.clear();
|
||||
|
||||
p->min_drag_position = std::numeric_limits<double>::lowest();
|
||||
p->max_drag_position = std::numeric_limits<double>::max();
|
||||
|
||||
for (auto & e: p->selection)
|
||||
{
|
||||
switch (e.edge_side)
|
||||
{
|
||||
case side::top:
|
||||
p->max_drag_position = std::min(p->max_drag_position, m_rectangles[e.rectangle_index].bottom());
|
||||
break;
|
||||
case side::bottom:
|
||||
p->min_drag_position = std::max(p->min_drag_position, m_rectangles[e.rectangle_index].top());
|
||||
break;
|
||||
case side::left:
|
||||
p->max_drag_position = std::min(p->max_drag_position, m_rectangles[e.rectangle_index].right());
|
||||
break;
|
||||
case side::right:
|
||||
p->min_drag_position = std::max(p->min_drag_position, m_rectangles[e.rectangle_index].left());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
}
|
||||
|
||||
void rectangle_partitionner::mouseReleaseEvent(QMouseEvent * event)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
p->selection.clear();
|
||||
|
||||
// Delete empty rectangles
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
bool changed = false;
|
||||
for (int i = 0; i < m_rectangles.size();)
|
||||
{
|
||||
if (m_rectangles[i].width() <= 0.0001 or m_rectangles[i].height() <= 0.0001) // TODO configurable thresholds
|
||||
{
|
||||
m_rectangles.erase(m_rectangles.begin() + i);
|
||||
m_rectangles_data.erase(m_rectangles_data.begin() + i);
|
||||
changed = true;
|
||||
|
||||
if (m_selected_index > i)
|
||||
m_selected_index--;
|
||||
else if (m_selected_index == i)
|
||||
{
|
||||
m_selected_index = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++i;
|
||||
}
|
||||
}
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
if (changed)
|
||||
{
|
||||
if (not assert_rectangle_list_is_partition(m_rectangles))
|
||||
abort();
|
||||
|
||||
rectangles_change(m_rectangles);
|
||||
selected_index_change(m_selected_index);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void rectangle_partitionner::leaveEvent(QEvent * event)
|
||||
{
|
||||
p->split_line = {0, 0, 0, 0};
|
||||
}
|
||||
|
||||
void rectangle_partitionner::keyPressEvent(QKeyEvent * event)
|
||||
{
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
qDebug() << "Bounding box:" << r;
|
||||
int n = 1;
|
||||
for (auto & i: m_rectangles)
|
||||
{
|
||||
qDebug() << "Rectangle" << (n++) << ":" << i.topLeft() << "-" << i.bottomRight();
|
||||
}
|
||||
}
|
||||
|
||||
void rectangle_partitionner::set_rectangles(rectangle_list value)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
auto old_value = std::move(m_rectangles);
|
||||
|
||||
m_rectangles = std::move(value);
|
||||
|
||||
for (auto & i: m_rectangles)
|
||||
{
|
||||
i.setBottom(std::round(i.bottom() * num_subdiv) / num_subdiv);
|
||||
i.setTop(std::round(i.top() * num_subdiv) / num_subdiv);
|
||||
i.setLeft(std::round(i.left() * num_subdiv) / num_subdiv);
|
||||
i.setRight(std::round(i.right() * num_subdiv) / num_subdiv);
|
||||
}
|
||||
|
||||
if (not assert_rectangle_list_is_partition(m_rectangles))
|
||||
{
|
||||
m_rectangles = std::move(old_value);
|
||||
|
||||
throw std::runtime_error("Invalid partitionning");
|
||||
}
|
||||
|
||||
m_rectangles_data.resize(m_rectangles.size());
|
||||
|
||||
if (m_selected_index >= m_rectangles.size())
|
||||
set_selected_index(m_rectangles.size() - 1);
|
||||
|
||||
update();
|
||||
rectangles_change(m_rectangles);
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
}
|
||||
|
||||
void rectangle_partitionner::set_selected_index(int new_index)
|
||||
{
|
||||
new_index = std::clamp<int>(new_index, -1, m_rectangles.size());
|
||||
|
||||
if (new_index != m_selected_index)
|
||||
{
|
||||
m_selected_index = new_index;
|
||||
update();
|
||||
|
||||
selected_index_change(new_index);
|
||||
}
|
||||
}
|
||||
|
||||
void rectangle_partitionner::set_rectangles_data(const data_list & value)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
m_rectangles_data = value;
|
||||
m_rectangles_data.resize(m_rectangles.size());
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void rectangle_partitionner::set_rectangles_data(int index, QVariant value)
|
||||
{
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
assert(index < m_rectangles_data.size() and index >= 0);
|
||||
m_rectangles_data.at(index) = value;
|
||||
assert(m_rectangles.size() == m_rectangles_data.size());
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
void rectangle_partitionner::set_paint(paint_function paint)
|
||||
{
|
||||
m_paint = paint;
|
||||
update();
|
||||
}
|
||||
|
||||
std::vector<QRect> rectangle_partitionner::rectangles_position()
|
||||
{
|
||||
std::vector<QRect> positions;
|
||||
positions.reserve(m_rectangles.size());
|
||||
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
for (QRectF & i: m_rectangles)
|
||||
{
|
||||
int x1 = std::round(r.x() + i.x() * (r.width() - 1));
|
||||
int x2 = std::round(r.x() + (i.x() + i.width()) * (r.width() - 1));
|
||||
|
||||
int y1 = std::round(r.y() + i.y() * (r.height() - 1));
|
||||
int y2 = std::round(r.y() + (i.y() + i.height()) * (r.height() - 1));
|
||||
positions.emplace_back(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
|
||||
}
|
||||
assert(m_rectangles.size() == positions.size());
|
||||
|
||||
return positions;
|
||||
}
|
||||
|
||||
QPointF rectangle_partitionner::from_position(QPoint position)
|
||||
{
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
return QPointF{
|
||||
std::clamp(double(position.x() - r.x()) / (r.width() - 1), 0., 1.),
|
||||
std::clamp(double(position.y() - r.y()) / (r.height() - 1), 0., 1.),
|
||||
};
|
||||
}
|
||||
|
||||
QPoint rectangle_partitionner::to_position(QPointF position)
|
||||
{
|
||||
auto r = frameRect();
|
||||
r.adjust(frameWidth(), frameWidth(), -2 * frameWidth(), -2 * frameWidth());
|
||||
|
||||
return QPoint(
|
||||
std::round(r.x() + position.x() * (r.width() - 1)),
|
||||
std::round(r.y() + position.y() * (r.height() - 1)));
|
||||
}
|
||||
|
||||
#include "moc_rectangle_partitionner.cpp"
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
#include <QRectF>
|
||||
#include <QVariant>
|
||||
#include <vector>
|
||||
|
||||
struct rectangle_partitionner_private;
|
||||
|
||||
class rectangle_partitionner : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
rectangle_partitionner_private * p;
|
||||
|
||||
public:
|
||||
explicit rectangle_partitionner(QWidget * parent = nullptr);
|
||||
rectangle_partitionner(const rectangle_partitionner &) = delete;
|
||||
rectangle_partitionner & operator=(const rectangle_partitionner &) = delete;
|
||||
~rectangle_partitionner();
|
||||
|
||||
using rectangle_list = std::vector<QRectF>;
|
||||
using data_list = std::vector<QVariant>;
|
||||
using paint_function = std::function<void(QPainter & painter, QRect rect, const QVariant & data, int index, bool selected)>;
|
||||
|
||||
Q_PROPERTY(rectangle_list rectangles READ rectangles WRITE set_rectangles NOTIFY rectangles_change)
|
||||
Q_PROPERTY(data_list rectangles_data READ rectangles_data WRITE set_rectangles_data)
|
||||
Q_PROPERTY(int selected_index READ selected_index WRITE set_selected_index NOTIFY selected_index_change)
|
||||
Q_PROPERTY(paint_function paint READ paint WRITE set_paint)
|
||||
|
||||
const rectangle_list & rectangles() const
|
||||
{
|
||||
return m_rectangles;
|
||||
}
|
||||
|
||||
int selected_index() const
|
||||
{
|
||||
return m_selected_index;
|
||||
}
|
||||
|
||||
const data_list & rectangles_data() const
|
||||
{
|
||||
return m_rectangles_data;
|
||||
}
|
||||
|
||||
const QVariant & rectangles_data(int index) const
|
||||
{
|
||||
return m_rectangles_data.at(index);
|
||||
}
|
||||
|
||||
const paint_function & paint() const
|
||||
{
|
||||
return m_paint;
|
||||
}
|
||||
|
||||
void set_rectangles(rectangle_list);
|
||||
void set_rectangles_data(const data_list &);
|
||||
void set_rectangles_data(int, QVariant);
|
||||
void set_selected_index(int);
|
||||
void set_paint(paint_function paint);
|
||||
|
||||
signals:
|
||||
void selected_index_change(int);
|
||||
void rectangles_change(const rectangle_list &);
|
||||
|
||||
protected:
|
||||
rectangle_list m_rectangles;
|
||||
int m_selected_index = 0;
|
||||
data_list m_rectangles_data;
|
||||
paint_function m_paint;
|
||||
|
||||
std::vector<QRect> rectangles_position();
|
||||
QPointF from_position(QPoint position);
|
||||
QPoint to_position(QPointF position);
|
||||
|
||||
void paintEvent(QPaintEvent * event) override;
|
||||
void mouseMoveEvent(QMouseEvent * event) override;
|
||||
void mousePressEvent(QMouseEvent * event) override;
|
||||
void mouseReleaseEvent(QMouseEvent * event) override;
|
||||
void leaveEvent(QEvent * event) override;
|
||||
|
||||
void keyPressEvent(QKeyEvent * event) override;
|
||||
};
|
||||
@@ -1,642 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
#include "escape_string.h"
|
||||
#include "gui_config.h"
|
||||
#include "rectangle_partitionner.h"
|
||||
#include "steam_app.h"
|
||||
#include "ui_settings.h"
|
||||
#include "wivrn_server.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QStandardItemModel>
|
||||
#include <QStandardPaths>
|
||||
#include <QToolTip>
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
{
|
||||
// The index must match the order in the combo boxes
|
||||
const std::vector<std::pair<int, std::string>> encoder_ids{
|
||||
{0, "auto"},
|
||||
{1, "nvenc"},
|
||||
{2, "vaapi"},
|
||||
{3, "x264"},
|
||||
{4, "vulkan"},
|
||||
};
|
||||
|
||||
const std::vector<std::pair<int, std::string>> codec_ids{
|
||||
{0, "auto"},
|
||||
{1, "h264"},
|
||||
{1, "avc"},
|
||||
{2, "h265"},
|
||||
{2, "hevc"},
|
||||
{3, "av1"},
|
||||
{3, "AV1"},
|
||||
};
|
||||
|
||||
const std::vector<std::pair<int, int>> compatible_combos{
|
||||
// Automatically chosen encoder
|
||||
{0, 0},
|
||||
// nvenc
|
||||
{1, 0},
|
||||
{1, 1},
|
||||
{1, 2},
|
||||
// {1, 3},
|
||||
// vaapi
|
||||
{2, 0},
|
||||
{2, 1},
|
||||
{2, 2},
|
||||
{2, 3},
|
||||
// x264
|
||||
{3, 1},
|
||||
// vulkan
|
||||
{4, 1},
|
||||
// {4, 2},
|
||||
};
|
||||
|
||||
int encoder_id_from_string(std::string_view s)
|
||||
{
|
||||
for (auto & [i, j]: encoder_ids)
|
||||
{
|
||||
if (j == s)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::string & encoder_from_id(int id)
|
||||
{
|
||||
for (auto & [i, j]: encoder_ids)
|
||||
{
|
||||
if (i == id)
|
||||
return j;
|
||||
}
|
||||
|
||||
static const std::string default_value = "auto";
|
||||
return default_value;
|
||||
}
|
||||
|
||||
int codec_id_from_string(std::string_view s)
|
||||
{
|
||||
for (auto & [i, j]: codec_ids)
|
||||
{
|
||||
if (j == s)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::string & codec_from_id(int id)
|
||||
{
|
||||
for (auto & [i, j]: codec_ids)
|
||||
{
|
||||
if (i == id)
|
||||
return j;
|
||||
}
|
||||
|
||||
static const std::string default_value = "auto";
|
||||
return default_value;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
settings::settings(wivrn_server * server_interface) :
|
||||
server_interface(server_interface)
|
||||
{
|
||||
ui = new Ui::Settings;
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->combo_select_game, &QComboBox::currentIndexChanged, this, &settings::on_selected_game_changed);
|
||||
connect(ui->button_game_browse, &QPushButton::clicked, this, &settings::on_browse_game);
|
||||
|
||||
connect(ui->partitionner, &rectangle_partitionner::selected_index_change, this, &settings::selected_rectangle_changed);
|
||||
|
||||
connect(ui->encoder, &QComboBox::currentIndexChanged, this, &settings::on_selected_encoder_changed);
|
||||
connect(ui->encoder, &QComboBox::currentIndexChanged, this, &settings::on_encoder_settings_changed);
|
||||
connect(ui->codec, &QComboBox::currentIndexChanged, this, &settings::on_encoder_settings_changed);
|
||||
|
||||
connect(this, &QDialog::accepted, this, &settings::save_settings);
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &settings::restore_defaults);
|
||||
|
||||
setWindowModality(Qt::WindowModality::ApplicationModal);
|
||||
|
||||
fill_steam_games_list();
|
||||
load_settings();
|
||||
|
||||
// Use a queued connection so that the slot is called after the widgets have been laid out
|
||||
// Set up the signal connection after loading to avoid scrolling when opening the window
|
||||
connect(ui->radio_manual_encoder, &QRadioButton::toggled, this, [&](bool value) {
|
||||
if (value)
|
||||
ui->scrollArea->ensureWidgetVisible(ui->layout_encoder_config); }, Qt::QueuedConnection);
|
||||
|
||||
auto encoders = dynamic_cast<QStandardItemModel *>(ui->encoder->model());
|
||||
#if !WIVRN_USE_NVENC
|
||||
encoders->item(1)->setEnabled(false);
|
||||
#endif
|
||||
#if !WIVRN_USE_VAAPI
|
||||
encoders->item(2)->setEnabled(false);
|
||||
#endif
|
||||
#if !WIVRN_USE_X264
|
||||
encoders->item(3)->setEnabled(false);
|
||||
#endif
|
||||
#if !WIVRN_USE_VULKAN_ENCODE
|
||||
encoders->item(4)->setEnabled(false);
|
||||
#endif
|
||||
|
||||
ui->partitionner->set_paint([&](QPainter & painter, QRect rect, const QVariant & data, int index, bool selected) {
|
||||
QPalette palette = QApplication::palette();
|
||||
|
||||
if (selected)
|
||||
{
|
||||
painter.fillRect(rect.adjusted(1, 1, 0, 0), palette.color(QPalette::Highlight));
|
||||
}
|
||||
|
||||
auto [encoder_id, codec_id] = data.value<std::pair<int, int>>();
|
||||
|
||||
QString codec = ui->codec->itemText(codec_id);
|
||||
QString encoder = ui->encoder->itemText(encoder_id);
|
||||
|
||||
QFont font = painter.font();
|
||||
QFont font2 = font;
|
||||
|
||||
font2.setPixelSize(24);
|
||||
|
||||
QString text = QString("%1\n%2").arg(encoder, codec);
|
||||
|
||||
QFontMetrics metrics{font2};
|
||||
QSize size = metrics.size(0, text);
|
||||
|
||||
if (double ratio = std::max((double)size.width() / rect.width(), (double)size.height() / rect.height()); ratio > 1)
|
||||
{
|
||||
int pixel_size = font2.pixelSize() / ratio;
|
||||
if (pixel_size > 0)
|
||||
font2.setPixelSize(pixel_size);
|
||||
}
|
||||
|
||||
painter.setFont(font2);
|
||||
painter.drawText(rect, Qt::AlignCenter, text);
|
||||
painter.setFont(font);
|
||||
});
|
||||
}
|
||||
|
||||
settings::~settings()
|
||||
{
|
||||
delete ui;
|
||||
ui = nullptr;
|
||||
}
|
||||
|
||||
void settings::fill_steam_games_list()
|
||||
{
|
||||
ui->combo_select_game->clear();
|
||||
ui->combo_select_game->addItem(tr("None", "Game selection combo box"));
|
||||
ui->combo_select_game->addItem(tr("Custom...", "Game selection combo box"));
|
||||
|
||||
auto apps = steam_apps();
|
||||
for (auto & app: apps)
|
||||
{
|
||||
ui->combo_select_game->addItem(QString::fromUtf8(app.name), QVariant::fromValue(app));
|
||||
}
|
||||
}
|
||||
|
||||
void settings::on_selected_encoder_changed()
|
||||
{
|
||||
int encoder = ui->encoder->currentIndex();
|
||||
|
||||
QStandardItemModel * model = dynamic_cast<QStandardItemModel *>(ui->codec->model());
|
||||
assert(model);
|
||||
|
||||
for (int i = 0, n = model->rowCount(); i < n; i++)
|
||||
{
|
||||
auto * item = model->item(i);
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
|
||||
}
|
||||
|
||||
for (auto [i, j]: compatible_combos)
|
||||
{
|
||||
if (encoder == i)
|
||||
{
|
||||
auto * item = model->item(j);
|
||||
item->setFlags(item->flags() | Qt::ItemIsEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settings::on_encoder_settings_changed()
|
||||
{
|
||||
if (ui->partitionner->selected_index() < 0)
|
||||
return;
|
||||
|
||||
QString status;
|
||||
|
||||
int encoder = ui->encoder->currentIndex();
|
||||
int codec = ui->codec->currentIndex();
|
||||
|
||||
bool compatible = false;
|
||||
|
||||
for (auto [i, j]: compatible_combos)
|
||||
{
|
||||
if (encoder == i and codec == j)
|
||||
{
|
||||
compatible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!compatible)
|
||||
{
|
||||
// Find a compatible codec for this encoder
|
||||
for (auto [i, j]: compatible_combos)
|
||||
{
|
||||
if (encoder == i)
|
||||
{
|
||||
codec = j;
|
||||
ui->codec->setCurrentIndex(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (codec == 3 /* av1 */)
|
||||
{
|
||||
status += tr("Not all headsets and GPUs support AV1\n");
|
||||
}
|
||||
|
||||
if (encoder == 4 /* vulkan */)
|
||||
{
|
||||
status += tr("Vulkan Video encoder is experimental\n");
|
||||
}
|
||||
|
||||
ui->partitionner->set_rectangles_data(ui->partitionner->selected_index(), QVariant::fromValue(std::pair(encoder, codec)));
|
||||
|
||||
ui->message->setText(status);
|
||||
}
|
||||
|
||||
void settings::on_selected_game_changed(int index)
|
||||
{
|
||||
if (index == 0) // No game selected
|
||||
{
|
||||
ui->edit_game_path->setEnabled(false);
|
||||
ui->button_game_browse->setEnabled(false);
|
||||
}
|
||||
else if (index == 1) // Custom path
|
||||
{
|
||||
ui->edit_game_path->setEnabled(true);
|
||||
ui->button_game_browse->setEnabled(true);
|
||||
}
|
||||
else // From Steam vrmanifest
|
||||
{
|
||||
ui->edit_game_path->setEnabled(false);
|
||||
ui->button_game_browse->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void settings::on_browse_game()
|
||||
{
|
||||
QFileInfo info(application().empty() ? QString{} : QString::fromStdString(application().front()));
|
||||
|
||||
QFileDialog dlg(this, tr("Select game"));
|
||||
dlg.setFilter(QDir::Executable | QDir::Files);
|
||||
dlg.setFileMode(QFileDialog::ExistingFile);
|
||||
dlg.setDirectory(info.dir());
|
||||
|
||||
if (not dlg.exec())
|
||||
return;
|
||||
|
||||
auto files = dlg.selectedFiles();
|
||||
|
||||
if (files.empty())
|
||||
return;
|
||||
|
||||
set_application({files.front().toStdString()});
|
||||
}
|
||||
|
||||
void settings::selected_rectangle_changed(int index)
|
||||
{
|
||||
if (index >= 0)
|
||||
{
|
||||
auto [encoder, codec] = ui->partitionner->rectangles_data(index).value<std::pair<int, int>>();
|
||||
|
||||
ui->encoder->setCurrentIndex(encoder);
|
||||
ui->codec->setCurrentIndex(codec);
|
||||
ui->encoder->setEnabled(true);
|
||||
ui->codec->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->encoder->setCurrentIndex(-1);
|
||||
ui->codec->setCurrentIndex(-1);
|
||||
ui->encoder->setEnabled(false);
|
||||
ui->codec->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void settings::restore_defaults()
|
||||
{
|
||||
ui->bitrate->setValue(50);
|
||||
ui->radio_auto_foveation->setChecked(true);
|
||||
ui->radio_auto_encoder->setChecked(true);
|
||||
ui->layout_encoder_config->setVisible(false);
|
||||
|
||||
std::vector<QRectF> rectangles;
|
||||
std::vector<QVariant> encoder_config;
|
||||
|
||||
rectangles.push_back(QRectF(0, 0, 1, 1));
|
||||
std::pair<int, int> config{0, 0};
|
||||
encoder_config.push_back(QVariant::fromValue(config));
|
||||
|
||||
ui->partitionner->set_rectangles(rectangles);
|
||||
ui->partitionner->set_rectangles_data(encoder_config);
|
||||
ui->partitionner->set_selected_index(0);
|
||||
|
||||
ui->combo_select_game->setCurrentIndex(0);
|
||||
ui->edit_game_path->setText("");
|
||||
}
|
||||
|
||||
void settings::set_application(const std::vector<std::string> & app)
|
||||
{
|
||||
ui->edit_game_path->setText(QString::fromStdString(escape_string(app)));
|
||||
}
|
||||
|
||||
std::vector<std::string> settings::application()
|
||||
{
|
||||
return unescape_string(ui->edit_game_path->text().toStdString());
|
||||
}
|
||||
|
||||
void settings::load_settings()
|
||||
{
|
||||
std::vector<QRectF> rectangles;
|
||||
std::vector<QVariant> encoder_config;
|
||||
|
||||
// Encoders configuration
|
||||
try
|
||||
{
|
||||
auto conf = server_interface->jsonConfiguration();
|
||||
qDebug() << "Server config" << conf;
|
||||
json_doc = nlohmann::json::parse(conf.toUtf8());
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
qWarning() << "Cannot read configuration: " << e.what();
|
||||
restore_defaults();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nlohmann::json encoders;
|
||||
|
||||
if (json_doc.contains("encoders"))
|
||||
{
|
||||
encoders = json_doc["encoders"];
|
||||
ui->radio_auto_encoder->setChecked(false);
|
||||
ui->radio_manual_encoder->setChecked(true);
|
||||
}
|
||||
else if (json_doc.contains("encoders.disabled"))
|
||||
{
|
||||
encoders = json_doc["encoders.disabled"];
|
||||
ui->radio_auto_encoder->setChecked(true);
|
||||
ui->radio_manual_encoder->setChecked(false);
|
||||
ui->layout_encoder_config->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->radio_auto_encoder->setChecked(true);
|
||||
ui->radio_manual_encoder->setChecked(false);
|
||||
ui->layout_encoder_config->setVisible(false);
|
||||
}
|
||||
|
||||
for (auto & i: encoders)
|
||||
{
|
||||
int encoder = encoder_id_from_string(i.value("encoder", "auto"));
|
||||
int codec = codec_id_from_string(i.value("codec", "auto"));
|
||||
double width = i.value("width", 1.0);
|
||||
double height = i.value("height", 1.0);
|
||||
double offset_x = i.value("offset_x", 0.0);
|
||||
double offset_y = i.value("offset_y", 0.0);
|
||||
int group = i.value("group", 0); // TODO: handle groups
|
||||
|
||||
rectangles.push_back(QRectF(offset_x, offset_y, width, height));
|
||||
encoder_config.push_back(QVariant::fromValue(std::pair(encoder, codec)));
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
QMessageBox msgbox{QMessageBox::Information, tr("Invalid settings"), tr("The encoder configuration is invalid, the default values will be restored."), QMessageBox::Close, this};
|
||||
msgbox.exec();
|
||||
|
||||
rectangles.clear();
|
||||
encoder_config.clear();
|
||||
}
|
||||
|
||||
if (rectangles.empty())
|
||||
{
|
||||
ui->radio_auto_encoder->setChecked(true);
|
||||
ui->radio_manual_encoder->setChecked(false);
|
||||
ui->layout_encoder_config->setVisible(false);
|
||||
|
||||
rectangles.push_back(QRectF(0, 0, 1, 1));
|
||||
std::pair<int, int> config{0, 0};
|
||||
encoder_config.push_back(QVariant::fromValue(config));
|
||||
}
|
||||
|
||||
ui->partitionner->set_rectangles(rectangles);
|
||||
ui->partitionner->set_rectangles_data(encoder_config);
|
||||
|
||||
if (rectangles.size() == 1)
|
||||
{
|
||||
ui->partitionner->set_selected_index(0);
|
||||
// Force updating the combo boxes, if the selected index is already 0 the signal is not called
|
||||
selected_rectangle_changed(0);
|
||||
}
|
||||
else
|
||||
ui->partitionner->set_selected_index(-1);
|
||||
|
||||
// Foveation
|
||||
try
|
||||
{
|
||||
if (json_doc.contains("scale"))
|
||||
{
|
||||
ui->slider_foveation->setValue(std::round((1 - json_doc.value("scale", 1.0)) * 100));
|
||||
ui->spin_foveation->setValue(std::round((1 - json_doc.value("scale", 1.0)) * 100));
|
||||
ui->radio_auto_foveation->setChecked(false);
|
||||
ui->radio_manual_foveation->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->radio_auto_foveation->setChecked(true);
|
||||
ui->radio_manual_foveation->setChecked(false);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ui->radio_auto_foveation->setChecked(true);
|
||||
ui->radio_manual_foveation->setChecked(false);
|
||||
}
|
||||
|
||||
// Bitrate
|
||||
try
|
||||
{
|
||||
ui->bitrate->setValue(json_doc.value("bitrate", 50'000'000.0) / 1'000'000);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ui->bitrate->setValue(50);
|
||||
}
|
||||
|
||||
// Automatically started application
|
||||
std::vector<std::string> application;
|
||||
try
|
||||
{
|
||||
if (json_doc["application"].is_array())
|
||||
application = json_doc.value<std::vector<std::string>>("application", {});
|
||||
else if (json_doc["application"].is_string())
|
||||
application.push_back(json_doc["application"]);
|
||||
|
||||
int game_index = 0;
|
||||
if (application.size() == 2 and application[0] == "steam")
|
||||
{
|
||||
auto url = application[1];
|
||||
|
||||
// Indices 0 and 1 are None and Custom
|
||||
for (int i = 2, n = ui->combo_select_game->count(); i < n; i++)
|
||||
{
|
||||
QVariant data = ui->combo_select_game->itemData(i);
|
||||
if (data.value<steam_app>().url == url)
|
||||
{
|
||||
game_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (game_index == 0 and not application.empty())
|
||||
{
|
||||
game_index = 1;
|
||||
set_application(application);
|
||||
}
|
||||
|
||||
ui->combo_select_game->setCurrentIndex(game_index);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ui->combo_select_game->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
// Update the compatible codecs
|
||||
on_selected_encoder_changed();
|
||||
|
||||
// Update the status text
|
||||
on_encoder_settings_changed();
|
||||
}
|
||||
|
||||
void settings::save_settings()
|
||||
{
|
||||
// Remove all optional keys that might not be overwritten
|
||||
auto it = json_doc.find("scale");
|
||||
if (it != json_doc.end())
|
||||
json_doc.erase(it);
|
||||
|
||||
it = json_doc.find("encoders.disabled");
|
||||
if (it != json_doc.end())
|
||||
json_doc.erase(it);
|
||||
|
||||
it = json_doc.find("encoders");
|
||||
if (it != json_doc.end())
|
||||
json_doc.erase(it);
|
||||
|
||||
it = json_doc.find("application");
|
||||
if (it != json_doc.end())
|
||||
json_doc.erase(it);
|
||||
|
||||
if (not ui->radio_auto_foveation->isChecked())
|
||||
json_doc["scale"] = 1 - ui->slider_foveation->value() / 100.0;
|
||||
|
||||
json_doc["bitrate"] = static_cast<int>(ui->bitrate->value() * 1'000'000);
|
||||
|
||||
std::vector<nlohmann::json> encoders;
|
||||
|
||||
const auto & rect = ui->partitionner->rectangles();
|
||||
const auto & data = ui->partitionner->rectangles_data();
|
||||
|
||||
for (int i = 0, n = rect.size(); i < n; i++)
|
||||
{
|
||||
nlohmann::json encoder;
|
||||
auto [encoder_id, codec_id] = data[i].value<std::pair<int, int>>();
|
||||
|
||||
if (auto value = encoder_from_id(encoder_id); value != "auto")
|
||||
encoder["encoder"] = value;
|
||||
|
||||
if (auto value = codec_from_id(codec_id); value != "auto")
|
||||
encoder["codec"] = value;
|
||||
|
||||
encoder["width"] = rect[i].width();
|
||||
encoder["height"] = rect[i].height();
|
||||
encoder["offset_x"] = rect[i].x();
|
||||
encoder["offset_y"] = rect[i].y();
|
||||
|
||||
// TODO encoder groups
|
||||
|
||||
encoders.push_back(encoder);
|
||||
}
|
||||
|
||||
std::ranges::stable_sort(encoders, [](const nlohmann::json & i, const nlohmann::json & j) {
|
||||
double size_i = i.value("width", 0.0) * i.value("height", 0.0);
|
||||
double size_j = j.value("width", 0.0) * j.value("height", 0.0);
|
||||
return size_i < size_j;
|
||||
});
|
||||
|
||||
// If there is only one automatic encoder, don't save it
|
||||
if (encoders.size() != 1 or encoders[0].contains("codec") or encoders[0].contains("encoder"))
|
||||
{
|
||||
if (ui->radio_manual_encoder->isChecked())
|
||||
json_doc["encoders"] = encoders;
|
||||
else
|
||||
json_doc["encoders.disabled"] = encoders;
|
||||
}
|
||||
|
||||
if (ui->combo_select_game->currentIndex() == 0)
|
||||
{
|
||||
}
|
||||
else if (ui->combo_select_game->currentIndex() == 1)
|
||||
{
|
||||
json_doc["application"] = application();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto app = qvariant_cast<steam_app>(ui->combo_select_game->currentData());
|
||||
|
||||
nlohmann::json application;
|
||||
application.push_back("steam");
|
||||
application.push_back(app.url);
|
||||
json_doc["application"] = application;
|
||||
}
|
||||
|
||||
server_interface->setJsonConfiguration(QString::fromStdString(json_doc.dump(2)));
|
||||
}
|
||||
|
||||
#include "moc_settings.cpp"
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class Settings;
|
||||
}
|
||||
class wivrn_server;
|
||||
|
||||
class settings : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Ui::Settings * ui;
|
||||
wivrn_server * server_interface;
|
||||
|
||||
nlohmann::json json_doc;
|
||||
|
||||
void selected_rectangle_changed(int);
|
||||
|
||||
public:
|
||||
settings(wivrn_server * server_interface);
|
||||
~settings();
|
||||
|
||||
private:
|
||||
void on_encoder_settings_changed();
|
||||
void on_selected_encoder_changed();
|
||||
void on_selected_game_changed(int index);
|
||||
void on_browse_game();
|
||||
void load_settings();
|
||||
void save_settings();
|
||||
void restore_defaults();
|
||||
|
||||
void fill_steam_games_list();
|
||||
|
||||
void set_application(const std::vector<std::string> & app);
|
||||
std::vector<std::string> application();
|
||||
};
|
||||
@@ -1,768 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Settings</class>
|
||||
<widget class="QDialog" name="Settings">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>960</width>
|
||||
<height>762</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>960</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>939</width>
|
||||
<height>1035</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="17" column="1" colspan="3">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2">
|
||||
<widget class="QRadioButton" name="radio_manual_foveation">
|
||||
<property name="text">
|
||||
<string comment="Foveation">Manual</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">group_foveation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Weaker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Stronger</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="4">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="16" column="1">
|
||||
<widget class="QLabel" name="bitrate_label">
|
||||
<property name="text">
|
||||
<string>Bitrate:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>bitrate</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Foveation strength:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="2">
|
||||
<widget class="QRadioButton" name="radio_auto_encoder">
|
||||
<property name="text">
|
||||
<string comment="Encoder">Automatic</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">group_encoder</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QPushButton" name="button_game_browse">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Encoder configuration:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="2">
|
||||
<widget class="QRadioButton" name="radio_manual_encoder">
|
||||
<property name="text">
|
||||
<string comment="Encoder">Manual</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">group_encoder</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="1" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<widget class="QRadioButton" name="radio_auto_foveation">
|
||||
<property name="text">
|
||||
<string comment="Foveation">Automatic</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">group_foveation</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1" colspan="2">
|
||||
<widget class="QWidget" name="layout_encoder_config" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>Drag an edge to resize or remove encoders.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="rectangle_partitionner" name="partitionner">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Sunken</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="encoder_label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Encoder</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>encoder</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="encoder">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>No encoder selected</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>nvenc (NVIDIA GPUs)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>vaapi (AMD and Intel GPUs)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>x264 (software encoding)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>vulkan (Vulkan Video)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="codec">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>No encoder selected</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Auto</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">H.264</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">H.265</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">AV1</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="message">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>220</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="codec_label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Codec</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>codec</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Application to start when a headset connects</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2">
|
||||
<widget class="QSlider" name="slider_foveation">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TickPosition::TicksBelow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1" colspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="3">
|
||||
<widget class="QSpinBox" name="spin_foveation">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> %</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="5">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QComboBox" name="combo_select_game"/>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLineEdit" name="edit_game_path">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="bitrate">
|
||||
<property name="suffix">
|
||||
<string> Mbit/s</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>200.000000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>WiVRn settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="12" column="1" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.
|
||||
|
||||
A weaker foveation gives a uniform sharpness in the whole image.
|
||||
|
||||
The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>6</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok|QDialogButtonBox::StandardButton::RestoreDefaults</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>6</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>rectangle_partitionner</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>rectangle_partitionner.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>encoder</tabstop>
|
||||
<tabstop>codec</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>Settings</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>260</x>
|
||||
<y>1185</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Settings</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>328</x>
|
||||
<y>1185</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>slider_foveation</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>spin_foveation</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>888</x>
|
||||
<y>530</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>1049</x>
|
||||
<y>521</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>spin_foveation</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>slider_foveation</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>1049</x>
|
||||
<y>521</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>888</x>
|
||||
<y>530</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radio_manual_foveation</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>slider_foveation</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>888</x>
|
||||
<y>496</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>888</x>
|
||||
<y>530</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radio_manual_foveation</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>spin_foveation</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>888</x>
|
||||
<y>496</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>1049</x>
|
||||
<y>521</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radio_manual_encoder</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>layout_encoder_config</receiver>
|
||||
<slot>setVisible(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>805</x>
|
||||
<y>664</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>825</x>
|
||||
<y>818</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="group_foveation"/>
|
||||
<buttongroup name="group_encoder"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "steam_app.h"
|
||||
#include "utils/flatpak.h"
|
||||
#include <QProcess>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string read_vr_manifest()
|
||||
{
|
||||
const char * home = getenv("HOME");
|
||||
|
||||
std::filesystem::path vrmanifest = std::string{home ? home : ""} + "/.steam/steam/config/steamapps.vrmanifest";
|
||||
|
||||
if (wivrn::flatpak_key(wivrn::flatpak::section::session_bus_policy, "org.freedesktop.Flatpak") == "talk")
|
||||
{
|
||||
QProcess flatpak_spawn;
|
||||
flatpak_spawn.start("flatpak-spawn", {"--host", "cat", QString::fromStdString(vrmanifest)});
|
||||
flatpak_spawn.waitForFinished();
|
||||
return flatpak_spawn.readAllStandardOutput().toStdString();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ifstream f(vrmanifest);
|
||||
std::istreambuf_iterator<char> begin{f}, end;
|
||||
|
||||
return {begin, end};
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::vector<steam_app> steam_apps(const std::string & locale)
|
||||
{
|
||||
std::vector<steam_app> apps;
|
||||
|
||||
auto manifest = read_vr_manifest();
|
||||
if (manifest.empty())
|
||||
{
|
||||
return apps;
|
||||
}
|
||||
|
||||
nlohmann::json json;
|
||||
try
|
||||
{
|
||||
json = nlohmann::json::parse(manifest);
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
std::cerr << e.what() << std::endl;
|
||||
return apps;
|
||||
}
|
||||
|
||||
for (auto & i: json["applications"])
|
||||
{
|
||||
try
|
||||
{
|
||||
steam_app app;
|
||||
|
||||
app.image_path = i.value("image_path", "");
|
||||
app.name = i["strings"]["en_us"]["name"];
|
||||
|
||||
if (i["launch_type"] == "url")
|
||||
{
|
||||
app.url = i["url"];
|
||||
}
|
||||
else if (i["launch_type"] == "binary")
|
||||
{
|
||||
std::string app_key = i["app_key"];
|
||||
|
||||
const char prefix[] = "steam.app.";
|
||||
if (app_key.starts_with(prefix))
|
||||
{
|
||||
// ¯\_(ツ)_/¯
|
||||
uint64_t appkey = stoll(app_key.substr(strlen(prefix)));
|
||||
app.url = "steam://rungameid/" + std::to_string((appkey << 32) + 0x2000000);
|
||||
}
|
||||
}
|
||||
|
||||
if (app.url != "")
|
||||
apps.push_back(app);
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
std::cerr << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::ranges::sort(apps, [](const steam_app & a, const steam_app & b) {
|
||||
return a.name < b.name;
|
||||
});
|
||||
|
||||
return apps;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct steam_app
|
||||
{
|
||||
std::string name;
|
||||
std::string image_path;
|
||||
std::string url;
|
||||
};
|
||||
|
||||
std::vector<steam_app> steam_apps(const std::string & locale = "en_us");
|
||||
@@ -1,872 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="146"/>
|
||||
<source>Start</source>
|
||||
<translation>Start</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="213"/>
|
||||
<source>Stop</source>
|
||||
<translation>Stop</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="203"/>
|
||||
<source>Settings</source>
|
||||
<translation>Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="241"/>
|
||||
<source>For Steam games, set the launch options to:</source>
|
||||
<oldsource>For Steam games, set the command to:</oldsource>
|
||||
<translation>For Steam games, set the launch options to:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="259"/>
|
||||
<source>Copy to clipboard</source>
|
||||
<translation>Copy to clipboard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="333"/>
|
||||
<source>Disconnect</source>
|
||||
<translation>Disconnect</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="449"/>
|
||||
<source>Field of view</source>
|
||||
<translation>Field of view</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="470"/>
|
||||
<source>Microphone</source>
|
||||
<translation>Microphone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="442"/>
|
||||
<source>Speaker</source>
|
||||
<translation>Speaker</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="14"/>
|
||||
<source>WiVRn dashboard</source>
|
||||
<translation>WiVRn dashboard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="46"/>
|
||||
<source><html><head/><body><p>The server does not have CAP_SYS_NICE capabilities. Click <a href="setcap"><span style=" text-decoration: underline; color:#2980b9;">here</span></a> to grant it.</p></body></html></source>
|
||||
<translation><html><head/><body><p>The server does not have CAP_SYS_NICE capabilities. Click <a href="setcap"><span style=" text-decoration: underline; color:#2980b9;">here</span></a> to grant it.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="84"/>
|
||||
<source><html><head/><body><p>The <a href="https://github.com/WiVRn/WiVRn/issues/180"><span style=" text-decoration: underline; color:#2980b9;">Monado NVIDIA layer</span></a> is not installed.</p></body></html></source>
|
||||
<translation><html><head/><body><p>The <a href="https://github.com/WiVRn/WiVRn/issues/180"><span style=" text-decoration: underline; color:#2980b9;">Monado NVIDIA layer</span></a> is not installed.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="104"/>
|
||||
<source>Server status</source>
|
||||
<oldsource>Server</oldsource>
|
||||
<translation>Server status</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="139"/>
|
||||
<source>Stopped</source>
|
||||
<translation>Stopped</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="196"/>
|
||||
<source>Running</source>
|
||||
<translation>Running</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="319"/>
|
||||
<source>Connect by USB</source>
|
||||
<translation>Connect by USB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="385"/>
|
||||
<source>Pair headset</source>
|
||||
<translation>Pair headset</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="392"/>
|
||||
<source>Cancel</source>
|
||||
<translation>Cancel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="399"/>
|
||||
<source>Manage headsets</source>
|
||||
<oldsource>Known headsets</oldsource>
|
||||
<translation>Manage headsets</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="428"/>
|
||||
<source>Eye gaze tracking</source>
|
||||
<translation>Eye gaze tracking</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="491"/>
|
||||
<source>Hand tracking</source>
|
||||
<translation>Hand tracking</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="484"/>
|
||||
<source>Supported codecs</source>
|
||||
<translation>Supported codecs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="505"/>
|
||||
<source>Face tracking</source>
|
||||
<translation>Face tracking</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="477"/>
|
||||
<source>Available refresh rates</source>
|
||||
<translation>Available refresh rates</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="435"/>
|
||||
<source>Eye resolution</source>
|
||||
<translation>Eye resolution</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="498"/>
|
||||
<source>Preferred refresh rate</source>
|
||||
<translation>Preferred refresh rate</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="644"/>
|
||||
<source>&Exit</source>
|
||||
<translation>&Exit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="628"/>
|
||||
<source>&Show</source>
|
||||
<translation>&Show</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="299"/>
|
||||
<source>Headset status</source>
|
||||
<translation>Headset status</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="326"/>
|
||||
<source>Wizard</source>
|
||||
<translation>Wizard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="343"/>
|
||||
<source>Details</source>
|
||||
<translation>Details</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="602"/>
|
||||
<source>About</source>
|
||||
<translation>About</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="612"/>
|
||||
<source>Exit</source>
|
||||
<translation>Exit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="636"/>
|
||||
<source>&Hide</source>
|
||||
<translation>&Hide</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageHeadsets</name>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="14"/>
|
||||
<source>Manage headsets</source>
|
||||
<translation>Manage headsets</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="41"/>
|
||||
<source>Remove</source>
|
||||
<translation>Remove</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="51"/>
|
||||
<source>Close</source>
|
||||
<translation>Close</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cpp" line="53"/>
|
||||
<source>WiVRn dashboard</source>
|
||||
<translation>WiVRn dashboard</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QWizard</name>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="335"/>
|
||||
<source>&Next ></source>
|
||||
<comment>do not translate, the QWizard translation will be used</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
<message>
|
||||
<location filename="settings.ui" line="14"/>
|
||||
<source>Settings</source>
|
||||
<translation>Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="117"/>
|
||||
<source>Bitrate:</source>
|
||||
<oldsource>Bi&trate:</oldsource>
|
||||
<translation>Bitrate:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="130"/>
|
||||
<source>Foveation strength:</source>
|
||||
<translation>Foveation strength:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="173"/>
|
||||
<source>Manual</source>
|
||||
<oldsource>&Manual</oldsource>
|
||||
<comment>Encoder</comment>
|
||||
<translation>Manual</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>You can drag an edge to resize or remove encoders.</p></body></html></source>
|
||||
<oldsource><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>You can drag an edge to resize or remove an encoder.</p></body></html></oldsource>
|
||||
<translation type="vanished"><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>You can drag an edge to resize or remove encoders.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="291"/>
|
||||
<source>nvenc (NVIDIA GPUs)</source>
|
||||
<translation>nvenc (NVIDIA GPUs)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="296"/>
|
||||
<source>vaapi (AMD and Intel GPUs)</source>
|
||||
<translation>vaapi (AMD and Intel GPUs)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="301"/>
|
||||
<source>x264 (software encoding)</source>
|
||||
<translation>x264 (software encoding)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="60"/>
|
||||
<source>Manual</source>
|
||||
<oldsource>&Manual</oldsource>
|
||||
<comment>Foveation</comment>
|
||||
<translation>Manual</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="306"/>
|
||||
<source>vulkan (Vulkan Video)</source>
|
||||
<translation>vulkan (Vulkan Video)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="386"/>
|
||||
<source>Application to start when a headset connects</source>
|
||||
<translation>Application to start when a headset connects</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="463"/>
|
||||
<source>Path</source>
|
||||
<translation>Path</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="163"/>
|
||||
<source>Encoder configuration:</source>
|
||||
<translation>Encoder configuration:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.</p><p>A weaker foveation gives a uniform sharpness in the whole image.</p><p>The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</p></body></html></source>
|
||||
<translation type="vanished"><html><head/><body><p>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.</p><p>A weaker foveation gives a uniform sharpness in the whole image.</p><p>The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="72"/>
|
||||
<source>Weaker</source>
|
||||
<translation>Weaker</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="92"/>
|
||||
<source>Stronger</source>
|
||||
<translation>Stronger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="218"/>
|
||||
<source><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>Drag an edge to resize or remove encoders.</p></body></html></source>
|
||||
<translation><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>Drag an edge to resize or remove encoders.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="266"/>
|
||||
<source>Encoder</source>
|
||||
<translation>Encoder</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="282"/>
|
||||
<location filename="settings.ui" line="320"/>
|
||||
<source>No encoder selected</source>
|
||||
<translation>No encoder selected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="286"/>
|
||||
<location filename="settings.ui" line="324"/>
|
||||
<source>Auto</source>
|
||||
<translation>Auto</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="140"/>
|
||||
<source>Automatic</source>
|
||||
<comment>Encoder</comment>
|
||||
<translation>Automatic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="574"/>
|
||||
<source>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.
|
||||
|
||||
A weaker foveation gives a uniform sharpness in the whole image.
|
||||
|
||||
The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</source>
|
||||
<translation>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.
|
||||
|
||||
A weaker foveation gives a uniform sharpness in the whole image.
|
||||
|
||||
The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="196"/>
|
||||
<source>Automatic</source>
|
||||
<oldsource>Au&tomatic</oldsource>
|
||||
<comment>Foveation</comment>
|
||||
<translation>Automatic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="549"/>
|
||||
<source>WiVRn settings</source>
|
||||
<translation>WiVRn settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="369"/>
|
||||
<source>Codec</source>
|
||||
<translation>Codec</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="492"/>
|
||||
<source> Mbit/s</source>
|
||||
<translation> Mbit/s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You can use several encoders in order to split the workload between your CPU and your GPU and reduce the latency.</source>
|
||||
<translation type="vanished">You can use several encoders in order to split the workload between your CPU and your GPU and reduce the latency.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You can choose a game to be started automatically when the headset connects.</source>
|
||||
<translation type="vanished">You can choose a game to be started automatically when the headset connects.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="156"/>
|
||||
<source>Browse</source>
|
||||
<translation>Browse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="437"/>
|
||||
<source> %</source>
|
||||
<translation> %</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Wizard</name>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="14"/>
|
||||
<source>Connection wizard</source>
|
||||
<translation>Connection wizard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="21"/>
|
||||
<source>Welcome</source>
|
||||
<translation>Welcome</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="61"/>
|
||||
<source>Select your headset</source>
|
||||
<translation>Select your headset</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="83"/>
|
||||
<source>Getting latest release information...</source>
|
||||
<translation>Getting latest release information...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="223"/>
|
||||
<location filename="wizard.ui" line="318"/>
|
||||
<source>Install the WiVRn app on your headset</source>
|
||||
<translation>Install the WiVRn app on your headset</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="46"/>
|
||||
<source>You will need to have the WiVRn client installed on your headset. If the client is already installed, click "Skip".</source>
|
||||
<oldsource>You will need to have the WiVRn client installed on your headset.</oldsource>
|
||||
<translation>You will need to have the WiVRn client installed on your headset. If the client is already installed, click "Skip".</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="96"/>
|
||||
<source>I want to sideload the client instead</source>
|
||||
<translation>I want to sideload the client instead</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="114"/>
|
||||
<source>Go to the store to install the client app on your headset.</source>
|
||||
<translation>Go to the store to install the client app on your headset.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Once this is done, click "Next".</source>
|
||||
<oldsource>Once this is done, click next.</oldsource>
|
||||
<translation type="obsolete">Once this is done, click next.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="159"/>
|
||||
<source>Downloading the WiVRn app</source>
|
||||
<translation>Downloading the WiVRn app</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="193"/>
|
||||
<source>Cancel</source>
|
||||
<translation>Cancel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="202"/>
|
||||
<source>Downloading</source>
|
||||
<translation>Downloading</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="250"/>
|
||||
<source>Make sure your headset is in developer mode to continue.</source>
|
||||
<translation>Make sure your headset is in developer mode to continue.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Run the following command to install the client:</source>
|
||||
<oldsource>Run the following command to install the client</oldsource>
|
||||
<translation type="vanished">Run the following command to install the client:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="545"/>
|
||||
<source>Copy to clipboard</source>
|
||||
<translation>Copy to clipboard</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="379"/>
|
||||
<source>Start the WiVRn app and connect to this computer</source>
|
||||
<translation>Start the WiVRn app and connect to this computer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="340"/>
|
||||
<source>Installing...</source>
|
||||
<translation>Installing...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="446"/>
|
||||
<source>Use the following PIN to connect your headset:</source>
|
||||
<translation>Use the following PIN to connect your headset:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="468"/>
|
||||
<source>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</source>
|
||||
<translation>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="495"/>
|
||||
<source>Finished</source>
|
||||
<translation>Finished</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="520"/>
|
||||
<source>You can now start an OpenXR application on this computer.</source>
|
||||
<translation>You can now start an OpenXR application on this computer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="527"/>
|
||||
<source>For Steam games, set the launch options to:</source>
|
||||
<oldsource>For Steam games, set the command to:</oldsource>
|
||||
<translation>For Steam games, set the launch options to:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main_window</name>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="350"/>
|
||||
<source>&Show GUI</source>
|
||||
<translation>&Show GUI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="351"/>
|
||||
<source>&Hide GUI</source>
|
||||
<translation>&Hide GUI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="352"/>
|
||||
<source>&Exit</source>
|
||||
<translation>&Exit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="500"/>
|
||||
<source>You have to restart the WiVRn server to use the CAP_SYS_NICE capability.
|
||||
Do you want to restart it now?</source>
|
||||
<translation>You have to restart the WiVRn server to use the CAP_SYS_NICE capability.
|
||||
Do you want to restart it now?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="504"/>
|
||||
<source>This will disconnect the currently connected headset.</source>
|
||||
<translation>This will disconnect the currently connected headset.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="507"/>
|
||||
<source>Restart WiVRn</source>
|
||||
<translation>Restart WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="525"/>
|
||||
<source>Cannot start setcap: %1</source>
|
||||
<translation>Cannot start setcap: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="591"/>
|
||||
<source>%1 ⨯ %2</source>
|
||||
<translation>%1 ⨯ %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="598"/>
|
||||
<location filename="main_window.cpp" line="605"/>
|
||||
<source>%1 Hz</source>
|
||||
<translation>%1 Hz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="610"/>
|
||||
<location filename="main_window.cpp" line="615"/>
|
||||
<location filename="main_window.cpp" line="632"/>
|
||||
<source>Supported</source>
|
||||
<translation>Supported</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="610"/>
|
||||
<location filename="main_window.cpp" line="615"/>
|
||||
<location filename="main_window.cpp" line="632"/>
|
||||
<source>Not supported</source>
|
||||
<translation>Not supported</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="622"/>
|
||||
<source>Left eye: %1° ⨯ %2°, right eye: %3° ⨯ %4°</source>
|
||||
<translation>Left eye: %1° ⨯ %2°, right eye: %3° ⨯ %4°</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="main_window.cpp" line="641"/>
|
||||
<location filename="main_window.cpp" line="652"/>
|
||||
<source>%n channel(s), %1 Hz</source>
|
||||
<oldsource>%1 channel(s), %2 Hz</oldsource>
|
||||
<translation>
|
||||
<numerusform>%n channel, %1 Hz</numerusform>
|
||||
<numerusform>%n channels, %1 Hz</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="643"/>
|
||||
<location filename="main_window.cpp" line="654"/>
|
||||
<source>N/A</source>
|
||||
<translation>N/A</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="672"/>
|
||||
<source>To pair your headset use the following PIN: %1</source>
|
||||
<translation>To pair your headset use the following PIN: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="698"/>
|
||||
<source>Cannot connect to avahi, make sure avahi-daemon service is started with "disable-user-service-publishing" set to no</source>
|
||||
<translation>Cannot connect to avahi, make sure avahi-daemon service is started with "disable-user-service-publishing" set to no</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="827"/>
|
||||
<source>The WiVRn app is not installed on your headset.</source>
|
||||
<translation>The WiVRn app is not installed on your headset.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The WiVRn app is not installed on your headset.
|
||||
Do you want to install it?</source>
|
||||
<translation type="vanished">The WiVRn app is not installed on your headset.
|
||||
Do you want to install it?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WiVRn</source>
|
||||
<translation type="obsolete">WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="725"/>
|
||||
<source>Failed to start</source>
|
||||
<translation>Failed to start</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="728"/>
|
||||
<source>Crashed</source>
|
||||
<translation>Crashed</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="731"/>
|
||||
<source>Time out</source>
|
||||
<translation>Time out</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="734"/>
|
||||
<source>Read error</source>
|
||||
<translation>Read error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="737"/>
|
||||
<source>Write error</source>
|
||||
<oldsource>write error</oldsource>
|
||||
<translation>Write error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="740"/>
|
||||
<source>Unknown error</source>
|
||||
<translation>Unknown error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Server error</source>
|
||||
<translation type="vanished">Server error</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="746"/>
|
||||
<source>Failed to start server:
|
||||
%1</source>
|
||||
<translation>Failed to start server:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="687"/>
|
||||
<source>Unknown error (%1), check logs</source>
|
||||
<translation>Unknown error (%1), check logs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="405"/>
|
||||
<source>No device detected</source>
|
||||
<translation>No device detected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="348"/>
|
||||
<source>Start the WiVRn app on your headset and connect to "%1".</source>
|
||||
<translation>Start the WiVRn app on your headset and connect to "%1".</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="348"/>
|
||||
<source>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</source>
|
||||
<translation>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="567"/>
|
||||
<source>Connected</source>
|
||||
<translation>Connected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="572"/>
|
||||
<source>Not connected</source>
|
||||
<translation>Not connected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot connect to avahi, make sure avahi-daemon service is started</source>
|
||||
<oldsource>Cannot connect to avahi, make sure avahi_daemon.service is started</oldsource>
|
||||
<translation type="vanished">Cannot connect to avahi, make sure avahi-daemon service is started</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="695"/>
|
||||
<source>Insufficient system resources</source>
|
||||
<translation>Insufficient system resources</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="704"/>
|
||||
<source>Server crashed:
|
||||
%1</source>
|
||||
<translation>Server crashed:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="767"/>
|
||||
<source>Timeout starting server</source>
|
||||
<translation>Timeout starting server</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>settings</name>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="449"/>
|
||||
<source>Invalid settings</source>
|
||||
<translation>Invalid settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="449"/>
|
||||
<source>The encoder configuration is invalid, the default values will be restored.</source>
|
||||
<translation>The encoder configuration is invalid, the default values will be restored.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="217"/>
|
||||
<source>None</source>
|
||||
<comment>Game selection combo box</comment>
|
||||
<translation>None</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="218"/>
|
||||
<source>Custom...</source>
|
||||
<comment>Game selection combo box</comment>
|
||||
<translation>Custom...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="286"/>
|
||||
<source>Not all headsets and GPUs support AV1
|
||||
</source>
|
||||
<translation>Not all headsets and GPUs support AV1
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="291"/>
|
||||
<source>Vulkan Video encoder is experimental
|
||||
</source>
|
||||
<translation>Vulkan Video encoder is experimental
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="322"/>
|
||||
<source>Select game</source>
|
||||
<translation>Select game</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>wizard</name>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="333"/>
|
||||
<location filename="wizard.cpp" line="373"/>
|
||||
<source>Download</source>
|
||||
<translation>Download</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="142"/>
|
||||
<source>Other</source>
|
||||
<translation>Other</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="158"/>
|
||||
<source>This is not a tagged release.</source>
|
||||
<translation>This is not a tagged release.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="160"/>
|
||||
<location filename="wizard.cpp" line="220"/>
|
||||
<source>If you install the headset app from the store, it might not be compatible with this server.</source>
|
||||
<translation>If you install the headset app from the store, it might not be compatible with this server.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="162"/>
|
||||
<location filename="wizard.cpp" line="222"/>
|
||||
<source>If you install the headset app manually, this wizard will download the version that matches the dashboard.</source>
|
||||
<translation>If you install the headset app manually, this wizard will download the version that matches the dashboard.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="213"/>
|
||||
<source>This is the latest WiVRn release.</source>
|
||||
<translation>This is the latest WiVRn release.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="218"/>
|
||||
<source>A new release is available (%1 → %2).</source>
|
||||
<translation>A new release is available (%1 → %2).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="228"/>
|
||||
<source>Cannot get latest release: %1</source>
|
||||
<translation>Cannot get latest release: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="248"/>
|
||||
<source>There is no precompiled APK for this version.</source>
|
||||
<translation>There is no precompiled APK for this version.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="250"/>
|
||||
<source>Follow the <a href="https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset"><span style="text-decoration: underline; color:#2980b9;">documentation</span></a> to build your own client.</source>
|
||||
<translation>Follow the <a href="https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset"><span style="text-decoration: underline; color:#2980b9;">documentation</span></a> to build your own client.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="283"/>
|
||||
<source>Cannot get APK information: %1</source>
|
||||
<translation>Cannot get APK information: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="306"/>
|
||||
<source>How?</source>
|
||||
<translation>How?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="374"/>
|
||||
<location filename="wizard.cpp" line="402"/>
|
||||
<source>Skip</source>
|
||||
<translation>Skip</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="455"/>
|
||||
<source>Start the WiVRn app on your headset and connect to "%1".</source>
|
||||
<translation>Start the WiVRn app on your headset and connect to "%1".</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="595"/>
|
||||
<source>No device detected.</source>
|
||||
<translation>No device detected.</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="wizard.cpp" line="597"/>
|
||||
<source>%n device(s) detected.</source>
|
||||
<translation>
|
||||
<numerusform>%n device detected.</numerusform>
|
||||
<numerusform>%n devices detected.</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Downloading</source>
|
||||
<translation type="vanished">Downloading</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download aborted</source>
|
||||
<translation type="vanished">Download aborted</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WiVRn</source>
|
||||
<translation type="vanished">WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="545"/>
|
||||
<source>Error downloading the client:
|
||||
%1</source>
|
||||
<translation>Error downloading the client:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download error: %1</source>
|
||||
<oldsource>Download error: %</oldsource>
|
||||
<translation type="vanished">Download error: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="695"/>
|
||||
<source>The headset is connected.</source>
|
||||
<translation>The headset is connected.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="697"/>
|
||||
<source>The headset is not connected.</source>
|
||||
<translation>The headset is not connected.</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -1,872 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="fr_FR">
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="146"/>
|
||||
<source>Start</source>
|
||||
<translation>Démarrer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="213"/>
|
||||
<source>Stop</source>
|
||||
<translation>Arrêter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="203"/>
|
||||
<source>Settings</source>
|
||||
<translation>Paramètres</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="241"/>
|
||||
<source>For Steam games, set the launch options to:</source>
|
||||
<oldsource>For Steam games, set the command to:</oldsource>
|
||||
<translation>Pour les jeux Steam, définir les options de lancement à :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="259"/>
|
||||
<source>Copy to clipboard</source>
|
||||
<translation>Copier dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="333"/>
|
||||
<source>Disconnect</source>
|
||||
<translation>Déconnecter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="449"/>
|
||||
<source>Field of view</source>
|
||||
<translation>Champ de vue</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="470"/>
|
||||
<source>Microphone</source>
|
||||
<translation>Microphone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="442"/>
|
||||
<source>Speaker</source>
|
||||
<translation>Haut-parleur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="14"/>
|
||||
<source>WiVRn dashboard</source>
|
||||
<translation>Tableau de bord de WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="46"/>
|
||||
<source><html><head/><body><p>The server does not have CAP_SYS_NICE capabilities. Click <a href="setcap"><span style=" text-decoration: underline; color:#2980b9;">here</span></a> to grant it.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Le serveur n'a pas la capacité CAP_SYS_NICE. Cliquez <a href="setcap"><span style=" text-decoration: underline; color:#2980b9;">ici</span></a> pour la donner.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="84"/>
|
||||
<source><html><head/><body><p>The <a href="https://github.com/WiVRn/WiVRn/issues/180"><span style=" text-decoration: underline; color:#2980b9;">Monado NVIDIA layer</span></a> is not installed.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Le <a href="https://github.com/WiVRn/WiVRn/issues/180"><span style=" text-decoration: underline; color:#2980b9;">layer Monado NVIDIA</span></a> n'est pas installé.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="104"/>
|
||||
<source>Server status</source>
|
||||
<oldsource>Server</oldsource>
|
||||
<translation>État du serveur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="139"/>
|
||||
<source>Stopped</source>
|
||||
<translation>Arrêté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="196"/>
|
||||
<source>Running</source>
|
||||
<translation>Démarré</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="319"/>
|
||||
<source>Connect by USB</source>
|
||||
<translation>Connexion par USB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="385"/>
|
||||
<source>Pair headset</source>
|
||||
<translation>Appairer le casque</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="392"/>
|
||||
<source>Cancel</source>
|
||||
<translation>Annuler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="399"/>
|
||||
<source>Manage headsets</source>
|
||||
<oldsource>Known headsets</oldsource>
|
||||
<translation>Casques</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="428"/>
|
||||
<source>Eye gaze tracking</source>
|
||||
<translation>Suivi des yeux</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="491"/>
|
||||
<source>Hand tracking</source>
|
||||
<translation>Suivi des mains</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="484"/>
|
||||
<source>Supported codecs</source>
|
||||
<translation>Codecs supportés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="505"/>
|
||||
<source>Face tracking</source>
|
||||
<translation>Suivi du visage</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="477"/>
|
||||
<source>Available refresh rates</source>
|
||||
<translation>Taux de rafraîchissment disponibles</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="435"/>
|
||||
<source>Eye resolution</source>
|
||||
<translation>Résolution par œil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="498"/>
|
||||
<source>Preferred refresh rate</source>
|
||||
<translation>Taux de rafraîchisement préféré</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="644"/>
|
||||
<source>&Exit</source>
|
||||
<translation>&Quitter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="628"/>
|
||||
<source>&Show</source>
|
||||
<translation>&Afficher</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="299"/>
|
||||
<source>Headset status</source>
|
||||
<translation>État du casque</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="326"/>
|
||||
<source>Wizard</source>
|
||||
<translation>Assistant</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="343"/>
|
||||
<source>Details</source>
|
||||
<translation>Détails</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="602"/>
|
||||
<source>About</source>
|
||||
<translation>À propos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="612"/>
|
||||
<source>Exit</source>
|
||||
<translation>Quitter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.ui" line="636"/>
|
||||
<source>&Hide</source>
|
||||
<translation>&Cacher</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ManageHeadsets</name>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="14"/>
|
||||
<source>Manage headsets</source>
|
||||
<translation>Casques</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="41"/>
|
||||
<source>Remove</source>
|
||||
<translation>Supprimer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="manage_headsets.ui" line="51"/>
|
||||
<source>Close</source>
|
||||
<translation>Fermer</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="main.cpp" line="53"/>
|
||||
<source>WiVRn dashboard</source>
|
||||
<translation>Tableau de bord de WiVRn</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QWizard</name>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="335"/>
|
||||
<source>&Next ></source>
|
||||
<comment>do not translate, the QWizard translation will be used</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
<message>
|
||||
<location filename="settings.ui" line="14"/>
|
||||
<source>Settings</source>
|
||||
<translation>Paramètres</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="117"/>
|
||||
<source>Bitrate:</source>
|
||||
<oldsource>Bi&trate:</oldsource>
|
||||
<translation>Débit :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="130"/>
|
||||
<source>Foveation strength:</source>
|
||||
<translation>Intensité de la fovéation:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="173"/>
|
||||
<source>Manual</source>
|
||||
<oldsource>&Manual</oldsource>
|
||||
<comment>Encoder</comment>
|
||||
<translation>Manuelle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>You can drag an edge to resize or remove encoders.</p></body></html></source>
|
||||
<oldsource><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>You can drag an edge to resize or remove an encoder.</p></body></html></oldsource>
|
||||
<translation type="vanished"><html><head/><body><p>Pour ajouter un encodeur, découpez un encodeur existant en cliquant près d'un bord.</p><p>Vous pouvez déplacer un bord pour redimensionner ou supprimer un encodeur.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="291"/>
|
||||
<source>nvenc (NVIDIA GPUs)</source>
|
||||
<translation>nvenc (GPUs NVIDIA)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="296"/>
|
||||
<source>vaapi (AMD and Intel GPUs)</source>
|
||||
<translation>vaapi (GPUs AMD et Intel)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="301"/>
|
||||
<source>x264 (software encoding)</source>
|
||||
<translation>x264 (encodage logiciel)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="60"/>
|
||||
<source>Manual</source>
|
||||
<oldsource>&Manual</oldsource>
|
||||
<comment>Foveation</comment>
|
||||
<translation>Manuelle</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="306"/>
|
||||
<source>vulkan (Vulkan Video)</source>
|
||||
<translation>vulkan (Vulkan Vidéo)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="386"/>
|
||||
<source>Application to start when a headset connects</source>
|
||||
<translation>Application à démarrer quand un casque est connecté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="463"/>
|
||||
<source>Path</source>
|
||||
<translation>Chemin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="163"/>
|
||||
<source>Encoder configuration:</source>
|
||||
<translation>Configuration de l'encodeur:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.</p><p>A weaker foveation gives a uniform sharpness in the whole image.</p><p>The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</p></body></html></source>
|
||||
<translation type="vanished"><html><head/><body><p>Une fovéation plus forte rend l'image plus nette au centre qu'en périphérie et accélère le décodage. C'est un meilleur choix pour les jeux rapides.</p><p>Une fovéation plus faible donne une netteté uniforme sur toute l'image.</p><p>Les valeurs recommandées sont entre 20% et 50% pour les casques sans suivi des yeux et entre 50% et 70% pour les casques avec suivi des yeux.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="72"/>
|
||||
<source>Weaker</source>
|
||||
<translation>Plus faible</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="92"/>
|
||||
<source>Stronger</source>
|
||||
<translation>Plus forte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="218"/>
|
||||
<source><html><head/><body><p>To add a new encoder, split an existing encoder by clicking near an edge.</p><p>Drag an edge to resize or remove encoders.</p></body></html></source>
|
||||
<translation><html><head/><body><p>Pour ajouter un encodeur, découpez un encodeur existant en cliquant près d'un bord.</p><p>Déplacez un bord pour redimensionner ou supprimer un encodeur.</p></body></html></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="266"/>
|
||||
<source>Encoder</source>
|
||||
<translation>Encodeur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="282"/>
|
||||
<location filename="settings.ui" line="320"/>
|
||||
<source>No encoder selected</source>
|
||||
<translation>Aucun encodeur sélectionné</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="286"/>
|
||||
<location filename="settings.ui" line="324"/>
|
||||
<source>Auto</source>
|
||||
<translation>Automatique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="140"/>
|
||||
<source>Automatic</source>
|
||||
<comment>Encoder</comment>
|
||||
<translation>Automatique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="574"/>
|
||||
<source>A stronger foveation makes the image sharper in the center than in the periphery and makes the decoding faster. This is better for fast paced games.
|
||||
|
||||
A weaker foveation gives a uniform sharpness in the whole image.
|
||||
|
||||
The recommended values are between 20% and 50% for headsets without eye tracking and between 50% and 70% for headsets with eye tracking.</source>
|
||||
<translation>Une fovéation plus forte rend l'image plus nette au centre qu'en périphérie et accélère le décodage. C'est un meilleur choix pour les jeux rapides.
|
||||
|
||||
Une fovéation plus faible donne une netteté uniforme sur toute l'image.
|
||||
|
||||
Les valeurs recommandées sont entre 20% et 50% pour les casques sans suivi des yeux et entre 50% et 70% pour les casques avec suivi des yeux.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="196"/>
|
||||
<source>Automatic</source>
|
||||
<oldsource>Au&tomatic</oldsource>
|
||||
<comment>Foveation</comment>
|
||||
<translation>Automatique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="549"/>
|
||||
<source>WiVRn settings</source>
|
||||
<translation>Paramètres de WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="369"/>
|
||||
<source>Codec</source>
|
||||
<translation>Codec</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="492"/>
|
||||
<source> Mbit/s</source>
|
||||
<translation> Mbit/s</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You can use several encoders in order to split the workload between your CPU and your GPU and reduce the latency.</source>
|
||||
<translation type="vanished">Vous pouvez utiliser plusieurs encodeurs pour partager le travail entre votre CPU et votre GPU et réduire la latence.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You can choose a game to be started automatically when the headset connects.</source>
|
||||
<translation type="vanished">Vous pouvez choisir un jeu à démarrer automatiquement quand le casque est connecté.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="156"/>
|
||||
<source>Browse</source>
|
||||
<translation>Parcourir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.ui" line="437"/>
|
||||
<source> %</source>
|
||||
<translation> %</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Wizard</name>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="14"/>
|
||||
<source>Connection wizard</source>
|
||||
<translation>Assistant de connexion</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="21"/>
|
||||
<source>Welcome</source>
|
||||
<translation>Bienvenue</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="61"/>
|
||||
<source>Select your headset</source>
|
||||
<translation>Choisissez votre casque</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="83"/>
|
||||
<source>Getting latest release information...</source>
|
||||
<translation>Récupération de la dernière version...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="223"/>
|
||||
<location filename="wizard.ui" line="318"/>
|
||||
<source>Install the WiVRn app on your headset</source>
|
||||
<translation>Installation de l'application WiVRn sur votre casque</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="46"/>
|
||||
<source>You will need to have the WiVRn client installed on your headset. If the client is already installed, click "Skip".</source>
|
||||
<oldsource>You will need to have the WiVRn client installed on your headset.</oldsource>
|
||||
<translation>Vous aurez besoin d'avoir le client WiVRn installé sur votre casque. Si le client est déjà installé, cliquez sur « Passer ».</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="96"/>
|
||||
<source>I want to sideload the client instead</source>
|
||||
<translation>Je préfère installer le client manuellement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="114"/>
|
||||
<source>Go to the store to install the client app on your headset.</source>
|
||||
<translation>Allez sur la boutique pour installer l'application client sur votre casque.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Once this is done, click "Next".</source>
|
||||
<oldsource>Once this is done, click next.</oldsource>
|
||||
<translation type="obsolete">Une fois que c'est fait, cliquez sur suivant.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="159"/>
|
||||
<source>Downloading the WiVRn app</source>
|
||||
<translation>Téléchargement de l'application WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="193"/>
|
||||
<source>Cancel</source>
|
||||
<translation>Annuler</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="202"/>
|
||||
<source>Downloading</source>
|
||||
<translation>Téléchargement en cours</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="250"/>
|
||||
<source>Make sure your headset is in developer mode to continue.</source>
|
||||
<translation>Assurez-vous que le casque soit en mode développeur pour continuer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Run the following command to install the client:</source>
|
||||
<oldsource>Run the following command to install the client</oldsource>
|
||||
<translation type="vanished">Exécutez la commande suivante pour installer le client:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="545"/>
|
||||
<source>Copy to clipboard</source>
|
||||
<translation>Copier dans le presse-papier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="379"/>
|
||||
<source>Start the WiVRn app and connect to this computer</source>
|
||||
<translation>Démarrez l'appli WiVRn et connectez-vous à cet ordinateur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="340"/>
|
||||
<source>Installing...</source>
|
||||
<translation>Installation en cours...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="446"/>
|
||||
<source>Use the following PIN to connect your headset:</source>
|
||||
<translation>Utilisez ce code PIN pour connecter votre casque :</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="468"/>
|
||||
<source>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</source>
|
||||
<translation>Si le serveur n'est pas visible ou que la connexion échoue, vérifiez que les ports 5353 (UDP) et 9757 (TCP et UDP) sont ouverts dans votre pare-feu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="495"/>
|
||||
<source>Finished</source>
|
||||
<translation>Terminé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="520"/>
|
||||
<source>You can now start an OpenXR application on this computer.</source>
|
||||
<translation>Vous pouvez maintenant démarrer une application OpenXR sur cet ordinateur.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.ui" line="527"/>
|
||||
<source>For Steam games, set the launch options to:</source>
|
||||
<oldsource>For Steam games, set the command to:</oldsource>
|
||||
<translation>Pour les jeux Steam, définir les options de lancement à :</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>main_window</name>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="350"/>
|
||||
<source>&Show GUI</source>
|
||||
<translation>&Afficher la GUI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="351"/>
|
||||
<source>&Hide GUI</source>
|
||||
<translation>&Cacher la GUI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="352"/>
|
||||
<source>&Exit</source>
|
||||
<translation>&Quitter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="500"/>
|
||||
<source>You have to restart the WiVRn server to use the CAP_SYS_NICE capability.
|
||||
Do you want to restart it now?</source>
|
||||
<translation>Vous devez redémarrer le serveur WiVRn pour utiliser la capacité CAP_SYS_NICE.
|
||||
Voulez-vous le redémarrer maintenant?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="504"/>
|
||||
<source>This will disconnect the currently connected headset.</source>
|
||||
<translation>Cela va déconnecter le casque actuellement connecté.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="507"/>
|
||||
<source>Restart WiVRn</source>
|
||||
<translation>Redémarrer WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="525"/>
|
||||
<source>Cannot start setcap: %1</source>
|
||||
<translation>Impossible de démarrer setcap: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="591"/>
|
||||
<source>%1 ⨯ %2</source>
|
||||
<translation>%1 ⨯ %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="598"/>
|
||||
<location filename="main_window.cpp" line="605"/>
|
||||
<source>%1 Hz</source>
|
||||
<translation>%1 Hz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="610"/>
|
||||
<location filename="main_window.cpp" line="615"/>
|
||||
<location filename="main_window.cpp" line="632"/>
|
||||
<source>Supported</source>
|
||||
<translation>Supporté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="610"/>
|
||||
<location filename="main_window.cpp" line="615"/>
|
||||
<location filename="main_window.cpp" line="632"/>
|
||||
<source>Not supported</source>
|
||||
<translation>Non supporté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="622"/>
|
||||
<source>Left eye: %1° ⨯ %2°, right eye: %3° ⨯ %4°</source>
|
||||
<translation>Œil gauche: %1° ⨯ %2°, œil droit: %3° ⨯ %4°</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="main_window.cpp" line="641"/>
|
||||
<location filename="main_window.cpp" line="652"/>
|
||||
<source>%n channel(s), %1 Hz</source>
|
||||
<oldsource>%1 channel(s), %2 Hz</oldsource>
|
||||
<translation>
|
||||
<numerusform>%n canal, %1 Hz</numerusform>
|
||||
<numerusform>%n canaux, %1 Hz</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="643"/>
|
||||
<location filename="main_window.cpp" line="654"/>
|
||||
<source>N/A</source>
|
||||
<translation>Non disponible</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="672"/>
|
||||
<source>To pair your headset use the following PIN: %1</source>
|
||||
<translation>Pour connecter votre casque utilisez ce code PIN : %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="698"/>
|
||||
<source>Cannot connect to avahi, make sure avahi-daemon service is started with "disable-user-service-publishing" set to no</source>
|
||||
<translation>Impossible de se connecter à avahi, vérifiez que le service avahi-daemon est démarré avec « disable-user-service-publishing » à « no »</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="827"/>
|
||||
<source>The WiVRn app is not installed on your headset.</source>
|
||||
<translation>L'application WiVRn n'est pas installée sur votre casque.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The WiVRn app is not installed on your headset.
|
||||
Do you want to install it?</source>
|
||||
<translation type="vanished">L'application WiVRn n'est pas installée sur votre casque.
|
||||
Voulez-vous l'installer ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WiVRn</source>
|
||||
<translation type="obsolete">WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="725"/>
|
||||
<source>Failed to start</source>
|
||||
<translation>Impossible de démarrer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="728"/>
|
||||
<source>Crashed</source>
|
||||
<translation>Planté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="731"/>
|
||||
<source>Time out</source>
|
||||
<translation>Délai d'attente dépassé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="734"/>
|
||||
<source>Read error</source>
|
||||
<translation>Erreur de lecture</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="737"/>
|
||||
<source>Write error</source>
|
||||
<oldsource>write error</oldsource>
|
||||
<translation>Erreur d'écriture</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="740"/>
|
||||
<source>Unknown error</source>
|
||||
<translation>Erreur inconnue</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Server error</source>
|
||||
<translation type="vanished">Erreur du serveur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="746"/>
|
||||
<source>Failed to start server:
|
||||
%1</source>
|
||||
<translation>Impossible de démarrer le serveur:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="687"/>
|
||||
<source>Unknown error (%1), check logs</source>
|
||||
<translation>Erreur inconnue (%1), vérifier les logs</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="405"/>
|
||||
<source>No device detected</source>
|
||||
<translation>Aucun périphérique détecté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="348"/>
|
||||
<source>Start the WiVRn app on your headset and connect to "%1".</source>
|
||||
<translation>Démarrez l'application WiVRn sur votre casque et connectez-vous à « %1 ».</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="348"/>
|
||||
<source>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</source>
|
||||
<translation>Si le serveur n'est pas visible ou que la connexion échoue, vérifiez que les ports 5353 (UDP) et 9757 (TCP et UDP) sont ouverts dans votre pare-feu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="567"/>
|
||||
<source>Connected</source>
|
||||
<translation>Connecté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="572"/>
|
||||
<source>Not connected</source>
|
||||
<translation>Non connecté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot connect to avahi, make sure avahi-daemon service is started</source>
|
||||
<oldsource>Cannot connect to avahi, make sure avahi_daemon.service is started</oldsource>
|
||||
<translation type="vanished">Impossible de se connecter à avahi, vérifiez que le service avahi-daemon est démarré</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="695"/>
|
||||
<source>Insufficient system resources</source>
|
||||
<translation>Ressources système insuffisantes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="704"/>
|
||||
<source>Server crashed:
|
||||
%1</source>
|
||||
<translation>Le serveur a planté:
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="main_window.cpp" line="767"/>
|
||||
<source>Timeout starting server</source>
|
||||
<translation>Délai d'attente dépassé lors du démarrage du serveur</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>settings</name>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="449"/>
|
||||
<source>Invalid settings</source>
|
||||
<translation>Paramètres invalides</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="449"/>
|
||||
<source>The encoder configuration is invalid, the default values will be restored.</source>
|
||||
<translation>La configuration des encodeurs est invalide, les valeurs par défaut seront restaurées.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="217"/>
|
||||
<source>None</source>
|
||||
<comment>Game selection combo box</comment>
|
||||
<translation>Aucun</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="218"/>
|
||||
<source>Custom...</source>
|
||||
<comment>Game selection combo box</comment>
|
||||
<translation>Personnalisé...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="286"/>
|
||||
<source>Not all headsets and GPUs support AV1
|
||||
</source>
|
||||
<translation>Tous les casques et GPUs ne supportent pas AV1
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="291"/>
|
||||
<source>Vulkan Video encoder is experimental
|
||||
</source>
|
||||
<translation>L'encodeur Vulkan Vidéo est expérimental
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="settings.cpp" line="322"/>
|
||||
<source>Select game</source>
|
||||
<translation>Choisir un jeu</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>wizard</name>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="333"/>
|
||||
<location filename="wizard.cpp" line="373"/>
|
||||
<source>Download</source>
|
||||
<translation>Télécharger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="142"/>
|
||||
<source>Other</source>
|
||||
<translation>Autre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="158"/>
|
||||
<source>This is not a tagged release.</source>
|
||||
<translation>Ce n'est pas une version taguée.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="160"/>
|
||||
<location filename="wizard.cpp" line="220"/>
|
||||
<source>If you install the headset app from the store, it might not be compatible with this server.</source>
|
||||
<translation>Si vous installez l'application du casque depuis le store, il risque de ne pas être compatible avec ce serveur.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="162"/>
|
||||
<location filename="wizard.cpp" line="222"/>
|
||||
<source>If you install the headset app manually, this wizard will download the version that matches the dashboard.</source>
|
||||
<translation>Si vous installez l'application du casque manuellement, l'assistant va télécharger la version correspondant au tableau de bord.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="213"/>
|
||||
<source>This is the latest WiVRn release.</source>
|
||||
<translation>Ceci est la dernière version de WiVRn.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="218"/>
|
||||
<source>A new release is available (%1 → %2).</source>
|
||||
<translation>Une nouvelle version est disponible (%1 → %2).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="228"/>
|
||||
<source>Cannot get latest release: %1</source>
|
||||
<translation>Impossible de récupérer la dernière version: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="248"/>
|
||||
<source>There is no precompiled APK for this version.</source>
|
||||
<translation>Il n'y a pas d'APK précompilé pour cette version.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="250"/>
|
||||
<source>Follow the <a href="https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset"><span style="text-decoration: underline; color:#2980b9;">documentation</span></a> to build your own client.</source>
|
||||
<translation>Suivez la <a href="https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset"><span style="text-decoration: underline; color:#2980b9;">documentation</span></a> pour compiler votre propre client.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="283"/>
|
||||
<source>Cannot get APK information: %1</source>
|
||||
<translation>Impossible de récupérer les informations sur l'APK: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="306"/>
|
||||
<source>How?</source>
|
||||
<translation>Comment ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="374"/>
|
||||
<location filename="wizard.cpp" line="402"/>
|
||||
<source>Skip</source>
|
||||
<translation>Passer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="455"/>
|
||||
<source>Start the WiVRn app on your headset and connect to "%1".</source>
|
||||
<translation>Démarrez l'application WiVRn sur votre casque et connectez-vous à « %1 ».</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="595"/>
|
||||
<source>No device detected.</source>
|
||||
<translation>Aucun périphérique détecté.</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="wizard.cpp" line="597"/>
|
||||
<source>%n device(s) detected.</source>
|
||||
<translation>
|
||||
<numerusform>%n périphérique détecté.</numerusform>
|
||||
<numerusform>%n périphériques détectés.</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Downloading</source>
|
||||
<translation type="vanished">Téléchargement en cours</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download aborted</source>
|
||||
<translation type="vanished">Téléchargement annulé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WiVRn</source>
|
||||
<translation type="vanished">WiVRn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="545"/>
|
||||
<source>Error downloading the client:
|
||||
%1</source>
|
||||
<translation>Erreur lors du téléchargement du client :
|
||||
%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download error: %1</source>
|
||||
<oldsource>Download error: %</oldsource>
|
||||
<translation type="vanished">Erreur lors du téléchargement :%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="695"/>
|
||||
<source>The headset is connected.</source>
|
||||
<translation>Le casque est connecté.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="wizard.cpp" line="697"/>
|
||||
<source>The headset is not connected.</source>
|
||||
<translation>Le casque n'est pas connecté.</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Same as XrFovf
|
||||
struct field_of_view
|
||||
{
|
||||
float angleLeft;
|
||||
float angleRight;
|
||||
float angleUp;
|
||||
float angleDown;
|
||||
};
|
||||
@@ -1,302 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "wivrn_server.h"
|
||||
#include "wivrn_server_dbus.h"
|
||||
|
||||
Q_DECLARE_METATYPE(field_of_view)
|
||||
|
||||
wivrn_server::wivrn_server(QObject * parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
dbus_watcher.setConnection(QDBusConnection::sessionBus());
|
||||
dbus_watcher.addWatchedService("io.github.wivrn.Server");
|
||||
|
||||
connect(&dbus_watcher, &QDBusServiceWatcher::serviceRegistered, this, &wivrn_server::on_server_dbus_registered);
|
||||
connect(&dbus_watcher, &QDBusServiceWatcher::serviceUnregistered, this, &wivrn_server::on_server_dbus_unregistered);
|
||||
|
||||
const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames();
|
||||
if (services.contains("io.github.wivrn.Server"))
|
||||
on_server_dbus_registered();
|
||||
}
|
||||
|
||||
wivrn_server::~wivrn_server()
|
||||
{
|
||||
}
|
||||
|
||||
void wivrn_server::on_server_dbus_registered()
|
||||
{
|
||||
if (server_interface)
|
||||
server_interface->deleteLater();
|
||||
if (server_properties_interface)
|
||||
server_properties_interface->deleteLater();
|
||||
|
||||
server_interface = new IoGithubWivrnServerInterface("io.github.wivrn.Server", "/io/github/wivrn/Server", QDBusConnection::sessionBus(), this);
|
||||
server_properties_interface = new OrgFreedesktopDBusPropertiesInterface("io.github.wivrn.Server", "/io/github/wivrn/Server", QDBusConnection::sessionBus(), this);
|
||||
|
||||
connect(server_properties_interface, &OrgFreedesktopDBusPropertiesInterface::PropertiesChanged, this, &wivrn_server::on_server_properties_changed);
|
||||
|
||||
serverRunningChanged(m_serverRunning = true);
|
||||
refresh_server_properties();
|
||||
}
|
||||
|
||||
void wivrn_server::on_server_dbus_unregistered()
|
||||
{
|
||||
if (server_interface)
|
||||
server_interface->deleteLater();
|
||||
server_interface = nullptr;
|
||||
|
||||
if (server_properties_interface)
|
||||
server_properties_interface->deleteLater();
|
||||
server_properties_interface = nullptr;
|
||||
|
||||
serverRunningChanged(m_serverRunning = false);
|
||||
|
||||
if (isHeadsetConnected())
|
||||
headsetConnectedChanged(m_headsetConnected = false);
|
||||
}
|
||||
|
||||
void wivrn_server::refresh_server_properties()
|
||||
{
|
||||
if (!server_properties_interface)
|
||||
return;
|
||||
|
||||
QDBusPendingReply<QVariantMap> props_pending = server_properties_interface->GetAll("io.github.wivrn.Server");
|
||||
|
||||
if (get_all_properties_call_watcher)
|
||||
get_all_properties_call_watcher->deleteLater();
|
||||
get_all_properties_call_watcher = new QDBusPendingCallWatcher{props_pending, this};
|
||||
|
||||
connect(get_all_properties_call_watcher, &QDBusPendingCallWatcher::finished, [this, props_pending]() {
|
||||
on_server_properties_changed("io.github.wivrn.Server", props_pending.value(), {});
|
||||
});
|
||||
}
|
||||
|
||||
void wivrn_server::on_server_properties_changed(const QString & interface_name, const QVariantMap & changed_properties, const QStringList & invalidated_properties)
|
||||
{
|
||||
if (interface_name != IoGithubWivrnServerInterface::staticInterfaceName())
|
||||
return;
|
||||
|
||||
if (changed_properties.contains("HeadsetConnected"))
|
||||
{
|
||||
headsetConnectedChanged(m_headsetConnected = changed_properties["HeadsetConnected"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("JsonConfiguration"))
|
||||
{
|
||||
m_jsonConfiguration = changed_properties["JsonConfiguration"].toString();
|
||||
}
|
||||
|
||||
if (changed_properties.contains("Pin"))
|
||||
{
|
||||
pinChanged(m_pin = changed_properties["Pin"].toString());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("KnownKeys"))
|
||||
{
|
||||
m_knownKeys.clear();
|
||||
|
||||
const auto keys = qvariant_cast<QDBusArgument>(changed_properties["KnownKeys"]);
|
||||
keys.beginArray();
|
||||
|
||||
while (not keys.atEnd())
|
||||
{
|
||||
keys.beginStructure();
|
||||
QString public_key;
|
||||
QString name;
|
||||
keys >> name >> public_key;
|
||||
keys.endStructure();
|
||||
|
||||
m_knownKeys.push_back(HeadsetKey{public_key, name});
|
||||
}
|
||||
keys.endArray();
|
||||
|
||||
knownKeysChanged(m_knownKeys);
|
||||
}
|
||||
|
||||
if (changed_properties.contains("PairingEnabled"))
|
||||
{
|
||||
pairingEnabledChanged(m_isPairingEnabled = changed_properties["PairingEnabled"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("EncryptionEnabled"))
|
||||
{
|
||||
encryptionEnabledChanged(m_isEncryptionEnabled = changed_properties["EncryptionEnabled"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("RecommendedEyeSize"))
|
||||
{
|
||||
const auto arg = qvariant_cast<QDBusArgument>(changed_properties["RecommendedEyeSize"]);
|
||||
|
||||
arg.beginStructure();
|
||||
arg >> m_recommendedEyeSize.rwidth() >> m_recommendedEyeSize.rheight();
|
||||
arg.endStructure();
|
||||
recommendedEyeSizeChanged(m_recommendedEyeSize);
|
||||
}
|
||||
|
||||
if (changed_properties.contains("AvailableRefreshRates"))
|
||||
{
|
||||
const auto rates = qvariant_cast<QDBusArgument>(changed_properties["AvailableRefreshRates"]);
|
||||
|
||||
m_availableRefreshRates.clear();
|
||||
rates.beginArray();
|
||||
while (!rates.atEnd())
|
||||
{
|
||||
double element;
|
||||
rates >> element;
|
||||
m_availableRefreshRates.push_back(element);
|
||||
}
|
||||
rates.endArray();
|
||||
|
||||
availableRefreshRatesChanged(m_availableRefreshRates);
|
||||
}
|
||||
|
||||
if (changed_properties.contains("PreferredRefreshRate"))
|
||||
{
|
||||
preferredRefreshRateChanged(m_preferredRefreshRate = changed_properties["PreferredRefreshRate"].toFloat());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("EyeGaze"))
|
||||
{
|
||||
eyeGazeChanged(m_eyeGaze = changed_properties["EyeGaze"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("FaceTracking"))
|
||||
{
|
||||
faceTrackingChanged(m_faceTracking = changed_properties["FaceTracking"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("FieldOfView"))
|
||||
{
|
||||
const auto fovs = qvariant_cast<QDBusArgument>(changed_properties["FieldOfView"]);
|
||||
fovs.beginArray();
|
||||
|
||||
QStringList fov_str;
|
||||
m_fieldOfView.clear();
|
||||
while (!fovs.atEnd())
|
||||
{
|
||||
fovs.beginStructure();
|
||||
double left, right, up, down;
|
||||
fovs >> left >> right >> up >> down;
|
||||
fovs.endStructure();
|
||||
m_fieldOfView.push_back(field_of_view(left, right, up, down));
|
||||
}
|
||||
fovs.endArray();
|
||||
|
||||
fieldOfViewChanged(m_fieldOfView);
|
||||
}
|
||||
|
||||
if (changed_properties.contains("HandTracking"))
|
||||
{
|
||||
handTrackingChanged(m_handTracking = changed_properties["HandTracking"].toBool());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("MicChannels"))
|
||||
{
|
||||
micChannelsChanged(m_micChannels = changed_properties["MicChannels"].toInt());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("MicSampleRate"))
|
||||
{
|
||||
micSampleRateChanged(m_micSampleRate = changed_properties["MicSampleRate"].toInt());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("SpeakerChannels"))
|
||||
{
|
||||
speakerChannelsChanged(m_speakerChannels = changed_properties["SpeakerChannels"].toInt());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("SpeakerSampleRate"))
|
||||
{
|
||||
speakerSampleRateChanged(m_speakerSampleRate = changed_properties["SpeakerSampleRate"].toInt());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("SupportedCodecs"))
|
||||
{
|
||||
supportedCodecsChanged(m_supportedCodecs = changed_properties["SupportedCodecs"].toStringList());
|
||||
}
|
||||
|
||||
if (changed_properties.contains("SteamCommand"))
|
||||
{
|
||||
steamCommandChanged(m_steamCommand = changed_properties["SteamCommand"].toString());
|
||||
}
|
||||
}
|
||||
|
||||
void wivrn_server::setJsonConfiguration(QString new_configuration)
|
||||
{
|
||||
server_interface->setJsonConfiguration(m_jsonConfiguration = new_configuration);
|
||||
}
|
||||
|
||||
void wivrn_server::revoke_key(QString public_key)
|
||||
{
|
||||
server_interface->RevokeKey(public_key);
|
||||
}
|
||||
|
||||
void wivrn_server::rename_key(QString public_key, QString name)
|
||||
{
|
||||
server_interface->RenameKey(public_key, name);
|
||||
}
|
||||
|
||||
QString wivrn_server::enable_pairing(int timeout_secs)
|
||||
{
|
||||
return server_interface->EnablePairing(timeout_secs).value();
|
||||
}
|
||||
|
||||
void wivrn_server::disable_pairing()
|
||||
{
|
||||
server_interface->DisablePairing();
|
||||
}
|
||||
|
||||
QString wivrn_server::hostname()
|
||||
{
|
||||
static auto _hostname = []() -> QString {
|
||||
OrgFreedesktopDBusPropertiesInterface hostname1("org.freedesktop.hostname1", "/org/freedesktop/hostname1", QDBusConnection::systemBus());
|
||||
|
||||
for (auto property: {"PrettyHostname", "StaticHostname", "Hostname"})
|
||||
{
|
||||
QString name = hostname1.Get("org.freedesktop.hostname1", property).value().variant().toString();
|
||||
|
||||
if (name != "")
|
||||
return name;
|
||||
};
|
||||
|
||||
char buf[HOST_NAME_MAX];
|
||||
int code = gethostname(buf, sizeof(buf));
|
||||
if (code == 0)
|
||||
return buf;
|
||||
|
||||
qDebug() << "Failed to get hostname";
|
||||
return "no-hostname";
|
||||
}();
|
||||
|
||||
return _hostname;
|
||||
}
|
||||
|
||||
void wivrn_server::disconnect_headset()
|
||||
{
|
||||
if (server_interface)
|
||||
server_interface->Disconnect();
|
||||
}
|
||||
|
||||
void wivrn_server::quit()
|
||||
{
|
||||
if (server_interface)
|
||||
server_interface->Quit();
|
||||
}
|
||||
|
||||
#include "moc_wivrn_server.cpp"
|
||||
@@ -1,244 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDBusPendingCallWatcher>
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <QObject>
|
||||
#include <QSize>
|
||||
|
||||
#include "wivrn_qdbus_types.h"
|
||||
|
||||
class IoGithubWivrnServerInterface;
|
||||
class OrgFreedesktopDBusPropertiesInterface;
|
||||
|
||||
class wivrn_server : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
IoGithubWivrnServerInterface * server_interface = nullptr;
|
||||
OrgFreedesktopDBusPropertiesInterface * server_properties_interface = nullptr;
|
||||
QDBusServiceWatcher dbus_watcher;
|
||||
QDBusPendingCallWatcher * get_all_properties_call_watcher = nullptr;
|
||||
|
||||
public:
|
||||
struct HeadsetKey
|
||||
{
|
||||
QString public_key;
|
||||
QString name;
|
||||
};
|
||||
using HeadsetKeys = std::vector<HeadsetKey>;
|
||||
|
||||
wivrn_server(QObject * parent = nullptr);
|
||||
wivrn_server(const wivrn_server &) = delete;
|
||||
wivrn_server & operator=(const wivrn_server &) = delete;
|
||||
~wivrn_server();
|
||||
|
||||
// Server information
|
||||
Q_PROPERTY(bool serverRunning READ isServerRunning NOTIFY serverRunningChanged)
|
||||
Q_PROPERTY(bool headsetConnected READ isHeadsetConnected NOTIFY headsetConnectedChanged)
|
||||
Q_PROPERTY(QString jsonConfiguration READ jsonConfiguration WRITE setJsonConfiguration)
|
||||
|
||||
// Authentication
|
||||
Q_PROPERTY(QString pin READ pin NOTIFY pinChanged)
|
||||
Q_PROPERTY(HeadsetKeys knownKeys READ knownKeys NOTIFY knownKeysChanged)
|
||||
Q_PROPERTY(bool pairingEnabled READ isPairingEnabled NOTIFY pairingEnabledChanged)
|
||||
Q_PROPERTY(bool encryptionEnabled READ isEncryptionEnabled NOTIFY encryptionEnabledChanged)
|
||||
void revoke_key(QString public_key);
|
||||
void rename_key(QString public_key, QString name);
|
||||
QString enable_pairing(int timeout_secs = 120);
|
||||
void disable_pairing();
|
||||
|
||||
// Headset information, valid only if HeadsetConnected is true
|
||||
Q_PROPERTY(QSize recommendedEyeSize READ recommendedEyeSize NOTIFY recommendedEyeSizeChanged)
|
||||
Q_PROPERTY(std::vector<float> availableRefreshRates READ availableRefreshRates NOTIFY availableRefreshRatesChanged)
|
||||
Q_PROPERTY(float preferredRefreshRate READ preferredRefreshRate NOTIFY preferredRefreshRateChanged)
|
||||
Q_PROPERTY(bool eyeGaze READ eyeGaze NOTIFY eyeGazeChanged)
|
||||
Q_PROPERTY(bool faceTracking READ faceTracking NOTIFY faceTrackingChanged)
|
||||
Q_PROPERTY(std::vector<field_of_view> fieldOfView READ fieldOfView NOTIFY fieldOfViewChanged)
|
||||
Q_PROPERTY(bool handTracking READ handTracking NOTIFY handTrackingChanged)
|
||||
Q_PROPERTY(int micChannels READ micChannels NOTIFY micChannelsChanged)
|
||||
Q_PROPERTY(int micSampleRate READ micSampleRate NOTIFY micSampleRateChanged)
|
||||
Q_PROPERTY(int speakerChannels READ speakerChannels NOTIFY speakerChannelsChanged)
|
||||
Q_PROPERTY(int speakerSampleRate READ speakerSampleRate NOTIFY speakerSampleRateChanged)
|
||||
Q_PROPERTY(QStringList supportedCodecs READ supportedCodecs NOTIFY supportedCodecsChanged)
|
||||
Q_PROPERTY(QString steamCommand READ steamCommand NOTIFY steamCommandChanged)
|
||||
|
||||
// hostnamed
|
||||
Q_PROPERTY(QString hostname READ hostname())
|
||||
|
||||
bool isServerRunning() const
|
||||
{
|
||||
return m_serverRunning;
|
||||
}
|
||||
|
||||
bool isHeadsetConnected() const
|
||||
{
|
||||
return m_headsetConnected;
|
||||
}
|
||||
|
||||
QString jsonConfiguration() const
|
||||
{
|
||||
return m_jsonConfiguration;
|
||||
}
|
||||
|
||||
void setJsonConfiguration(QString);
|
||||
|
||||
QString pin() const
|
||||
{
|
||||
return m_pin;
|
||||
}
|
||||
|
||||
HeadsetKeys knownKeys() const
|
||||
{
|
||||
return m_knownKeys;
|
||||
}
|
||||
|
||||
bool isPairingEnabled() const
|
||||
{
|
||||
return m_isPairingEnabled;
|
||||
}
|
||||
|
||||
bool isEncryptionEnabled() const
|
||||
{
|
||||
return m_isEncryptionEnabled;
|
||||
}
|
||||
|
||||
QSize recommendedEyeSize() const
|
||||
{
|
||||
return m_recommendedEyeSize;
|
||||
}
|
||||
|
||||
const std::vector<float> & availableRefreshRates() const
|
||||
{
|
||||
return m_availableRefreshRates;
|
||||
}
|
||||
|
||||
float preferredRefreshRate() const
|
||||
{
|
||||
return m_preferredRefreshRate;
|
||||
}
|
||||
|
||||
bool eyeGaze() const
|
||||
{
|
||||
return m_eyeGaze;
|
||||
}
|
||||
|
||||
bool faceTracking() const
|
||||
{
|
||||
return m_faceTracking;
|
||||
}
|
||||
|
||||
const std::vector<field_of_view> & fieldOfView() const
|
||||
{
|
||||
return m_fieldOfView;
|
||||
}
|
||||
|
||||
bool handTracking() const
|
||||
{
|
||||
return m_handTracking;
|
||||
}
|
||||
|
||||
int micChannels() const
|
||||
{
|
||||
return m_micChannels;
|
||||
}
|
||||
|
||||
int micSampleRate() const
|
||||
{
|
||||
return m_micSampleRate;
|
||||
}
|
||||
|
||||
int speakerChannels() const
|
||||
{
|
||||
return m_speakerChannels;
|
||||
}
|
||||
|
||||
int speakerSampleRate() const
|
||||
{
|
||||
return m_speakerSampleRate;
|
||||
}
|
||||
|
||||
QStringList supportedCodecs() const
|
||||
{
|
||||
return m_supportedCodecs;
|
||||
}
|
||||
|
||||
QString steamCommand() const
|
||||
{
|
||||
return m_steamCommand;
|
||||
}
|
||||
|
||||
QString hostname();
|
||||
|
||||
void disconnect_headset();
|
||||
void quit();
|
||||
|
||||
private:
|
||||
void on_server_dbus_registered();
|
||||
void on_server_dbus_unregistered();
|
||||
void on_server_properties_changed(const QString & interface_name, const QVariantMap & changed_properties, const QStringList & invalidated_properties);
|
||||
|
||||
void refresh_server_properties();
|
||||
|
||||
bool m_serverRunning{};
|
||||
bool m_headsetConnected{};
|
||||
QString m_jsonConfiguration{};
|
||||
|
||||
QString m_pin{};
|
||||
HeadsetKeys m_knownKeys;
|
||||
bool m_isPairingEnabled{};
|
||||
bool m_isEncryptionEnabled{};
|
||||
|
||||
QSize m_recommendedEyeSize{};
|
||||
std::vector<float> m_availableRefreshRates{};
|
||||
float m_preferredRefreshRate{};
|
||||
bool m_eyeGaze{};
|
||||
bool m_faceTracking{};
|
||||
std::vector<field_of_view> m_fieldOfView{};
|
||||
bool m_handTracking{};
|
||||
int m_micChannels{};
|
||||
int m_micSampleRate{};
|
||||
int m_speakerChannels{};
|
||||
int m_speakerSampleRate{};
|
||||
QStringList m_supportedCodecs{};
|
||||
QString m_steamCommand{};
|
||||
|
||||
Q_SIGNALS:
|
||||
void serverRunningChanged(bool);
|
||||
void headsetConnectedChanged(bool);
|
||||
void pinChanged(QString);
|
||||
void knownKeysChanged(HeadsetKeys);
|
||||
void pairingEnabledChanged(bool);
|
||||
void encryptionEnabledChanged(bool);
|
||||
|
||||
void recommendedEyeSizeChanged(QSize);
|
||||
void availableRefreshRatesChanged(const std::vector<float> &);
|
||||
void preferredRefreshRateChanged(float);
|
||||
void eyeGazeChanged(bool);
|
||||
void faceTrackingChanged(bool);
|
||||
void fieldOfViewChanged(const std::vector<field_of_view> &);
|
||||
void handTrackingChanged(bool);
|
||||
void micChannelsChanged(int);
|
||||
void micSampleRateChanged(int);
|
||||
void speakerChannelsChanged(int);
|
||||
void speakerSampleRateChanged(int);
|
||||
void supportedCodecsChanged(QStringList);
|
||||
void steamCommandChanged(QString);
|
||||
};
|
||||
@@ -1,720 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "wizard.h"
|
||||
|
||||
#include <QClipboard>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include <QMetaEnum>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QProcess>
|
||||
#include <QSaveFile>
|
||||
#include <QScrollBar>
|
||||
#include <QStandardPaths>
|
||||
#include <QUrl>
|
||||
#include <QWizard>
|
||||
#include <algorithm>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "adb.h"
|
||||
#include "gui_config.h"
|
||||
#include "ui_wizard.h"
|
||||
#include "version.h"
|
||||
#include "wivrn_server.h"
|
||||
#include <filesystem>
|
||||
#include <regex>
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
enum class wizard_page
|
||||
{
|
||||
select_headset_model,
|
||||
sideload_download,
|
||||
sideload_devmode,
|
||||
sideload_install,
|
||||
connect_hmd,
|
||||
start_game
|
||||
};
|
||||
|
||||
struct headset
|
||||
{
|
||||
QString name;
|
||||
QString devmode_url;
|
||||
QString store_name;
|
||||
QString store_url;
|
||||
};
|
||||
|
||||
static const std::vector<headset> headsets_info = {
|
||||
// clang-format off
|
||||
{"HTC Vive Focus 3", "https://developer.vive.com/resources/hardware-guides/vive-focus-specs-user-guide/how-do-i-put-focus-developer-mode/"},
|
||||
{"HTC Vive XR Elite", "https://developer.vive.com/resources/hardware-guides/vive-focus-specs-user-guide/how-do-i-put-focus-developer-mode/"},
|
||||
{"Meta Quest 1", "https://developers.meta.com/horizon/documentation/native/android/mobile-device-setup/#enable-developer-mode"},
|
||||
{"Meta Quest 2", "https://developers.meta.com/horizon/documentation/native/android/mobile-device-setup/#enable-developer-mode", "Meta Store", "https://www.meta.com/experiences/7959676140827574/"},
|
||||
{"Meta Quest 3", "https://developers.meta.com/horizon/documentation/native/android/mobile-device-setup/#enable-developer-mode", "Meta Store", "https://www.meta.com/experiences/7959676140827574/"},
|
||||
{"Meta Quest Pro", "https://developers.meta.com/horizon/documentation/native/android/mobile-device-setup/#enable-developer-mode", "Meta Store", "https://www.meta.com/experiences/7959676140827574/"},
|
||||
{"Pico Neo 4", "https://developer.picoxr.com/document/unreal/test-and-build/#Enable%20developer%20mode"},
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static constexpr int role_devmode_url = Qt::UserRole + 1;
|
||||
static constexpr int role_store_name = Qt::UserRole + 2;
|
||||
static constexpr int role_store_url = Qt::UserRole + 3;
|
||||
|
||||
// #define TEST 1 // Not in the WiVRn-APK repo
|
||||
// #define TEST 2 // In the WiVRn-APK repo, not a tagged version
|
||||
// #define TEST 3 // Current version
|
||||
// #define TEST 4 // Old version
|
||||
|
||||
#if !defined(TEST) || TEST == 0 // Normal case
|
||||
static const std::string git_version = wivrn::git_version;
|
||||
static const std::string git_commit = wivrn::git_commit;
|
||||
#elif TEST == 1
|
||||
static const std::string git_version = "v0.19.1-60-g66ce2c5";
|
||||
static const std::string git_commit = "66ce2c547dedf9b320af677ed42f32f361b32832";
|
||||
#elif TEST == 2
|
||||
static const std::string git_version = "v0.19.1-59-g0d62929";
|
||||
static const std::string git_commit = "554c0f7ad647d9cd66e380f567f2e842fff6a27a";
|
||||
#elif TEST == 3
|
||||
static const std::string git_version = "v0.19.1";
|
||||
static const std::string git_commit = "bcffadcd4e043d7bacd700b1331c2e98f96ca178";
|
||||
#elif TEST == 4
|
||||
static const std::string git_version = "v0.19";
|
||||
static const std::string git_commit = "d0014823480bc0e54594b74d2475882554ed5829";
|
||||
#endif
|
||||
|
||||
wizard::wizard() :
|
||||
server(new wivrn_server(this))
|
||||
{
|
||||
ui = new Ui::Wizard;
|
||||
ui->setupUi(this);
|
||||
|
||||
retranslate();
|
||||
|
||||
connect(this, &QWizard::currentIdChanged, this, &wizard::on_page_changed);
|
||||
connect(this, &QWizard::customButtonClicked, this, &wizard::on_custom_button_clicked);
|
||||
|
||||
connect(ui->copy_steam_command, &QPushButton::clicked, this, [&]() {
|
||||
QGuiApplication::clipboard()->setText(ui->label_steam_command->text());
|
||||
});
|
||||
|
||||
connect(server, &wivrn_server::headsetConnectedChanged, this, &wizard::on_headset_connected_changed);
|
||||
|
||||
connect(ui->button_cancel_download, &QPushButton::clicked, this, &wizard::cancel_download);
|
||||
|
||||
connect(server, &wivrn_server::steamCommandChanged, this, [this](QString value) {
|
||||
ui->label_steam_command->setText(value);
|
||||
});
|
||||
ui->label_steam_command->setText(server->steamCommand());
|
||||
|
||||
connect(server, &wivrn_server::pinChanged, this, &wizard::on_pin_changed);
|
||||
on_pin_changed(server->pin());
|
||||
|
||||
setPixmap(WatermarkPixmap, QPixmap(":/images/wivrn.svg"));
|
||||
for (const headset & i: headsets_info)
|
||||
{
|
||||
auto item = new QStandardItem(i.name);
|
||||
|
||||
item->setData(i.devmode_url, role_devmode_url);
|
||||
item->setData(i.store_name, role_store_name);
|
||||
item->setData(i.store_url, role_store_url);
|
||||
|
||||
headsets.appendRow(item);
|
||||
}
|
||||
headsets.appendRow(new QStandardItem(tr("Other"))); // TODO retranslatable
|
||||
|
||||
ui->combo_hmd_model->setModel(&headsets);
|
||||
ui->combo_hmd_model->setCurrentIndex(-1);
|
||||
connect(ui->combo_hmd_model, &QComboBox::currentIndexChanged, this, &wizard::update_welcome_page);
|
||||
connect(ui->check_sideload, &QCheckBox::clicked, this, &wizard::update_welcome_page);
|
||||
|
||||
setWindowModality(Qt::WindowModality::ApplicationModal);
|
||||
|
||||
if (std::regex_match(git_version, std::regex(".*-g[0-9a-f]+")))
|
||||
{
|
||||
apk_file.setFileName(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/wivrn-" + QString::fromStdString(git_commit) + ".apk");
|
||||
|
||||
qDebug() << "Not a tagged version" << git_version.c_str();
|
||||
|
||||
ui->label_release_info->setText(
|
||||
tr("This is not a tagged release.") +
|
||||
"\n" +
|
||||
tr("If you install the headset app from the store, it might not be compatible with this server.") +
|
||||
"\n" +
|
||||
tr("If you install the headset app manually, this wizard will download the version that matches the dashboard."));
|
||||
|
||||
std::string url = "https://api.github.com/repos/WiVRn/WiVRn-APK/releases/tags/apk-" + git_commit;
|
||||
qDebug() << "Downloading metadata from" << url.c_str();
|
||||
|
||||
apk_release_reply = manager.get(QNetworkRequest{QUrl{url.c_str()}});
|
||||
connect(apk_release_reply, &QNetworkReply::finished, this, &wizard::on_apk_release_finished);
|
||||
}
|
||||
else
|
||||
{
|
||||
apk_file.setFileName(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/wivrn-" + QString::fromStdString(git_version) + ".apk");
|
||||
|
||||
qDebug() << "Tagged version" << git_version.c_str();
|
||||
|
||||
// Get the current release information
|
||||
std::string url = "https://api.github.com/repos/WiVRn/WiVRn/releases/tags/" + git_version;
|
||||
qDebug() << "Downloading metadata from" << url.c_str();
|
||||
apk_release_reply = manager.get(QNetworkRequest{QUrl{url.c_str()}});
|
||||
connect(apk_release_reply, &QNetworkReply::finished, this, &wizard::on_apk_release_finished);
|
||||
|
||||
// Get the latest release information
|
||||
latest_release_reply = manager.get(QNetworkRequest{QUrl{"https://api.github.com/repos/WiVRn/WiVRn/releases/latest"}});
|
||||
connect(latest_release_reply, &QNetworkReply::finished, this, &wizard::on_latest_release_finished);
|
||||
}
|
||||
|
||||
// Detect connected android devices
|
||||
connect(&adb_service, &adb::android_devices_changed, this, &wizard::on_android_device_list_changed);
|
||||
on_android_device_list_changed(adb_service.devices());
|
||||
|
||||
connect(ui->list_devices, &QListWidget::itemSelectionChanged, this, &wizard::on_selected_android_device_changed);
|
||||
}
|
||||
|
||||
void wizard::on_latest_release_finished()
|
||||
{
|
||||
disconnect(latest_release_reply, &QNetworkReply::finished, this, &wizard::on_latest_release_finished);
|
||||
|
||||
// By default, assume this is the latest release
|
||||
latest_release = git_version;
|
||||
|
||||
try
|
||||
{
|
||||
if (latest_release_reply->error())
|
||||
throw std::runtime_error(latest_release_reply->errorString().toStdString());
|
||||
|
||||
auto json = nlohmann::json::parse(latest_release_reply->readAll());
|
||||
|
||||
latest_release = json["tag_name"];
|
||||
|
||||
if (latest_release == git_version)
|
||||
{
|
||||
// This is already the latest release
|
||||
ui->label_release_info->setText(tr("This is the latest WiVRn release."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->label_release_info->setText(
|
||||
tr("A new release is available (%1 → %2).").arg(QString::fromLatin1(git_version)).arg(QString::fromLatin1(latest_release)) +
|
||||
"\n" +
|
||||
tr("If you install the headset app from the store, it might not be compatible with this server.") +
|
||||
"\n" +
|
||||
tr("If you install the headset app manually, this wizard will download the version that matches the dashboard."));
|
||||
}
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
qWarning() << "Cannot get latest release: " << e.what();
|
||||
ui->label_release_info->setText(tr("Cannot get latest release: %1").arg(e.what()));
|
||||
}
|
||||
|
||||
latest_release_reply->deleteLater();
|
||||
latest_release_reply = nullptr;
|
||||
update_welcome_page();
|
||||
}
|
||||
|
||||
void wizard::on_apk_release_finished()
|
||||
{
|
||||
disconnect(apk_release_reply, &QNetworkReply::finished, this, &wizard::on_apk_release_finished);
|
||||
|
||||
try
|
||||
{
|
||||
auto error = apk_release_reply->error();
|
||||
|
||||
if (error == QNetworkReply::NetworkError::ContentNotFoundError)
|
||||
{
|
||||
ui->label_release_info->setText(
|
||||
"<html><head/><body><p>" +
|
||||
tr("There is no precompiled APK for this version.") +
|
||||
"</p>\n<p>" +
|
||||
tr("Follow the <a href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset\"><span style=\"text-decoration: underline; color:#2980b9;\">documentation</span></a> to build your own client.") +
|
||||
"</p></body></html>");
|
||||
|
||||
ui->combo_hmd_model->setEnabled(false);
|
||||
ui->combo_hmd_model->setCurrentIndex(-1);
|
||||
ui->check_sideload->setEnabled(false);
|
||||
}
|
||||
else if (error != QNetworkReply::NetworkError::NoError)
|
||||
{
|
||||
throw std::runtime_error(apk_release_reply->errorString().toStdString());
|
||||
}
|
||||
else
|
||||
{
|
||||
auto json = nlohmann::json::parse(apk_release_reply->readAll());
|
||||
|
||||
for (auto & i: json["assets"])
|
||||
{
|
||||
std::string name = i["name"];
|
||||
|
||||
if (name.ends_with("-standard-release.apk"))
|
||||
{
|
||||
apk_url = i["browser_download_url"];
|
||||
qDebug() << "Using APK URL" << apk_url.c_str();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
apk_downloaded = QFileInfo(apk_file).exists();
|
||||
}
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
qWarning() << "Cannot get APK information: " << e.what();
|
||||
ui->label_release_info->setText(tr("Cannot get APK information: %1").arg(e.what()));
|
||||
}
|
||||
|
||||
apk_release_reply->deleteLater();
|
||||
apk_release_reply = nullptr;
|
||||
update_welcome_page();
|
||||
}
|
||||
|
||||
void wizard::update_welcome_page()
|
||||
{
|
||||
if (latest_release == "")
|
||||
{
|
||||
// We don't have the latest release information yet
|
||||
ui->widget_store->setVisible(false);
|
||||
ui->check_sideload->setVisible(false);
|
||||
button(NextButton)->setEnabled(false);
|
||||
}
|
||||
|
||||
auto devmode_url = ui->combo_hmd_model->currentData(role_devmode_url).toString();
|
||||
auto store_name = ui->combo_hmd_model->currentData(role_store_name).toString();
|
||||
auto store_url = ui->combo_hmd_model->currentData(role_store_url).toString();
|
||||
|
||||
ui->label_store_url->setText(QString(R"(<html><head/><body><p><a href="%1"><span style="text-decoration: underline; color:#2980b9;">%2</span></a></p></body></html>)").arg(store_url).arg(store_name));
|
||||
ui->label_devmode_url->setText(QString(R"(<html><head/><body><p><a href="%1"><span style="text-decoration: underline; color:#2980b9;">%2</span></a></p></body></html>)").arg(devmode_url).arg(tr("How?")));
|
||||
|
||||
if (ui->combo_hmd_model->currentIndex() < 0)
|
||||
{
|
||||
// No headset selected
|
||||
ui->widget_store->setVisible(false);
|
||||
ui->check_sideload->setVisible(false);
|
||||
button(NextButton)->setEnabled(false);
|
||||
}
|
||||
else if (store_name != "")
|
||||
{
|
||||
// Headset with a link to a store
|
||||
ui->widget_store->setVisible(not ui->check_sideload->isChecked());
|
||||
ui->check_sideload->setVisible(true);
|
||||
button(NextButton)->setEnabled(apk_url != "" or nextId() != (int)wizard_page::sideload_download);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Headset without store
|
||||
ui->widget_store->setVisible(false);
|
||||
ui->check_sideload->setVisible(false);
|
||||
button(NextButton)->setEnabled(apk_url != "");
|
||||
}
|
||||
|
||||
ui->label_devmode_url->setVisible(devmode_url != "");
|
||||
|
||||
if (nextId() == (int)wizard_page::sideload_download and ui->combo_hmd_model->currentIndex() >= 0 and apk_url != "")
|
||||
button(NextButton)->setText(tr("Download"));
|
||||
else
|
||||
button(NextButton)->setText(QWizard::tr("&Next >", "do not translate, the QWizard translation will be used"));
|
||||
}
|
||||
|
||||
void wizard::on_custom_button_clicked(int which)
|
||||
{
|
||||
switch ((wizard_page)currentId())
|
||||
{
|
||||
case wizard_page::select_headset_model:
|
||||
if (which == QWizard::CustomButton1) // Download
|
||||
next();
|
||||
else if (which == QWizard::CustomButton2) // Skip
|
||||
setCurrentId((int)wizard_page::connect_hmd);
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_download:
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_devmode:
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_install:
|
||||
return;
|
||||
|
||||
case wizard_page::connect_hmd:
|
||||
if (which == QWizard::CustomButton1) // Skip
|
||||
next();
|
||||
return;
|
||||
|
||||
case wizard_page::start_game:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_page_changed(int id)
|
||||
{
|
||||
switch ((wizard_page)id)
|
||||
{
|
||||
case wizard_page::select_headset_model:
|
||||
button(WizardButton::CustomButton1)->setText(tr("Download"));
|
||||
button(WizardButton::CustomButton2)->setText(tr("Skip"));
|
||||
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::NextButton, QWizard::CustomButton2, QWizard::CancelButton});
|
||||
update_welcome_page();
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_download:
|
||||
assert(not apk_downloaded);
|
||||
start_download();
|
||||
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::NextButton, QWizard::CancelButton});
|
||||
button(BackButton)->setEnabled(false);
|
||||
button(NextButton)->setEnabled(false);
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_devmode:
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::NextButton, QWizard::CancelButton});
|
||||
button(NextButton)->setEnabled(false);
|
||||
return;
|
||||
|
||||
case wizard_page::sideload_install:
|
||||
start_install();
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::NextButton, QWizard::CancelButton});
|
||||
button(BackButton)->setEnabled(false);
|
||||
button(NextButton)->setEnabled(false);
|
||||
return;
|
||||
|
||||
case wizard_page::connect_hmd:
|
||||
button(WizardButton::CustomButton1)->setText(tr("Skip"));
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::NextButton, QWizard::CustomButton1, QWizard::CancelButton});
|
||||
on_headset_connected_changed(server->isHeadsetConnected());
|
||||
|
||||
if (not server->isPairingEnabled())
|
||||
server->enable_pairing(-1);
|
||||
|
||||
return;
|
||||
|
||||
case wizard_page::start_game:
|
||||
setButtonLayout({QWizard::Stretch, QWizard::BackButton, QWizard::FinishButton, QWizard::CancelButton});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::changeEvent(QEvent * e)
|
||||
{
|
||||
QWidget::changeEvent(e);
|
||||
|
||||
switch (e->type())
|
||||
{
|
||||
case QEvent::LanguageChange:
|
||||
retranslate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int wizard::nextId() const
|
||||
{
|
||||
switch ((wizard_page)currentId())
|
||||
{
|
||||
case wizard_page::select_headset_model:
|
||||
if (ui->combo_hmd_model->currentData(role_store_name).toString() != "" and not ui->check_sideload->isChecked())
|
||||
return (int)wizard_page::connect_hmd;
|
||||
else if (apk_downloaded)
|
||||
return (int)wizard_page::sideload_devmode;
|
||||
else
|
||||
return (int)wizard_page::sideload_download;
|
||||
|
||||
case wizard_page::sideload_install:
|
||||
return (int)wizard_page::connect_hmd;
|
||||
|
||||
default:
|
||||
return QWizard::nextId();
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::retranslate()
|
||||
{
|
||||
ui->retranslateUi(this);
|
||||
ui->label_how_to_connect->setText(tr("Start the WiVRn app on your headset and connect to \"%1\".").arg(server->hostname()));
|
||||
on_headset_connected_changed(server->isHeadsetConnected());
|
||||
}
|
||||
|
||||
wizard::~wizard()
|
||||
{
|
||||
server->disable_pairing();
|
||||
|
||||
// android_devices_changed can be emitted when adb_service is destroyed, disconnect it before destroying
|
||||
// the GUI
|
||||
disconnect(&adb_service, &adb::android_devices_changed, this, &wizard::on_android_device_list_changed);
|
||||
|
||||
delete ui;
|
||||
ui = nullptr;
|
||||
}
|
||||
|
||||
void wizard::start_download()
|
||||
{
|
||||
ui->button_cancel_download->setEnabled(true);
|
||||
|
||||
QUrl url(apk_url.c_str());
|
||||
|
||||
qDebug() << "Downloading from" << url.toString();
|
||||
|
||||
auto apk_dir = std::filesystem::path(apk_file.fileName().toStdString()).parent_path();
|
||||
std::filesystem::create_directories(apk_dir);
|
||||
|
||||
apk_file.open(QIODeviceBase::WriteOnly | QIODeviceBase::Truncate);
|
||||
|
||||
QNetworkRequest request(url);
|
||||
|
||||
if (apk_reply)
|
||||
{
|
||||
disconnect(apk_reply, &QNetworkReply::downloadProgress, this, &wizard::on_download_progress);
|
||||
disconnect(apk_reply, &QNetworkReply::errorOccurred, this, &wizard::on_download_error);
|
||||
disconnect(apk_reply, &QNetworkReply::finished, this, &wizard::on_download_finished);
|
||||
apk_reply->abort();
|
||||
apk_reply->deleteLater();
|
||||
}
|
||||
|
||||
apk_reply = manager.get(request);
|
||||
|
||||
connect(apk_reply, &QNetworkReply::downloadProgress, this, &wizard::on_download_progress);
|
||||
connect(apk_reply, &QNetworkReply::errorOccurred, this, &wizard::on_download_error);
|
||||
connect(apk_reply, &QNetworkReply::finished, this, &wizard::on_download_finished);
|
||||
|
||||
ui->progress_download->setValue(0);
|
||||
}
|
||||
|
||||
void wizard::cancel_download()
|
||||
{
|
||||
assert(apk_reply);
|
||||
|
||||
disconnect(apk_reply, &QNetworkReply::downloadProgress, this, &wizard::on_download_progress);
|
||||
disconnect(apk_reply, &QNetworkReply::errorOccurred, this, &wizard::on_download_error);
|
||||
disconnect(apk_reply, &QNetworkReply::finished, this, &wizard::on_download_finished);
|
||||
apk_reply->abort();
|
||||
apk_reply->deleteLater();
|
||||
apk_reply = nullptr;
|
||||
|
||||
// Cancel and commit to close without saving the already written data, so that it can be reopened
|
||||
apk_file.cancelWriting();
|
||||
apk_file.commit();
|
||||
|
||||
back();
|
||||
}
|
||||
|
||||
void wizard::on_download_progress(qint64 bytesReceived, qint64 bytesTotal)
|
||||
{
|
||||
assert(apk_reply);
|
||||
|
||||
if (not apk_reply->error())
|
||||
{
|
||||
if (bytesTotal > 0)
|
||||
ui->progress_download->setValue(bytesReceived * 100 / bytesTotal);
|
||||
|
||||
apk_file.write(apk_reply->readAll());
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_download_error(QNetworkReply::NetworkError code)
|
||||
{
|
||||
qDebug() << "Download error" << code;
|
||||
|
||||
// Cancel and commit to close without saving the already written data, so that it can be reopened
|
||||
apk_file.cancelWriting();
|
||||
apk_file.commit();
|
||||
|
||||
QMessageBox msgbox /*(this)*/;
|
||||
msgbox.setIcon(QMessageBox::Critical);
|
||||
msgbox.setText(tr("Error downloading the client:\n%1").arg(apk_reply->errorString()));
|
||||
msgbox.setStandardButtons(QMessageBox::Retry | QMessageBox::Cancel);
|
||||
|
||||
#ifdef WORKAROUND_QTBUG_90005
|
||||
setEnabled(false);
|
||||
#endif
|
||||
|
||||
switch (msgbox.exec())
|
||||
{
|
||||
case QMessageBox::Retry:
|
||||
start_download();
|
||||
break;
|
||||
|
||||
case QMessageBox::Cancel:
|
||||
back();
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef WORKAROUND_QTBUG_90005
|
||||
setEnabled(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wizard::on_download_finished()
|
||||
{
|
||||
assert(apk_reply);
|
||||
|
||||
if (not apk_reply->error())
|
||||
{
|
||||
auto last_modified = apk_reply->header(QNetworkRequest::LastModifiedHeader).value<QDateTime>();
|
||||
apk_file.setFileTime(last_modified, QFileDevice::FileModificationTime);
|
||||
|
||||
apk_reply->deleteLater();
|
||||
apk_reply = nullptr;
|
||||
|
||||
ui->button_cancel_download->setEnabled(false);
|
||||
apk_file.commit();
|
||||
apk_downloaded = true;
|
||||
|
||||
back(); // Remove current page from history before going to the install page
|
||||
setCurrentId((int)wizard_page::sideload_devmode);
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_android_device_list_changed(const std::vector<adb::device> & new_devs)
|
||||
{
|
||||
auto old_devs = std::move(android_devices);
|
||||
android_devices = new_devs;
|
||||
|
||||
if (android_devices.empty())
|
||||
ui->label_device_detected->setText(tr("No device detected."));
|
||||
else
|
||||
ui->label_device_detected->setText(tr("%n device(s) detected.", nullptr, android_devices.size()));
|
||||
|
||||
// Removed devices
|
||||
for (int i = 0; i < ui->list_devices->count();)
|
||||
{
|
||||
QListWidgetItem * item = ui->list_devices->item(i);
|
||||
|
||||
std::string serial = item->data(QListWidgetItem::UserType).toString().toStdString();
|
||||
|
||||
if (std::ranges::none_of(android_devices, [&](const adb::device & x) { return x.serial() == serial; }))
|
||||
delete item;
|
||||
else
|
||||
i++;
|
||||
}
|
||||
|
||||
// Added devices
|
||||
for (const auto & i: android_devices)
|
||||
{
|
||||
if (std::ranges::none_of(old_devs, [&](const adb::device & x) { return x == i; }))
|
||||
{
|
||||
auto it = i.properties().find("model");
|
||||
|
||||
const std::string model = (it == i.properties().end()) ? "Unknown model (" + i.serial() + ")" : it->second;
|
||||
|
||||
QListWidgetItem * item = new QListWidgetItem(QString::fromStdString(model));
|
||||
|
||||
item->setData(QListWidgetItem::UserType, QString::fromStdString(i.serial()));
|
||||
|
||||
ui->list_devices->addItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_selected_android_device_changed()
|
||||
{
|
||||
if (ui->list_devices->currentItem())
|
||||
button(NextButton)->setEnabled(true);
|
||||
else
|
||||
button(NextButton)->setEnabled(false);
|
||||
}
|
||||
|
||||
void wizard::start_install()
|
||||
{
|
||||
QListWidgetItem * item = ui->list_devices->currentItem();
|
||||
|
||||
if (not item)
|
||||
{
|
||||
back();
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string serial = item->data(QListWidgetItem::UserType).toString().toStdString();
|
||||
|
||||
for (adb::device & i: android_devices)
|
||||
{
|
||||
if (i.serial() == serial)
|
||||
{
|
||||
process_adb_install = i.install(apk_file.fileName().toStdString());
|
||||
|
||||
connect(process_adb_install.get(), &QProcess::finished, this, &wizard::on_install_finished);
|
||||
connect(process_adb_install.get(), &QProcess::readyReadStandardOutput, this, &wizard::on_install_stdout);
|
||||
connect(process_adb_install.get(), &QProcess::readyReadStandardError, this, &wizard::on_install_stderr);
|
||||
process_adb_install->setParent(this);
|
||||
process_adb_install->start();
|
||||
ui->adb_install_logs->setPlainText("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_install_stdout()
|
||||
{
|
||||
ui->adb_install_logs->appendPlainText(process_adb_install->readAllStandardOutput());
|
||||
ui->adb_install_logs->verticalScrollBar()->setValue(ui->adb_install_logs->verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void wizard::on_install_stderr()
|
||||
{
|
||||
ui->adb_install_logs->appendPlainText(process_adb_install->readAllStandardError());
|
||||
ui->adb_install_logs->verticalScrollBar()->setValue(ui->adb_install_logs->verticalScrollBar()->maximum());
|
||||
}
|
||||
|
||||
void wizard::on_install_finished(int exit_code, QProcess::ExitStatus exit_status)
|
||||
{
|
||||
if (exit_code == 0 and exit_status == QProcess::NormalExit)
|
||||
{
|
||||
// back(); // Remove current page from history before going to the connect page
|
||||
// setCurrentId((int)wizard_page::connect_hmd);
|
||||
|
||||
button(NextButton)->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_headset_connected_changed(bool connected)
|
||||
{
|
||||
if (currentId() == (int)wizard_page::connect_hmd)
|
||||
{
|
||||
if (connected)
|
||||
ui->label_client_status->setText(tr("The headset is connected."));
|
||||
else
|
||||
ui->label_client_status->setText(tr("The headset is not connected."));
|
||||
|
||||
button(NextButton)->setEnabled(connected);
|
||||
ui->widget_troubleshoot->setHidden(connected);
|
||||
}
|
||||
}
|
||||
|
||||
void wizard::on_pin_changed(QString pin)
|
||||
{
|
||||
if (pin == "")
|
||||
{
|
||||
ui->label_pin_1->setVisible(false);
|
||||
ui->label_pin_2->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->label_pin_1->setVisible(true);
|
||||
ui->label_pin_2->setVisible(true);
|
||||
}
|
||||
|
||||
ui->label_pin_2->setText(pin);
|
||||
}
|
||||
|
||||
#include "moc_wizard.cpp"
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "adb.h"
|
||||
#include <QFutureWatcher>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QProcess>
|
||||
#include <QSaveFile>
|
||||
#include <QSettings>
|
||||
#include <QStandardItemModel>
|
||||
#include <QTimer>
|
||||
#include <QWizard>
|
||||
#include <string>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class Wizard;
|
||||
}
|
||||
|
||||
class wivrn_server;
|
||||
|
||||
class wizard : public QWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Ui::Wizard * ui = nullptr;
|
||||
QStandardItemModel headsets;
|
||||
|
||||
wivrn_server * server;
|
||||
|
||||
QSettings settings;
|
||||
QNetworkAccessManager manager;
|
||||
|
||||
// Used to download the APK
|
||||
QNetworkReply * apk_reply = nullptr;
|
||||
|
||||
// Used to query the latest release on github
|
||||
QNetworkReply * latest_release_reply = nullptr;
|
||||
|
||||
// Used to get the info about the current version on github, either from the WiVRn or the WiVRn-APK repo
|
||||
QNetworkReply * apk_release_reply = nullptr;
|
||||
|
||||
QSaveFile apk_file;
|
||||
std::string apk_url;
|
||||
bool apk_downloaded = false;
|
||||
|
||||
std::string latest_release;
|
||||
|
||||
adb adb_service;
|
||||
|
||||
std::vector<adb::device> android_devices;
|
||||
std::unique_ptr<QProcess> process_adb_install;
|
||||
|
||||
public:
|
||||
wizard();
|
||||
~wizard();
|
||||
|
||||
void changeEvent(QEvent * e) override;
|
||||
void retranslate();
|
||||
|
||||
int nextId() const override;
|
||||
|
||||
void on_page_changed(int id);
|
||||
|
||||
void start_download();
|
||||
void cancel_download();
|
||||
void on_download_progress(qint64 bytesReceived, qint64 bytesTotal);
|
||||
void on_download_error(QNetworkReply::NetworkError code);
|
||||
void on_download_finished();
|
||||
|
||||
void on_android_device_list_changed(const std::vector<adb::device> &);
|
||||
void on_selected_android_device_changed();
|
||||
|
||||
void start_install();
|
||||
void on_install_finished(int exit_code, QProcess::ExitStatus exit_status);
|
||||
void on_install_stdout();
|
||||
void on_install_stderr();
|
||||
|
||||
void on_latest_release_finished();
|
||||
void on_apk_release_finished();
|
||||
|
||||
void update_welcome_page();
|
||||
void on_headset_connected_changed(bool);
|
||||
void on_custom_button_clicked(int which);
|
||||
|
||||
void on_pin_changed(QString pin);
|
||||
};
|
||||
@@ -1,588 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Wizard</class>
|
||||
<widget class="QWizard" name="Wizard">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>846</width>
|
||||
<height>586</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Connection wizard</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWizardPage" name="page_1_select_install_method">
|
||||
<property name="title">
|
||||
<string>Welcome</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>You will need to have the WiVRn client installed on your headset. If the client is already installed, click "Skip".</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="combo_hmd_model">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Select your headset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_release_info">
|
||||
<property name="text">
|
||||
<string>Getting latest release information...</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="check_sideload">
|
||||
<property name="text">
|
||||
<string>I want to sideload the client instead</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_store" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_store">
|
||||
<property name="text">
|
||||
<string>Go to the store to install the client app on your headset.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_store_url">
|
||||
<property name="text">
|
||||
<string notr="true">store_url</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::RichText</enum>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="page_2_sideload_download">
|
||||
<property name="title">
|
||||
<string>Downloading the WiVRn app</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progress_download">
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="button_cancel_download">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_download_status">
|
||||
<property name="text">
|
||||
<string>Downloading</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="page_3_sideload_devmode">
|
||||
<property name="title">
|
||||
<string>Install the WiVRn app on your headset</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_10">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5" stretch="1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Make sure your headset is in developer mode to continue.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_devmode_url">
|
||||
<property name="text">
|
||||
<string notr="true">devmode_url</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::RichText</enum>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_12">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_device_detected">
|
||||
<property name="text">
|
||||
<string notr="true">label_device_detected</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="list_devices"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="page_4_sideload_install">
|
||||
<property name="title">
|
||||
<string>Install the WiVRn app on your headset</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Installing...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="adb_install_logs">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Noto Sans Mono</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="page_5_connect_hmd">
|
||||
<property name="title">
|
||||
<string>Start the WiVRn app and connect to this computer</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_14">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_client_status">
|
||||
<property name="text">
|
||||
<string notr="true">client_status</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_18">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_troubleshoot" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_how_to_connect">
|
||||
<property name="text">
|
||||
<string notr="true">connect_to_this_server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pin_1">
|
||||
<property name="text">
|
||||
<string>Use the following PIN to connect your headset:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_pin_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">000000</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>If the server is not visible or the connection fails, check that port 5353 (UDP) and 9757 (TCP and UDP) are open in your firewall.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="page_6_start_game">
|
||||
<property name="title">
|
||||
<string>Finished</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_16">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>You can now start an OpenXR application on this computer.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>For Steam games, set the launch options to:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::TextFormat::PlainText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextInteractionFlag::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,1">
|
||||
<item>
|
||||
<widget class="QPushButton" name="copy_steam_command">
|
||||
<property name="toolTip">
|
||||
<string>Copy to clipboard</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="edit-copy-symbolic"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_steam_command">
|
||||
<property name="cursor">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">steam_command</string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextInteractionFlag::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_17">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user