Commit Graph

11 Commits

Author SHA1 Message Date
Aleksander 075e55a8e8 WayVR: Add DashboardShown and DashboardHidden events, add WlxInputState support (#167)
Wlx: Fix various Clippy warnings
2025-02-28 21:05:27 +00:00
Jay da129b62b3 Add UI button actions to send arbitrary OSC values. (#140)
* osc: start adding osc buttons

a button action that sends an osc parameter.
struggling with borrows in openxr.rs and openvr.rs when getting the osc sender.

* osc: fix osc sender buttons

by passing a ref to the device list to send_params instead of the entire app state.

* osc: fix warnings

* osc: conditionally use OscSender crate in state.rs

* osc: fix button.rs compile errors without osc/wayvr features

* osc: add other types: int, bool, string. play thump noise when sent.

* osc: fix build without osc feature

i just want to use OscType directly, but since it doesn't derive serde::Deserialize, i can't just have one OscType action or list of actions...

* merge typed actions to one action, support multiple values.

i added a new struct OscValue that has Deserialize, and now the action just converts that to the corresponding OscType when sending the parameters.
perhaps not the most elegant solution, but it's the best i can think of without modifying the rosc crate.

* run `cargo fmt`
2025-01-26 11:23:18 +00:00
Jay c6ff314e93 OSC: Finish XSOverlay parity (#124)
* osc-battery - utilise match return value to set parameter

this just lets parameter be a `&str` instead of a `String`, and reduces repetition.

* osc-battery - fix error where trackers were 1-indexed instead of 0-indexed

* osc-battery: xsoverlay parity! add average tracker and controller battery parameters.

this should now be in parity with xsoverlay's parameters.

gone back to 1-indexing trackers because it's more user-friendly, so other programs can standardise more easily.

* osc battery: ...that was not 1-indexed.

no idea how I made that mistake but the sent tracker parameters were actually still 0-indexed.
2024-12-29 08:21:59 +00:00
cubee a71f4de0ff fix osc timer and give battery parameters their own timer 2024-11-24 15:13:46 +01:00
cubee 18b2e96079 make parameter String instead of &str
this means parameter can be immutable if left unset at initialisation, and we can use format!() macro in the match statements. silly workarounds no more!
2024-11-24 15:13:46 +01:00
cubee c09da86659 add parameters for device charging state 2024-11-24 15:13:46 +01:00
cubee e818259b5b default to -1 if a device has no battery level.
this is just to make sure the unwrap() doesn't crash; -1 (or any negative value) is used as the "disconnected" value.
2024-11-24 15:13:46 +01:00
cubee c96ead7cf0 send osc parameters based on device role, cleanup usings 2024-11-24 15:13:46 +01:00
cubee 546b38204c use AppState to get device roles
i _understand_ now!
basically, i did it the "wrong" way first by modifying openxr.rs and openvr.rs to pass battery levels to osc, when really i could have just made osc get the pre-formatted device details from AppState. live and learn, i'm new to rust anyway.
2024-11-24 15:13:46 +01:00
galister 2aed560950 osc: only interactable in openOverlayCount 2024-03-06 18:20:20 +01:00
galister 2fb55a8b62 feature: osc sender 2024-02-05 23:15:32 +01:00