Skip to content

Commit

Permalink
Merge pull request #96 from BoiHanny/Pre-Master
Browse files Browse the repository at this point in the history
OSC (Open Sound Control) integration for Heartrate intergration
  • Loading branch information
BoiHanny authored Dec 10, 2024
2 parents 2ae735c + 8d7389f commit a4aa5b4
Show file tree
Hide file tree
Showing 6 changed files with 631 additions and 223 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 a4aa5b4

Please sign in to comment.