Skip to content

Commit e73ce57

Browse files
committed
Add heart rate OSC integration and smoothing features
Introduced heart rate OSC integration, allowing heart rate data to be sent over OSC. Added new methods in `OSCSender.cs` for sending OSC parameters. Updated `PulsoidModule.cs` to handle heart rate data smoothing and OSC updates, including new properties, methods, and refactoring the heart rate monitoring loop. Corrected a typo in a log message. Updated trend symbol and statistics time range functionalities. Modified `MainWindow.xaml` to include new UI elements for heart rate smoothing and OSC settings. Added new property and bindings in `ViewModel.cs` to support the new UI elements.
1 parent a477d64 commit e73ce57

File tree

5 files changed

+338
-144
lines changed

5 files changed

+338
-144
lines changed

vrcosc-magicchatbox/Classes/DataAndSecurity/DataController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ public static void LoadComponentStats()
322322

323323
{ "IntgrHeartRate_VR", (typeof(bool), "IntegrationToggles") },
324324
{ "IntgrHeartRate_DESKTOP", (typeof(bool), "IntegrationToggles") },
325+
{ "_IntgrHeartRate_OSC", (typeof(bool), "IntegrationToggles") },
325326

326327
{ "IntgrCurrentTime_VR", (typeof(bool), "IntegrationToggles") },
327328
{ "IntgrCurrentTime_DESKTOP", (typeof(bool), "IntegrationToggles") },

vrcosc-magicchatbox/Classes/DataAndSecurity/OSCSender.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,42 @@ private static UDPSender OscSender
3535
}
3636
}
3737

38+
public static void SendOscParam(string address, float value)
39+
{
40+
if (!ViewModel.Instance.MasterSwitch) return;
41+
42+
var msg = new OscMessage(address, value);
43+
OscSender.Send(msg);
44+
if (ViewModel.Instance.SecOSC)
45+
SecOscSender.Send(msg);
46+
if (ViewModel.Instance.ThirdOSC)
47+
ThirdOscSender.Send(msg);
48+
}
49+
50+
public static void SendOscParam(string address, int value)
51+
{
52+
if (!ViewModel.Instance.MasterSwitch) return;
53+
54+
var msg = new OscMessage(address, value);
55+
OscSender.Send(msg);
56+
if (ViewModel.Instance.SecOSC)
57+
SecOscSender.Send(msg);
58+
if (ViewModel.Instance.ThirdOSC)
59+
ThirdOscSender.Send(msg);
60+
}
61+
62+
public static void SendOscParam(string address, bool value)
63+
{
64+
if (!ViewModel.Instance.MasterSwitch) return;
65+
66+
var msg = new OscMessage(address, value ? 1 : 0);
67+
OscSender.Send(msg);
68+
if (ViewModel.Instance.SecOSC)
69+
SecOscSender.Send(msg);
70+
if (ViewModel.Instance.ThirdOSC)
71+
ThirdOscSender.Send(msg);
72+
}
73+
3874
private static UDPSender SecOscSender
3975
{
4076
get

0 commit comments

Comments
 (0)