-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
OSC.cs
39 lines (35 loc) · 1.22 KB
/
OSC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
namespace PowerPointToOSC
{
public class OscLocal
{
// Default OSC Host, works with DMXIS
private string oscHost = "127.0.0.1 8000";
public OscLocal() { }
public string OscHost
{
get { return oscHost; }
set
{
oscHost = value;
Console.WriteLine($"OSC Host set to {value}");
}
}
public bool sendOSC(string oscString)
{
Console.WriteLine($" Sending OSC command to {oscHost}: {oscString}");
// Current implementation: leverage sendosc.exe - https://github.com/yoggy/sendosc
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "sendosc.exe";
startInfo.Arguments = oscHost + " " + oscString;
process.StartInfo = startInfo;
process.Start();
return true;
}
}
}