Skip to content

Commit

Permalink
Add heart rate OSC integration and smoothing features
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BoiHanny committed Dec 8, 2024
1 parent a477d64 commit e73ce57
Show file tree
Hide file tree
Showing 5 changed files with 338 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public static void LoadComponentStats()

{ "IntgrHeartRate_VR", (typeof(bool), "IntegrationToggles") },
{ "IntgrHeartRate_DESKTOP", (typeof(bool), "IntegrationToggles") },
{ "_IntgrHeartRate_OSC", (typeof(bool), "IntegrationToggles") },

{ "IntgrCurrentTime_VR", (typeof(bool), "IntegrationToggles") },
{ "IntgrCurrentTime_DESKTOP", (typeof(bool), "IntegrationToggles") },
Expand Down
36 changes: 36 additions & 0 deletions vrcosc-magicchatbox/Classes/DataAndSecurity/OSCSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ private static UDPSender OscSender
}
}

public static void SendOscParam(string address, float value)
{
if (!ViewModel.Instance.MasterSwitch) return;

var msg = new OscMessage(address, value);
OscSender.Send(msg);
if (ViewModel.Instance.SecOSC)
SecOscSender.Send(msg);
if (ViewModel.Instance.ThirdOSC)
ThirdOscSender.Send(msg);
}

public static void SendOscParam(string address, int value)
{
if (!ViewModel.Instance.MasterSwitch) return;

var msg = new OscMessage(address, value);
OscSender.Send(msg);
if (ViewModel.Instance.SecOSC)
SecOscSender.Send(msg);
if (ViewModel.Instance.ThirdOSC)
ThirdOscSender.Send(msg);
}

public static void SendOscParam(string address, bool value)
{
if (!ViewModel.Instance.MasterSwitch) return;

var msg = new OscMessage(address, value ? 1 : 0);
OscSender.Send(msg);
if (ViewModel.Instance.SecOSC)
SecOscSender.Send(msg);
if (ViewModel.Instance.ThirdOSC)
ThirdOscSender.Send(msg);
}

private static UDPSender SecOscSender
{
get
Expand Down
Loading

0 comments on commit e73ce57

Please sign in to comment.