private void OnTouchUp(object sender, TouchEventArgs args) { //Check if tag bool isTag = args.TouchDevice.GetIsTagRecognized(); //When we take the object, we put all the value to zero if (isTag) { OSC oscm = new OSC(ip, port); UIElement relativeTo = this; Position = args.TouchDevice.GetOrientation(relativeTo); var tqg = args.TouchDevice.GetTagData(); OSCmsg omess = new OSCmsg("/vcs"); OSCmsg omess2 = new OSCmsg("/vcs"); switch (tqg.Value) { case 129: omess.addValue(3145731); omess.addValue(0.0f); break; case 128: omess.addValue(3145732); omess.addValue(0.0f); break; case 131: omess.addValue(3145733); omess.addValue(0.0f); break; case 132: omess.addValue(3145734); omess.addValue(0.0f); break; case 134: omess.addValue(3145729); omess.addValue(1.0f); break; default: omess.addValue(3145735); omess2.addValue(2); omess2.addValue(0.0f); oscm.sendOSCmsg(omess2); omess.addValue(0.0f); break; } oscm.sendOSCmsg(omess); } args.TouchDevice.Capture(ActiveArea); }
private void OnTouchMove(object sender, TouchEventArgs args) { //Check if tag bool isTag = args.TouchDevice.GetIsTagRecognized(); if (isTag) { var tqg = args.TouchDevice.GetTagData(); Console.WriteLine(tqg.Value); OSC oscm = new OSC(ip, port); UIElement relativeTo = this; OSCmsg omess = new OSCmsg("/vcs"); OSCmsg omess2 = new OSCmsg("/vcs"); //We check what is the tag value, and send the right parameter via OSC message switch (tqg.Value) { case 129: omess.addValue(3145731); break; case 128: omess.addValue(3145732); break; case 131: omess.addValue(3145733); break; case 132: omess.addValue(3145734); break; case 134: omess.addValue(3145729); break; default: omess.addValue(3145735); omess2.addValue(2); omess2.addValue(0.4f); oscm.sendOSCmsg(omess2); break; } omess.addValue((float)(args.TouchDevice.GetOrientation(relativeTo) / 360)); oscm.sendOSCmsg(omess); } args.TouchDevice.Capture(ActiveArea); }
public void sendOSCmsg(OSCmsg om) { byte[] Bval = new byte[4]; byte[] data = new byte[4]; string tt = ","; foreach (string s in om.typeTag) { tt = tt + s; } string cmd = formateMSG(om.msg) + formateMSG(tt); data = Encoding.ASCII.GetBytes(cmd); Bval = om.value[0]; for (int i = 1; i < om.value.Count; i++) { Bval = append(Bval, om.value[i]); } data = append(data, Bval); server.Send(data, data.Length); }
private void OnTouchDown(object sender, TouchEventArgs args) { //Check if tag bool isTag = args.TouchDevice.GetIsTagRecognized(); if (isTag) { var tqg = args.TouchDevice.GetTagData(); Console.WriteLine(tqg.Value); OSC oscm = new OSC(ip, port); UIElement relativeTo = this; OSCmsg omess = new OSCmsg("/vcs"); OSCmsg omess2 = new OSCmsg("/vcs"); //We check what is the tag value, and send the right parameter via OSC message switch (tqg.Value) { case 129: omess.addValue(3145731); break; case 128: omess.addValue(3145732); break; case 131: omess.addValue(3145733); break; case 132: omess.addValue(3145734); break; case 134: omess.addValue(3145729); break; default: omess.addValue(3145735); omess2.addValue(2); omess2.addValue(0.4f); oscm.sendOSCmsg(omess2); break; } omess.addValue((float)(args.TouchDevice.GetOrientation(relativeTo) / 360)); oscm.sendOSCmsg(omess); } args.TouchDevice.Capture(ActiveArea); }
private void OnTouchUp(object sender, TouchEventArgs args) { //Check if tag bool isTag = args.TouchDevice.GetIsTagRecognized(); //When we take the object, we put all the value to zero if (isTag) { OSC oscm = new OSC(ip, port); UIElement relativeTo = this; Position = args.TouchDevice.GetOrientation(relativeTo); var tqg = args.TouchDevice.GetTagData(); OSCmsg omess = new OSCmsg("/vcs"); OSCmsg omess2 = new OSCmsg("/vcs"); switch (tqg.Value) { case 129: omess.addValue(3145731); omess.addValue(0.0f); break; case 128: omess.addValue(3145732); omess.addValue(0.0f); break; case 131: omess.addValue(3145733); omess.addValue(0.0f); break; case 132: omess.addValue(3145734); omess.addValue(0.0f); break; case 134: omess.addValue(3145729); omess.addValue(1.0f); break; default: omess.addValue(3145735); omess2.addValue(2); omess2.addValue(0.0f); oscm.sendOSCmsg(omess2); omess.addValue(0.0f); break; } oscm.sendOSCmsg(omess); } args.TouchDevice.Capture(ActiveArea); }
public void addOSCmsg(OSCmsg om) { this.bundle.Add(om); }
public void addOSCmsg(OSCmsg om) { this.bundle.Add(om); }
public void sendOSCmsg(OSCmsg om) { byte[] Bval = new byte[4]; byte[] data = new byte[4]; string tt = ","; foreach (string s in om.typeTag) { tt = tt + s; } string cmd = formateMSG(om.msg) + formateMSG(tt); data = Encoding.ASCII.GetBytes(cmd); Bval = om.value[0]; for (int i = 1; i < om.value.Count; i++) { Bval = append(Bval, om.value[i]); } data = append(data, Bval); server.Send(data, data.Length); }