feat: add wmr profile

This commit is contained in:
BabbleBones 2023-10-19 22:15:06 -04:00 committed by Gabriele Musco
commit 00e8cfe858
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE
5 changed files with 63 additions and 9 deletions

View file

@ -2,7 +2,7 @@ use std::fmt::Display;
use crate::{
profile::Profile,
profiles::{lighthouse::lighthouse_profile, wivrn::wivrn_profile},
profiles::{lighthouse::lighthouse_profile, wivrn::wivrn_profile, wmr::wmr_profile},
};
#[derive(Debug, PartialEq, Eq)]
@ -112,20 +112,20 @@ impl PhysicalXRDevice {
Self::PicoNeo3Pro => Some(wivrn_profile()),
Self::Pico4 => Some(wivrn_profile()),
Self::LynxR1 => Some(wivrn_profile()),
Self::DellVisor => Some(wmr_profile()),
//self::AcerAH101 => Some(wmr_profile()),
Self::HPWMR => Some(wmr_profile()),
Self::HPReverbG1 => Some(wmr_profile()),
Self::HPReverbG2 => Some(wmr_profile()),
Self::LenovoExplorer => Some(wmr_profile()),
Self::SamsungOdyssey => Some(wmr_profile()),
Self::SamsungOdysseyPlus => Some(wmr_profile()),
_ => None,
// Self::HTCViveCosmos => "HTC Vive Cosmos",
// Self::OculusRift => "Oculus Rift",
// Self::OculusRiftS => "Oculus Rift S",
// Self::PlayStationVR => "PlayStation Vr",
// Self::PlayStationVR2 => "PlayStation Vr2",
// Self::DellVisor => "Dell Visor",
// Self::AcerAH101 => "Acer AH101",
// Self::HPWMR => "HP WMR",
// Self::HPReverbG1 => "HP Reverb G1",
// Self::HPReverbG2 => "HP Reverb G2",
// Self::LenovoExplorer => "Lenovo Explorer",
// Self::SamsungOdyssey => "Samsung Odyssey",
// Self::SamsungOdysseyPlus => "Samsung Odyssey Plus",
// Self::RazerHydra => "Razer Hydra",
}
}

View file

@ -21,6 +21,10 @@ pub fn data_openhmd_path() -> String {
format!("{data}/openhmd", data = get_data_dir())
}
pub fn data_basalt_path() -> String {
format!("{data}/basalt", data = get_data_dir())
}
pub fn wivrn_apk_download_path() -> String {
format!("{cache}/wivrn.apk", cache = get_cache_dir())
}

View file

@ -2,3 +2,4 @@ pub mod lighthouse;
pub mod openhmd;
pub mod survive;
pub mod wivrn;
pub mod wmr;

47
src/profiles/wmr.rs Normal file
View file

@ -0,0 +1,47 @@
use crate::{
constants::APP_NAME,
paths::{data_monado_path, data_opencomposite_path, data_basalt_path, get_data_dir},
profile::{
LighthouseDriver, Profile, ProfileFeature, ProfileFeatureType, ProfileFeatures,
XRServiceType,
},
};
use std::collections::HashMap;
pub fn wmr_profile() -> Profile {
let data_dir = get_data_dir();
let prefix = format!("{data}/prefixes/wmr_default", data = data_dir);
let mut environment: HashMap<String, String> = HashMap::new();
environment.insert("XRT_JSON_LOG".into(), "1".into());
environment.insert("XRT_COMPOSITOR_SCALE_PERCENTAGE".into(), "140".into());
environment.insert("XRT_COMPOSITOR_COMPUTE".into(), "1".into());
environment.insert("XRT_DEBUG_GUI".into(), "1".into());
environment.insert("XRT_CURATED_GUI".into(), "1".into());
environment.insert(
"LD_LIBRARY_PATH".into(),
format!("{pfx}/lib:{pfx}/lib64", pfx = prefix),
);
Profile {
uuid: "wmr-default".into(),
name: format!("WMR - {name} Default", name = APP_NAME),
xrservice_path: data_monado_path(),
xrservice_type: XRServiceType::Monado,
opencomposite_path: data_opencomposite_path(),
features: ProfileFeatures {
basalt: ProfileFeature {
feature_type: ProfileFeatureType::Basalt,
enabled: true,
path: Some(data_basalt_path()),
repo: None,
},
mercury_enabled: true,
..Default::default()
},
environment,
prefix,
can_be_built: true,
editable: false,
lighthouse_driver: LighthouseDriver::Vive,
..Default::default()
}
}

View file

@ -41,6 +41,7 @@ use crate::profiles::lighthouse::lighthouse_profile;
use crate::profiles::openhmd::openhmd_profile;
use crate::profiles::survive::survive_profile;
use crate::profiles::wivrn::wivrn_profile;
use crate::profiles::wmr::wmr_profile;
use crate::ui::build_window::{BuildWindowMsg, BuildWindowOutMsg};
use crate::ui::debug_view::DebugViewInit;
use crate::ui::libsurvive_setup_window::LibsurviveSetupMsg;
@ -245,6 +246,7 @@ impl App {
lighthouse_profile(),
survive_profile(),
wivrn_profile(),
wmr_profile(),
openhmd_profile(),
];
profiles.extend(config.user_profiles.clone());