diff --git a/client/configuration.cpp b/client/configuration.cpp index eed1daf9..c5cea1ee 100644 --- a/client/configuration.cpp +++ b/client/configuration.cpp @@ -79,7 +79,7 @@ static std::string json_string(const std::string & in) return out; } -bool configuration::check_feature(feature f) +bool configuration::check_feature(feature f) const { auto it = features.find(f); if (it == features.end()) @@ -88,6 +88,19 @@ bool configuration::check_feature(feature f) // Skip permission checks if not requested if (not it->second) return false; + switch (f) + { + case feature::microphone: + break; + case feature::eye_gaze: + if (not application::get_eye_gaze_supported()) + return false; + break; + case feature::face_tracking: + if (not application::get_fb_face_tracking2_supported()) + return false; + break; + } #ifdef __ANDROID__ return check_permission(permission_name(f)); #else diff --git a/client/configuration.h b/client/configuration.h index bc90e339..8f357d8a 100644 --- a/client/configuration.h +++ b/client/configuration.h @@ -49,7 +49,7 @@ public: bool show_performance_metrics = false; bool passthrough_enabled = false; - bool check_feature(feature f); + bool check_feature(feature f) const; void set_feature(feature f, bool state); private: diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index ac9ce39c..be635366 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -380,13 +380,37 @@ void scenes::lobby::gui_settings() vibrate_on_hover(); } - bool enabled = config.check_feature(feature::microphone); - if (ImGui::Checkbox(_S("Enable microphone"), &enabled)) { - config.set_feature(feature::microphone, enabled); - config.save(); + bool enabled = config.check_feature(feature::microphone); + if (ImGui::Checkbox(_S("Enable microphone"), &enabled)) + { + config.set_feature(feature::microphone, enabled); + config.save(); + } + vibrate_on_hover(); + } + { + ImGui::BeginDisabled(not application::get_eye_gaze_supported()); + bool enabled = config.check_feature(feature::eye_gaze); + if (ImGui::Checkbox(_S("Enable eye tracking"), &enabled)) + { + config.set_feature(feature::eye_gaze, enabled); + config.save(); + } + vibrate_on_hover(); + ImGui::EndDisabled(); + } + { + ImGui::BeginDisabled(not application::get_fb_face_tracking2_supported()); + bool enabled = config.check_feature(feature::face_tracking); + if (ImGui::Checkbox(_S("Enable face tracking"), &enabled)) + { + config.set_feature(feature::face_tracking, enabled); + config.save(); + } + ImGui::EndDisabled(); + vibrate_on_hover(); } - vibrate_on_hover(); ImGui::BeginDisabled(passthrough_supported == xr::system::passthrough_type::no_passthrough); if (ImGui::Checkbox(_S("Enable video passthrough in lobby"), &config.passthrough_enabled)) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index 5313f346..7f6c4fc9 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -118,12 +118,14 @@ std::shared_ptr scenes::stream::create(std::unique_ptr