private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { if (listener != null) { listener.Close(); } }
public void TestByteCallback() { bool cbCalled = false; // The cabllback function HandleBytePacket cb = delegate(byte[] packet) { var msg = (OscMessage)OscPacket.GetPacket(packet); Assert.AreEqual(2, msg.Arguments.Count); Assert.AreEqual(23, msg.Arguments[0]); Assert.AreEqual("hello world", msg.Arguments[1]); cbCalled = true; }; var l1 = new UDPListener(55555, cb); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg1 = new SharpOSC.OscMessage("/test/address", 23, "hello world"); sender.Send(msg1); // Wait until callback processes its message var start = DateTime.Now; while (cbCalled == false && start.AddSeconds(2) > DateTime.Now) { Thread.Sleep(1); } Assert.IsTrue(cbCalled); l1.Close(); }
public void TestMessage() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); // Test every message type (except Symbol) var msg1 = new SharpOSC.OscMessage( "/test/address", 23, 42.42f, "hello world", new byte[3] { 2, 3, 4 }, -123456789123, new Timetag(DateTime.Now.Date).Tag, new Timetag(DateTime.Now.Date.AddMonths(1)), (double)1234567.890, new Symbol("wut wut"), (char)'x', new RGBA(20, 40, 60, 255), new Midi(3, 110, 55, 66), true, false, null, Double.PositiveInfinity ); OscMessage msgRevc = null; sender.Send(msg1); msgRevc = (OscMessage)listener.Receive(); Assert.NotNull(msgRevc); Assert.AreEqual("/test/address", msgRevc.Address); Assert.AreEqual(16, msgRevc.Arguments.Count); Assert.AreEqual(23, msgRevc.Arguments[0]); Assert.AreEqual(42.42f, msgRevc.Arguments[1]); Assert.AreEqual("hello world", msgRevc.Arguments[2]); Assert.AreEqual(new byte[3] { 2, 3, 4 }, msgRevc.Arguments[3]); Assert.AreEqual(-123456789123, msgRevc.Arguments[4]); Assert.AreEqual(new Timetag(DateTime.Now.Date), msgRevc.Arguments[5]); Assert.AreEqual(new Timetag(DateTime.Now.Date.AddMonths(1)), msgRevc.Arguments[6]); Assert.AreEqual((double)1234567.890, msgRevc.Arguments[7]); Assert.AreEqual(new Symbol("wut wut"), msgRevc.Arguments[8]); Assert.AreEqual((char)'x', msgRevc.Arguments[9]); Assert.AreEqual(new RGBA(20, 40, 60, 255), msgRevc.Arguments[10]); Assert.AreEqual(new Midi(3, 110, 55, 66), msgRevc.Arguments[11]); Assert.AreEqual(true, msgRevc.Arguments[12]); Assert.AreEqual(false, msgRevc.Arguments[13]); Assert.AreEqual(null, msgRevc.Arguments[14]); Assert.AreEqual(Double.PositiveInfinity, msgRevc.Arguments[15]); listener.Close(); }
public void TestCallback() { bool cbCalled = false; // The cabllback function HandleOscPacket cb = delegate(OscPacket packet) { var msg = (OscMessage)packet; Assert.AreEqual(2, msg.Arguments.Count); Assert.AreEqual(23, msg.Arguments[0]); Assert.AreEqual("hello world", msg.Arguments[1]); cbCalled = true; }; var l1 = new UDPListener(55555, cb); var sender = new SharpOSC.UDPSender("localhost", 55555); var msg1 = new SharpOSC.OscMessage("/test/address", 23, "hello world"); sender.Send(msg1); // Wait until callback processes its message var start = DateTime.Now; while(cbCalled == false && start.AddSeconds(2) > DateTime.Now) Thread.Sleep(1); Assert.IsTrue(cbCalled); l1.Close(); }
private void MainDashboard_Closing(object sender, CancelEventArgs e) { // Kill all the threads to prevent the program from crashing. StreamDeckWorker.Dispose(); LimelightWorker.Dispose(); UpdateWorker.Dispose(); // Close the OSC receiver. Receiver.Close(); }
public void CloseListener() { var l1 = new UDPListener(55555); var isnull = l1.Receive(); l1.Close(); var l2 = new UDPListener(55555); isnull = l2.Receive(); l2.Close(); }
public void CloseListener() { var l1 = new UDPListener(55555); var isnull = l1.Receive(); l1.Close(); var l2 = new UDPListener(55555); isnull = l2.Receive(); l2.Close(); }
void OnApplicationQuit() { if (m_ServerSession != null) { m_ServerSession.Close(); m_ServerSession = null; } if (m_ClientSession != null) { m_ClientSession.Close(); m_ClientSession = null; } }
public bool StopReceiving() { if (this.isReceiving) { listener.Close(); this.isReceiving = false; return(true); } else { return(false); } }
public void TestBundle() { var listener = new UDPListener(55555); var sender1 = new SharpOSC.UDPSender("localhost", 55555); var msg1 = new SharpOSC.OscMessage("/test/address1", 23, 42.42f, "hello world", new byte[3] { 2, 3, 4 }); var msg2 = new SharpOSC.OscMessage("/test/address2", 34, 24.24f, "hello again", new byte[5] { 5, 6, 7, 8, 9 }); var dt = DateTime.Now; var bundle = new SharpOSC.OscBundle(Utils.DateTimeToTimetag(dt), msg1, msg2); sender1.Send(bundle); sender1.Send(bundle); sender1.Send(bundle); var recv = (OscBundle)listener.Receive(); recv = (OscBundle)listener.Receive(); recv = (OscBundle)listener.Receive(); Assert.AreEqual(dt.Date, recv.Timestamp.Date); Assert.AreEqual(dt.Hour, recv.Timestamp.Hour); Assert.AreEqual(dt.Minute, recv.Timestamp.Minute); Assert.AreEqual(dt.Second, recv.Timestamp.Second); //Assert.AreEqual(dt.Millisecond, recv.DateTime.Millisecond); Ventus not accurate enough Assert.AreEqual("/test/address1", recv.Messages[0].Address); Assert.AreEqual(4, recv.Messages[0].Arguments.Count); Assert.AreEqual(23, recv.Messages[0].Arguments[0]); Assert.AreEqual(42.42f, recv.Messages[0].Arguments[1]); Assert.AreEqual("hello world", recv.Messages[0].Arguments[2]); Assert.AreEqual(new byte[3] { 2, 3, 4 }, recv.Messages[0].Arguments[3]); Assert.AreEqual("/test/address2", recv.Messages[1].Address); Assert.AreEqual(4, recv.Messages[1].Arguments.Count); Assert.AreEqual(34, recv.Messages[1].Arguments[0]); Assert.AreEqual(24.24f, recv.Messages[1].Arguments[1]); Assert.AreEqual("hello again", recv.Messages[1].Arguments[2]); Assert.AreEqual(new byte[5] { 5, 6, 7, 8, 9 }, recv.Messages[1].Arguments[3]); listener.Close(); }
public void CloseListenerException() { UDPListener l1 = null; bool ex = false; try { l1 = new UDPListener(55555); var isnull = l1.Receive(); var l2 = new UDPListener(55555); } catch (Exception e) { ex = true; } Assert.IsTrue(ex); l1.Close(); }
public void CloseListenerException() { UDPListener l1 = null; bool ex = false; try { l1 = new UDPListener(55555); var isnull = l1.Receive(); var l2 = new UDPListener(55555); } catch (Exception e) { ex = true; } Assert.IsTrue(ex); l1.Close(); }
static void Main(string[] args) { // Callback function for received OSC messages. // Prints EEG and Relative Alpha data only. HandleOscPacket callback = delegate(OscPacket packet) { var messageReceived = (OscMessage)packet; var addr = messageReceived.Address; if (addr == "/muse/eeg") { // Console.Write("EEG values: "); var eeg = new Eeg(); // foreach (var arg in messageReceived.Arguments) // { // Console.Write(arg + " "); // } OnEeg(this, new EegEventArgs() { Eeg = messageReceived.Arguments }); } // if (addr == "/muse/elements/alpha_relative") // { // Console.Write("Relative Alpha power values: "); // foreach (var arg in messageReceived.Arguments) // { // Console.Write(arg + " "); // } // } }; // Create an OSC server. var listener = new UDPListener(5000, callback); Console.WriteLine("Press enter to stop"); Console.ReadLine(); listener.Close(); }
public void TestBundle() { var listener = new UDPListener(55555); var sender1 = new SharpOSC.UDPSender("localhost", 55555); var msg1 = new SharpOSC.OscMessage("/test/address1", 23, 42.42f, "hello world", new byte[3] { 2, 3, 4 }); var msg2 = new SharpOSC.OscMessage("/test/address2", 34, 24.24f, "hello again", new byte[5] { 5, 6, 7, 8, 9 }); var dt = DateTime.Now; var bundle = new SharpOSC.OscBundle(Utils.DateTimeToTimetag(dt), msg1, msg2); sender1.Send(bundle); sender1.Send(bundle); sender1.Send(bundle); var recv = (OscBundle)listener.Receive(); recv = (OscBundle)listener.Receive(); recv = (OscBundle)listener.Receive(); Assert.AreEqual(dt.Date, recv.Timestamp.Date); Assert.AreEqual(dt.Hour, recv.Timestamp.Hour); Assert.AreEqual(dt.Minute, recv.Timestamp.Minute); Assert.AreEqual(dt.Second, recv.Timestamp.Second); //Assert.AreEqual(dt.Millisecond, recv.DateTime.Millisecond); Ventus not accurate enough Assert.AreEqual("/test/address1", recv.Messages[0].Address); Assert.AreEqual(4, recv.Messages[0].Arguments.Count); Assert.AreEqual(23, recv.Messages[0].Arguments[0]); Assert.AreEqual(42.42f, recv.Messages[0].Arguments[1]); Assert.AreEqual("hello world", recv.Messages[0].Arguments[2]); Assert.AreEqual(new byte[3] { 2, 3, 4 }, recv.Messages[0].Arguments[3]); Assert.AreEqual("/test/address2", recv.Messages[1].Address); Assert.AreEqual(4, recv.Messages[1].Arguments.Count); Assert.AreEqual(34, recv.Messages[1].Arguments[0]); Assert.AreEqual(24.24f, recv.Messages[1].Arguments[1]); Assert.AreEqual("hello again", recv.Messages[1].Arguments[2]); Assert.AreEqual(new byte[5] { 5, 6, 7, 8, 9 }, recv.Messages[1].Arguments[3]); listener.Close(); }
private void frmMain_Load(object sender, EventArgs e) { updateThread = new Thread(() => { var listener = new UDPListener(PORT); OscMessage messageReceived = null; int nameUpdateCounter = 0; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); while (runThread == true) { /** * Tuning Packet Descriptor * Actual Value, Requested Value, IAccum, System Name */ if (!initCompleted) { //Initialize the connection sendIAccumReset(); initCompleted = true; } messageReceived = (OscMessage)listener.Receive(); if (messageReceived != null) { switch (messageReceived.Address) { case "/PIDData": try { double actualVal = (double)messageReceived.Arguments[0]; double requestedVal = (double)messageReceived.Arguments[1]; actualPoints.Add(actualVal); requestedPoints.Add(requestedVal); if (stopWatch.ElapsedMilliseconds > 200) { //Update TextBox UI Every 200ms to avoid slowing down the app double iAccum = (double)messageReceived.Arguments[2]; double err = requestedVal - actualVal; averageError.AddNumber(err); txtActualVal.Invoke((MethodInvoker) delegate { txtActualVal.Text = actualVal.ToString("0.####"); }); txtDesiredVal.Invoke((MethodInvoker) delegate { txtDesiredVal.Text = requestedVal.ToString("0.####"); }); txtDeviation.Invoke((MethodInvoker) delegate { txtDeviation.Text = err.ToString("0.####"); }); txtAverageDev.Invoke((MethodInvoker) delegate { txtAverageDev.Text = averageError.GetAverage().ToString("0.####"); }); txtIAccum.Invoke((MethodInvoker) delegate { txtIAccum.Text = iAccum.ToString("0.####"); }); if (nameUpdateCounter++ % 5 == 0) { txtSysName.Invoke((MethodInvoker) delegate { txtSysName.Text = (string)messageReceived.Arguments[3]; }); } if (messageCounter > 200) { sleepRate = 0; } else { sleepRate = (int)((200.0 / messageCounter) / 2.0); } messageCounter = 0; stopWatch.Restart(); } } catch (Exception) { } break; default: break; } messageCounter++; } if (sleepRate > 0) { Thread.Sleep(sleepRate); } } listener.Close(); }); updateThread.Start(); pidChart.Hoverable = false; pidChart.DisableAnimations = true; pidChart.DataTooltip = null; numkP.LostFocus += sendPIDUpdate; numkI.LostFocus += sendPIDUpdate; numkD.LostFocus += sendPIDUpdate; numkF.LostFocus += sendPIDUpdate; numAccel.LostFocus += sendPIDUpdate; numVel.LostFocus += sendPIDUpdate; numRamp.LostFocus += sendPIDUpdate; numIZone.LostFocus += sendPIDUpdate; numSetpoint.LostFocus += sendPIDUpdate; numMaxIAccum.LostFocus += sendPIDUpdate; numkP.KeyDown += checkEnter_Pressed; numkI.KeyDown += checkEnter_Pressed; numkD.KeyDown += checkEnter_Pressed; numkF.KeyDown += checkEnter_Pressed; numAccel.KeyDown += checkEnter_Pressed; numVel.KeyDown += checkEnter_Pressed; numRamp.KeyDown += checkEnter_Pressed; numIZone.KeyDown += checkEnter_Pressed; numSetpoint.KeyDown += checkEnter_Pressed; numMaxIAccum.KeyDown += checkEnter_Pressed; }
static void Main(string[] args) { // VIRTUAL GAMEPAD INITIALIZATION Console.WriteLine("[PAD] Initializing gamepad"); joystick = new vJoy(); iReport = new vJoy.JoystickState(); if (!joystick.vJoyEnabled()) { Console.WriteLine("[PAD] vJoy driver not enabled!"); return; } else { Console.WriteLine("[PAD] Vendor: {0}\n[PAD] Product :{1}\n[PAD] Version Number:{2}", joystick.GetvJoyManufacturerString(), joystick.GetvJoyProductString(), joystick.GetvJoySerialNumberString()); } VjdStat status = joystick.GetVJDStatus(id); int nButtons = joystick.GetVJDButtonNumber(id); if (nButtons < 7) { Console.WriteLine("[PAD] This app needs at least 7 buttons configured in vJoy to work."); return; } else { Console.WriteLine("[PAD] Available buttons: " + nButtons); } bool sliderR = joystick.GetVJDAxisExist(id, HID_USAGES.HID_USAGE_SL0); bool sliderL = joystick.GetVJDAxisExist(id, HID_USAGES.HID_USAGE_SL1); if (sliderR && sliderL) { Console.WriteLine("[PAD] Sliders enabled"); } else { Console.WriteLine("[PAD] This app needs at least 2 sliders configured in vJoy to work."); return; } if ((status == VjdStat.VJD_STAT_OWN) || ((status == VjdStat.VJD_STAT_FREE) && (!joystick.AcquireVJD(id)))) { Console.WriteLine("[PAD] Failed to acquire vJoy device number {0}.", id); return; } else { Console.WriteLine("[PAD] Acquired: vJoy device number {0}.", id); } HandleOscPacket callback = delegate(OscPacket packet) { var messageReceived = (OscMessage)packet; string addr = messageReceived.Address; string content = messageReceived.Arguments[0].ToString(); switch (messageReceived.Address) { case "/btn-a": if (content == "P") { joystick.SetBtn(true, id, 1); } if (content == "R") { joystick.SetBtn(false, id, 1); } break; case "/btn-b": if (content == "P") { joystick.SetBtn(true, id, 2); } if (content == "R") { joystick.SetBtn(false, id, 2); } break; case "/btn-c": if (content == "P") { joystick.SetBtn(true, id, 3); } if (content == "R") { joystick.SetBtn(false, id, 3); } break; case "/btn-d": if (content == "P") { joystick.SetBtn(true, id, 4); } if (content == "R") { joystick.SetBtn(false, id, 4); } break; case "/fx-l": if (content == "P") { joystick.SetBtn(true, id, 5); } if (content == "R") { joystick.SetBtn(false, id, 5); } break; case "/fx-r": if (content == "P") { joystick.SetBtn(true, id, 6); } if (content == "R") { joystick.SetBtn(false, id, 6); } break; case "/start": if (content == "P") { joystick.SetBtn(true, id, 7); } if (content == "R") { joystick.SetBtn(false, id, 7); } break; case "/vol-l": //lastL = currL; //currL = float.Parse(content); //float deltaL = lastL - currL; //L -= deltaL; int lPos = int.Parse(content); joystick.SetAxis(lPos * 400, id, HID_USAGES.HID_USAGE_SL0); break; case "/vol-r": // lastR = currR; // currR = float.Parse(content); // float deltaR = lastR - currR; // R -= deltaR; int rPos = int.Parse(content); joystick.SetAxis(rPos * 400, id, HID_USAGES.HID_USAGE_SL1); break; } // Console.WriteLine("[OSC] Message Received: Address:" + messageReceived.Address + ", args: " + messageReceived.Arguments[0]); }; var listener = new UDPListener(32000, callback); Console.WriteLine("[OSC] Now listening to messages."); Console.WriteLine("[OSC] Press enter to stop"); Console.ReadLine(); listener.Close(); }
void OnDestroy() { print("Script was destroyed"); listener.Close(); }
void OnApplicationQuit() { listener.Close(); }
internal void CloseListener() { listener.Close(); }
public void Dispose() { _listener.Close(); }
public Task TotalMixListener(string bus, string ip, int port) { bankSettingInputBus.Clear(); bankSettingPlaybackBus.Clear(); bankSettingOutputBus.Clear(); var listener = new UDPListener(settings.ListeningPort); OscBundle message = null; bool done = false; string snapRegEx = @"^\/$"; Regex r = new Regex(snapRegEx, RegexOptions.IgnoreCase); SendOscCommand("/1/bus" + bus, 1.0f, ip, port); while (done == false) { message = (OscBundle)listener.Receive(); if (message != null) { Match m = r.Match(message.Messages[0].Address); if (bus == "Input") { for (int i = 0; i < message.Messages.Count; i++) { if (bankSettingInputBus.ContainsKey(message.Messages[i].Address)) { bankSettingInputBus.Remove(message.Messages[i].Address); } bankSettingInputBus.Add(message.Messages[i].Address, message.Messages[i].Arguments[0].ToString()); } if ((m.Success && bankSettingInputBus.Count >= 5) || bankSettingInputBus.Count > 145) { break; } } if (bus == "Playback") { for (int i = 0; i < message.Messages.Count; i++) { if (bankSettingPlaybackBus.ContainsKey(message.Messages[i].Address)) { bankSettingPlaybackBus.Remove(message.Messages[i].Address); } bankSettingPlaybackBus.Add(message.Messages[i].Address, message.Messages[i].Arguments[0].ToString()); } break; } if (bus == "Output") { for (int i = 0; i < message.Messages.Count; i++) { if (bankSettingOutputBus.ContainsKey(message.Messages[i].Address)) { bankSettingOutputBus.Remove(message.Messages[i].Address); } bankSettingOutputBus.Add(message.Messages[i].Address, message.Messages[i].Arguments[0].ToString()); } break; } } } listener.Close(); return(Task.CompletedTask); }
public static void Main(string[] args) { // Get a handle to the Calculator application. The window class // and window name were obtained using the Spy++ tool. IntPtr calculatorHandle = FindWindow(null, "Calculator"); // Verify that Calculator is a running process. if (calculatorHandle == IntPtr.Zero) { MessageBox.Show("Calculator is not running."); return; } Button button1 = new Button(); int i = 0; //string filePath = @"c:\temp\test.txt"; // Callback function for received OSC messages. // Prints EEG and Relative Alpha data only. HandleOscPacket callback = delegate(OscPacket packet) { var messageReceived = (OscMessage)packet; var addr = messageReceived.Address; if (addr == "/muse/elements/blink") { foreach (var arg in messageReceived.Arguments) { if (Convert.ToInt32(arg) == 1) { Console.WriteLine("counter: " + i); Console.WriteLine("1 Blink Detected"); if (i <= 6 && i >= 2) { Console.Write("Double Blink Detected"); SetForegroundWindow(calculatorHandle); SendKeys.SendWait("111"); SendKeys.SendWait("*"); SendKeys.SendWait("11"); SendKeys.SendWait("="); } else { Console.Write("Double Blink Not Deteced"); } i = 0; Console.WriteLine("Stopwatch Reset"); } else { i = i + 1; Console.WriteLine("Not Blink: " + i); } } } }; // Create an OSC server. var listener = new UDPListener(5000, callback); Console.WriteLine("Press enter to stop"); Console.ReadLine(); listener.Close(); }
public void TestMessage() { var listener = new UDPListener(55555); var sender = new SharpOSC.UDPSender("localhost", 55555); // Test every message type (except Symbol) var msg1 = new SharpOSC.OscMessage( "/test/address", 23, 42.42f, "hello world", new byte[3] { 2, 3, 4 }, -123456789123, new Timetag(DateTime.Now.Date).Tag, new Timetag(DateTime.Now.Date.AddMonths(1)), (double)1234567.890, new Symbol("wut wut"), (char)'x', new RGBA(20, 40, 60, 255), new Midi(3, 110, 55, 66), true, false, null, Double.PositiveInfinity ); OscMessage msgRevc = null; sender.Send(msg1); msgRevc = (OscMessage)listener.Receive(); Assert.NotNull(msgRevc); Assert.AreEqual("/test/address", msgRevc.Address); Assert.AreEqual(16, msgRevc.Arguments.Count); Assert.AreEqual(23, msgRevc.Arguments[0]); Assert.AreEqual(42.42f, msgRevc.Arguments[1]); Assert.AreEqual("hello world", msgRevc.Arguments[2]); Assert.AreEqual(new byte[3] { 2, 3, 4 }, msgRevc.Arguments[3]); Assert.AreEqual(-123456789123, msgRevc.Arguments[4]); Assert.AreEqual(new Timetag(DateTime.Now.Date), msgRevc.Arguments[5]); Assert.AreEqual(new Timetag(DateTime.Now.Date.AddMonths(1)), msgRevc.Arguments[6]); Assert.AreEqual((double)1234567.890, msgRevc.Arguments[7]); Assert.AreEqual(new Symbol("wut wut"), msgRevc.Arguments[8]); Assert.AreEqual((char)'x', msgRevc.Arguments[9]); Assert.AreEqual(new RGBA(20, 40, 60, 255), msgRevc.Arguments[10]); Assert.AreEqual(new Midi(3, 110, 55, 66), msgRevc.Arguments[11]); Assert.AreEqual(true, msgRevc.Arguments[12]); Assert.AreEqual(false, msgRevc.Arguments[13]); Assert.AreEqual(null, msgRevc.Arguments[14]); Assert.AreEqual(Double.PositiveInfinity, msgRevc.Arguments[15]); listener.Close(); }
public static void Main(string[] args) { // Get a handle to the Calculator application. The window class // and window name were obtained using the Spy++ tool. IntPtr calculatorHandle = FindWindow(null, "Calculator"); // Verify that Calculator is a running process. if (calculatorHandle == IntPtr.Zero) { MessageBox.Show("Calculator is not running."); return; } Button button1 = new Button(); int i = 0; //string filePath = @"c:\temp\test.txt"; // Callback function for received OSC messages. // Prints EEG and Relative Alpha data only. HandleOscPacket callback = delegate(OscPacket packet) { var messageReceived = (OscMessage)packet; var addr = messageReceived.Address; // if(addr == "/muse/elements/jaw_clench (0)") { // Console.Write("Jaw clench values: "); // foreach(var arg in messageReceived.Arguments) { // Console.Write(arg + " "); // } // } if (addr == "/muse/elements/blink") { //Stopwatch stopwatch = new Stopwatch(); //TimeSpan ts = new TimeSpan(); //stopwatch.Start(); foreach (var arg in messageReceived.Arguments) { if (Convert.ToInt32(arg) == 1) { Console.WriteLine("counter: " + i); Console.WriteLine("1 blink"); //stopwatch.Stop(); //ts = stopwatch.Elapsed; //ts.ToString("mm\\:ss\\.ff"); //Console.WriteLine("Elapsed:" + ts); //Console.WriteLine(stopwatch.ElapsedMilliseconds); if (i <= 6 && i >= 2) { Console.Write("+ DOUBLE BLINK"); SetForegroundWindow(calculatorHandle); SendKeys.SendWait("111"); SendKeys.SendWait("*"); SendKeys.SendWait("11"); SendKeys.SendWait("="); //button1.Click += new EventHandler(button1_Click); //0xB3 //SendMessage(0xffff, 0xB3, ); //Rectangle bounds = this.Bounds; //using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) //{ // using (Graphics g = Graphics.FromImage(bitmap)) // { // g.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size); // } // bitmap.Save("C://test.jpg", ImageFormat.Jpeg); //} //Process.Start(@"c:\temp\test.txt"); //File.Open(filePath, FileMode.Open, FileAccess.Read); } else { Console.Write("+ FAIL!!!!!"); } //stopwatch.Reset(); i = 0; Console.WriteLine("Stopwatch Reset"); //stopwatch.Start(); } else { i = i + 1; Console.WriteLine("Not Blink: " + i); } } } }; // Create an OSC server. var listener = new UDPListener(5000, callback); Console.WriteLine("Press enter to stop"); Console.ReadLine(); listener.Close(); }
public void changeScene() { listener.Close(); }