private static OscBundle CreateTestBundle() { IPEndPoint sourceEndPoint = new IPEndPoint(IPAddress.Loopback, Port); OscBundle bundle = new OscBundle(sourceEndPoint); OscBundle nestedBundle = new OscBundle(sourceEndPoint); OscMessage nestedMessage = new OscMessage(sourceEndPoint, TestMethod); nestedMessage.AppendNil(); nestedMessage.Append("Some String"); nestedMessage.Append(10); nestedMessage.Append(100000L); nestedMessage.Append(1234.567f); nestedMessage.Append(10.0012345); nestedMessage.Append(new byte[] { 1, 2, 3, 4 }); nestedMessage.Append(new OscTimeTag()); nestedMessage.Append('c'); nestedMessage.Append(Color.DarkGoldenrod); nestedMessage.Append(true); nestedMessage.Append(false); nestedMessage.Append(float.PositiveInfinity); nestedBundle.Append(nestedMessage); bundle.Append(nestedBundle); OscMessage message = new OscMessage(sourceEndPoint, AliveMethod); message.Append(9876.543f); bundle.Append(message); return bundle; }
/// <summary> /// 回転角や位置情報をOSCにより送信 /// </summary> /// <param name="rotHeadXYZ"></param> /// <param name="posHeadXYZ"></param> /// <param name="posHandRightXYZ"></param> /// <param name="posHandLeftXYZ"></param> private void SendOSCMessage(Vector3DF rotHeadXYZ, Vector3DF posHeadXYZ, Vector3DF posHandRightXYZ, Vector3DF posHandLeftXYZ) { // OSCメッセージ生成 OscMessage rotHeadOsc = new OscMessage(from, "/head_rot", null); OscMessage posHeadOsc = new OscMessage(from, "/head_pos", null); OscMessage posHandRightOsc = new OscMessage(from, "/hand_r", null); OscMessage posHandLeftOsc = new OscMessage(from, "/hand_l", null); // 情報の追加 rotHeadOsc.Append <float>(rotHeadXYZ.x); rotHeadOsc.Append <float>(rotHeadXYZ.y); rotHeadOsc.Append <float>(rotHeadXYZ.z); posHeadOsc.Append <float>(posHeadXYZ.x); posHeadOsc.Append <float>(posHeadXYZ.y); posHeadOsc.Append <float>(posHeadXYZ.z); posHandRightOsc.Append <float>(posHandRightXYZ.x); posHandRightOsc.Append <float>(posHandRightXYZ.y); posHandRightOsc.Append <float>(posHandRightXYZ.z); posHandLeftOsc.Append <float>(posHandLeftXYZ.x); posHandLeftOsc.Append <float>(posHandLeftXYZ.y); posHandLeftOsc.Append <float>(posHandLeftXYZ.z); // 送信 rotHeadOsc.Send(toExp); posHeadOsc.Send(toExp); posHandRightOsc.Send(toExp); posHandLeftOsc.Send(toExp); }
void DoSendCommand(string command, params object[] args) { var endPoint = new IPEndPoint(IPAddress.Parse(address), port); var oscMessage = new OscMessage(endPoint, "/" + command); foreach (var arg in args) { if (arg is int) { oscMessage.Append <int> ((int)arg); } else if (arg is float) { oscMessage.Append <float> ((float)arg); } else { oscMessage.Append <string> (arg.ToString()); } } // Spam a few of the same message, effectively solves UDP unreliability in a clunky way for (int i = 0; i < 5; i++) { oscMessage.Send(endPoint); } }
// // message helpers // private OscMessage CreateSourceMessage(string type) { OscMessage msg = new OscMessage("/tuio/" + type); msg.Append("source"); msg.Append("TUIO Simulator@" + localIPAddresses); return(msg); }
private OscMessage CreateFSeqMessage(string type) { OscMessage msg = new OscMessage("/tuio/" + type); msg.Append("fseq"); msg.Append(fseq); return(msg); }
// Update is called once per frame public void SendPosition() { OscMessage m = new OscMessage(address); m.Append(transform.position.x); m.Append(transform.position.y); m.Append(transform.position.z); transmitter.Send(m); }
private void SendAxesGesture(string gesture, Vector3 axes) { // Message with address "/id/axes_gesture" OscMessage msg = new OscMessage("/" + display.id + "/axes_gesture"); // Set the gesture msg.Append(gesture); msg.Append(axes.x); msg.Append(axes.y); msg.Append(axes.z); // Send the transform data to master _transmitter.Send(msg); }
private static OscBundle CreateTestBundle() { IPEndPoint sourceEndPoint = new IPEndPoint(IPAddress.Loopback, Port); OscBundle bundle = new OscBundle(sourceEndPoint); OscBundle nestedBundle = new OscBundle(sourceEndPoint); OscMessage nestedMessage = new OscMessage(sourceEndPoint, TestMethod); nestedMessage.AppendNil(); nestedMessage.Append("Some String"); nestedMessage.Append(10); nestedMessage.Append(100000L); nestedMessage.Append(1234.567f); nestedMessage.Append(10.0012345); nestedMessage.Append(new byte[] { 1, 2, 3, 4 }); nestedMessage.Append(new OscTimeTag()); nestedMessage.Append('c'); nestedMessage.Append(Color.DarkGoldenrod); nestedMessage.Append(true); nestedMessage.Append(false); nestedMessage.Append(float.PositiveInfinity); nestedBundle.Append(nestedMessage); bundle.Append(nestedBundle); OscMessage message = new OscMessage(sourceEndPoint, AliveMethod); message.Append(9876.543f); bundle.Append(message); return(bundle); }
public void sendPickupCount(int count) { controllerOscMessage = new OscMessage("/playerPositionX"); controllerOscMessage.Append(1.0f); oscTransmitter.Send(controllerOscMessage); }
private OscMessage CreateAliveMessage(string type) { OscMessage msg = new OscMessage("/tuio/" + type); msg.Append("alive"); return(msg); }
// Send QTM OSC Command to server private void SendCommand(string cmd) { qtmCommand.ClearData(); qtmCommand.Append(cmd); LogMessage(qtmCommand); qtmCommand.Send(serverEndPoint); }
/// <summary> /// Delivers the value to method. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="stream">The stream.</param> /// <param name="method">The method.</param> /// <param name="value">The value.</param> private static void DeliverValueToMethod <T>(this IObserver <OscPacket> stream, string method, T value) { var msg = new OscMessage(method); msg.Append(value); stream.OnNext(msg); }
private static OscPacket DeserialiseMessage(JsonReader reader, string address) { reader.Read(); // read property tags var tags = reader.ReadAsString(); var msg = new OscMessage(address); reader.Read(); // data property name reader.Read(); // array start for (var index = 0; index < tags.Length; index++) { var tag = tags[index]; if (tag == JsonSerializerFactory.ArrayOpen) { // skip the '[' character. index++; // deserialise array of object var ret = new List <object>(); while (tags[index] != JsonSerializerFactory.ArrayClose && index < tags.Length) { var des = JsonSerializerFactory.GetSerializer(tags[index]); ret.Add(des.Decode(reader)); index++; } msg.Append(ret.ToArray()); } else if (tag != JsonSerializerFactory.DefaultTag) { if (tag != JsonSerializerFactory.EventTag) { var des = JsonSerializerFactory.GetSerializer(tag); msg.Append(des.Decode(reader)); } else { msg.IsEvent = true; } } } reader.Read(); // array end return(msg); }
private OscMessage CreateOscMessage(SensorData sensorData) { OscMessage dataOscMessage = new OscMessage(_sourceEndPoint, "/taprapper/sensordata", sOscClient); dataOscMessage.Append(sensorData.AccDataObject.DataVector.X); dataOscMessage.Append(sensorData.AccDataObject.DataVector.Y); dataOscMessage.Append(sensorData.AccDataObject.DataVector.Z); dataOscMessage.Append(sensorData.GyroDataObject.Pitch); dataOscMessage.Append(sensorData.GyroDataObject.Roll); dataOscMessage.Append(sensorData.GyroDataObject.Yaw); dataOscMessage.Append(sensorData.QuaternionObject.X); dataOscMessage.Append(sensorData.QuaternionObject.Y); dataOscMessage.Append(sensorData.QuaternionObject.Z); dataOscMessage.Append(sensorData.QuaternionObject.W); return(dataOscMessage); }
void OnCollisionEnter(Collision collision) { if (!clicked) { var s = stroke.GetComponent <Stroke>(); if (s.NumberOfStrokes > 0) { var sound = collision.gameObject.GetComponent <Sound>(); OscMessage m = new OscMessage(audiomesh_address); m.Append(sound.AudioIndex); m.Append(0.0); var percentage = ((float)sound.Index) / s.NumberOfStrokes; m.Append(percentage); transmitter.Send(m); } } }
private void Controller_MenuUnclicked(object sender, ClickedEventArgs e) { OscMessage m = new OscMessage(reset_address); m.Append(0.0f); transmitter.Send(m); DestroyImmediate(strokes); strokes = new GameObject(); Sound.GlobalIndex = 1; }
/// <summary> /// Sends an OSC message to the remote host. /// </summary> public void Send(string message, params float[] args) { var msg = new OscMessage(OSCSettings.SourceEndPoint, message); foreach (var f in args) { msg.Append(f); } msg.Send(Target); }
public void TestArraySerialisation3() { var msg = new OscMessage("/test", new object[] { 1, 2f, "foo" }); msg.Append(1); // the last argument is an integer. var expected = CreateExpectedDataArray3(); msg.TypeTag.Should().Be(",[ifs]i"); OscValidation.AssertSamePacket(expected, msg.ToByteArray()); }
private void AppendMessage(string address, List <object> values) { OscMessage messageToSend = new OscMessage(localEndPoint, address); // messageToSend.ClearData(); // do i need this? foreach (object message in values) { messageToSend.Append(message); } messagesThisFrame.Add(messageToSend); }
/// <summary> /// Send message to osc device. /// </summary> /// <param name="address">Address where to send the message.</param> /// <param name="value">List of Message(s) or value(s) to send.</param> /// <param name="ipAddress">IP address of the osc device.</param> /// <param name="port">Port of the osc device.</param> private void sendOscMessage(string address, IList <object> data, IPAddress ipAddress, int port) { IPEndPoint sourceEndPoint = new IPEndPoint(ipAddress, port); OscMessage oscMessage = new OscMessage(sourceEndPoint, address); foreach (object value in data) { oscMessage.Append(value); } oscMessage.Send(sourceEndPoint); }
private void BuildTrackMessage(int[][] score, OscMessage m, int trackCount) { if (IsShortTrack(score, trackCount)) { positions[trackCount] = 0; } if (HasBeat(score, trackCount)) m.Append(trackCount + 1); ProgressTrackPosition(trackCount); }
private static void SendMessage(string messageText) { var message = new OscMessage(endPoint, "/"); foreach (var item in messageText.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { message.Append(item); } message.Send(endPoint); }
private void SendButtonGesture(string gesture) { // Message with address "/id/button_gesture" OscMessage msg = new OscMessage("/" + display.id + "/button_gesture"); // Set the gesture msg.Append(gesture); // Send the transform data to master _transmitter.Send(msg); }
private void AppendToBundle <T>(OscBundle oscBundle, OscMessage sourceMsg, OscMessage aliveMsg, OscMessage fseqMsg, bool forceSet = false) where T : ITUIOEntity { // http://www.tuio.org/?specification - Message & Bundle Format // // /tuio/2Dcur source application@address // /tuio/2Dcur alive s_id0 ... s_idN // /tuio/2Dcur set s x y X Y m // /tuio/2Dcur fseq f_id // // nb. TUIOsharp does not enforce an order for alive/set messages so long as they're before fseq oscBundle.Append(sourceMsg); // entities: alive, set aliveMsg.ClearData(); // nb. also clears address aliveMsg.Append("alive"); oscBundle.Append(aliveMsg); for (int i = 0; i < _entities.Count; i++) { ITUIOEntity e = _entities[i]; if (e.GetType() != typeof(T)) { continue; } aliveMsg.Append(e.Id); if (forceSet || e.isSendRequired) { oscBundle.Append(e.oscMessage); // set e.isSendRequired = false; } } // frame sequence fseqMsg.UpdateDataAt(1, fseq); oscBundle.Append(fseqMsg); }
private void HandleTriggerClicked(object sender, ClickedEventArgs e) { clicked = true; points.Clear(); stroke = new GameObject(stroke_object, typeof(Stroke)); stroke.transform.parent = strokes.transform; stroke_index = -1; OscMessage m = new OscMessage(trigger_address); m.Append(transform.position.x); transmitter.Send(m); }
private void Controller_TriggerUnclicked(object sender, ClickedEventArgs e) { clicked = false; lastStroke.points = points.ToArray(); stroke.GetComponent <Stroke>().NumberOfStrokes = points.Count; OscMessage m = new OscMessage(trigger_address); m.Append(0); transmitter.Send(m); soundMarker.AudioIndex = Sound.GlobalIndex++; }
// --- game functions --- public void sendOSCPlayerPosition(float x, float z) { //controllerOscMessage = new OscMessage (spherePositionNamespace); controllerOscMessage = new OscMessage("/playerPositionX"); //print("Test"); controllerOscMessage.Append(x); //controllerOscMessage.Append (z); //controllerOscMessage.Append("/1/toggle1, f"); //oscTransmitter.Send (controllerOscMessage); // /sphere/position 8.3 -3.1 }
public void TestArraySerialisation4() { var msg = new OscMessage("/test", new object[] { 1, 2f, "foo" }); var blob = CreateTestBlob(); msg.Append(blob); // the last argument is a blob. var expected = CreateExpectedDataArray4(); msg.TypeTag.Should().Be(",[ifs]b"); OscValidation.AssertSamePacket(expected, msg.ToByteArray()); }
/// <summary> /// Sends an OSC message to all connected Ableton Live sessions. /// </summary> public void Send(string message, params float[] args) { var msg = new OscMessage(SourceEndPoint, message); foreach (var f in args) { msg.Append(f); } foreach (var target in Targets) { msg.Send(target); } }
private void BuildTrackMessage(int[][] score, OscMessage m, int trackCount) { if (IsShortTrack(score, trackCount)) { positions[trackCount] = 0; } if (HasBeat(score, trackCount)) { m.Append(trackCount + 1); } ProgressTrackPosition(trackCount); }
private void SendMessage(string address, int[] values = null) { OscMessage msg = new OscMessage(source, string.Format(MESSAGE_FORMAT, address)); if (values != null) { foreach (object v in values) { msg.Append(v); } } msg.Send(dest); }
// Send data through OSC private void SendOSCX(string address, params object[] args) { // Message with address "/id/button_gesture" OscMessage msg = new OscMessage(address); // Set the gesture foreach (object arg in args) { msg.Append(arg); } // Send the transform data to master _transmitterX.Send(msg); }
/** * Creates an OSC formatted message using the current key/value pairs within the * local Peer.stateVars dictionary. Each key is represented as a component of the * string address (separated by forward slashes). Each value is appended to the * OSC packet using the appropriate bit packing method. The index parameter is used * to help the remote ServerConnection object match the OSC message with its locally * stored list of Client instances. * * @param index the integer sent to the client upon registration * @return TRUE if stateTransmitter was properly initialized, FALSE otherwise */ internal bool PropagateStateVars(int index) { bool propagated = false; if (this.stateVarsInvalidated && null != this.stateTransmitter && this.stateTransmitter.IsConnected() && this.stateVars.Count > 0) { string address = ""; OscMessage message = new OscMessage(""); message.Append(index); foreach (KeyValuePair <string, object> pair in this.stateVars) { address += pair.Key + "/"; message.Append(pair.Value); } message.Address = address; this.stateTransmitter.Send(message); //UnityMainThreadDispatcher.Instance ().Enqueue (ExsecuteOnMainThread_TimeCheck ()); propagated = true; } this.stateVarsInvalidated = false; return(propagated); }
private OscBundle CreateBundle() { var ipAddress = _setting.UseLoopback ? IPAddress.Loopback : IPAddress.Parse(_setting.IpAddress); var sourceEndPoint = new IPEndPoint(ipAddress, _setting.Port); var bundle = new OscBundle(sourceEndPoint); var nestedBundle = new OscBundle(sourceEndPoint); foreach (var bindValue in _setting.BindValues) { var message = new OscMessage(sourceEndPoint, bindValue.Address); message.Append(bindValue.Value); nestedBundle.Append(message); } bundle.Append(nestedBundle); return(bundle); }
private void limboViewerCaptureFree(int _userCount , int _cellPhoneNumber) { OscMessage msg = new OscMessage(limboViewerIP, "/view/picture"); msg.Append(_userCount.ToString() + "_0" + _cellPhoneNumber.ToString()); msg.Send(limboViewerIP); }
OscBundle skeleton2DdataCoordEventArgsToOSCBundle(Skeleton2DdataCoordEventArgs e) { //Bundles are collections of messages OscBundle bundle = new OscBundle(transmitter_ipendpoint); //Messages are like packets, label with their type by method name OscMessage message = new OscMessage(transmitter_ipendpoint, DEMO_METHOD); //Both bundles and messages can be nested //Must have at least one bundle and on message //Send the whole skeleton //First send the index message.Append(e.index); //Then append each point in order, x then y int num_points = e._points.Count(); for (int i = 0; i < num_points; i++) { Point normalized_point = normalize_skeleton_point(e._points[i]); message.Append((float)normalized_point.X); message.Append((float)normalized_point.Y); } bundle.Append(message); return bundle; }
private OscMessage GetCursorMessage(TuioCursor cursor) { OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); msg.Append("set"); msg.Append((Int32)cursor.Id); msg.Append(cursor.Location.X); msg.Append(cursor.Location.Y); msg.Append(cursor.Speed.X); msg.Append(cursor.Speed.Y); msg.Append(cursor.MotionAcceleration); return msg; }
// Limbo Viewer Message Send private void limboViewerSetScene(int sceneNumber) { OscMessage msg = new OscMessage(limboViewerIP, "/view/scene"); msg.Append(sceneNumber); msg.Send(limboViewerIP); }
private void limboViewerSendSuccess(bool successStatus) { OscMessage msg = new OscMessage(limboViewerIP, "/view"); if (successStatus) { msg.Append("success"); } else { msg.Append("fail"); } msg.Send(limboViewerIP); }
private void limboViewerPlayCountDown() { OscMessage msg = new OscMessage(limboViewerIP, "/view"); msg.Append("countdown"); msg.Send(limboViewerIP); }
// iPad Message Send //private void iPadSendPicture(int _userCount) //{ // OscMessage msg = new OscMessage(ipadIP, "/ipad/picture"); // msg.Append(_userCount); // msg.Send(ipadIP); //} private void iPadNextUserReady() { OscMessage msg = new OscMessage(ipadIP, "/ipad"); msg.Append("ready"); msg.Send(ipadIP); }
private void iPadIsAlive() { OscMessage msg = new OscMessage(ipadIP, "/ipad"); msg.Append("test"); msg.Send(ipadIP); }
private void imageServerTakePhoto(int _userCount, int _cellPhoneNumber) { OscMessage msg = new OscMessage(imageServerIP, "/image/picture"); msg.Append(_userCount.ToString()+"_0"+_cellPhoneNumber.ToString()); msg.Send(imageServerIP); }
// Image Server Message Send private void imageServerMergeImage() { OscMessage msg = new OscMessage(imageServerIP, "/image"); msg.Append("merge"); msg.Send(imageServerIP); }
private void imageServerIsAlive() { OscMessage msg = new OscMessage(imageServerIP, "/image"); msg.Append("test"); msg.Send(imageServerIP); }
public void sendSkeletonData(Skeleton skeleton_data, int i ) { IPEndPoint sourceEndPoint = new IPEndPoint(IPAddress.Loopback, Port); OscBundle sBundle = new OscBundle(sourceEndPoint); //OscMessage sMessage = new OscMessage(sourceEndPoint, "/skeleton", client); foreach (Joint joint in skeleton_data.Joints) { if (this.oscCheck.IsChecked.HasValue && this.oscCheck.IsChecked.Value) { OscMessage oscMessage = new OscMessage(sourceEndPoint, "/skeleton", client); oscMessage.Append(joint.JointType.ToString()); oscMessage.Append(i.ToString()); oscMessage.Append(joint.Position.X.ToString()); oscMessage.Append(joint.Position.Y.ToString()); oscMessage.Append(joint.Position.Z.ToString()); oscMessage.Send(Destination); } } }
public static OscMessage CreateMessage(string Address) { Address = Address.Trim(); string Value = null; if (Address.IndexOf(" ") > 0) { Value = Address.Substring(Address.IndexOf(" ") + 1); Address = Address.Substring(0, Address.IndexOf(" ")); } OscMessage msg = new OscMessage(sourceEndPoint, Address); if (Value != null) { if (Address.EndsWith("updates") || Address.EndsWith("loadAt") || Address.EndsWith("preWait") || Address.EndsWith("duration") || Address.EndsWith("postWait") || Address.EndsWith("continueMode") || Address.EndsWith("flagged") || Address.EndsWith("armed") || Address.EndsWith("patch") || Address.EndsWith("startTime") || Address.EndsWith("endTime") || Address.EndsWith("playCount") || Address.EndsWith("infiniteLoop") || Address.EndsWith("rate") || Address.EndsWith("doFade") || Address.EndsWith("surfaceID") || Address.EndsWith("fullScreen") || Address.EndsWith("preserveAspectRatio") || Address.EndsWith("translationX") || Address.EndsWith("translationY") || Address.EndsWith("scaleX") || Address.EndsWith("scaleY") || Address.EndsWith("doEffect") || Address.EndsWith("effect")) { msg.Append<float>((float)Convert.ToDouble(Value)); } else if (Address.EndsWith("sliderLevel")) { if (Value.Contains(" ")) { msg.Append<float>((float)Convert.ToDouble(Value.Substring(0, Value.IndexOf(" ")))); Value = Value.Substring(Value.IndexOf(" ") + 1); } msg.Append<float>((float)Convert.ToDouble(Value)); } else { msg.Append<string>(Value); } } return msg; }
private void limboViewerGetImageFromServer(int _userCount, int _cellPhoneNumber) { OscMessage msg = new OscMessage(limboViewerIP, "/view/merge"); msg.Append(_userCount.ToString() + "_0" + _cellPhoneNumber.ToString()); msg.Send(limboViewerIP); }
private void limboViewerIsAlive() { OscMessage msg = new OscMessage(limboViewerIP, "/view"); msg.Append("test"); msg.Send(limboViewerIP); }
private void iPadSendSuccess(bool successStatus) { // keep trying until 'photoReady = true' OscMessage msg; if (successStatus) { msg = new OscMessage(limboViewerIP, "/ipad/success"); msg.Append(userCount.ToString() + "_0"+ cellPhoneNumber.ToString()); } else { msg = new OscMessage(limboViewerIP, "/ipad/fail"); msg.Append(userCount.ToString() + "_0" + cellPhoneNumber.ToString()); } userCount++; MySettings.Default.userCountSetting = userCount; this.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate { userCountDisplay.Text = userCount.ToString(); })); msg.Send(ipadIP); }
private void limboViewerPlaySlideView() { OscMessage msg = new OscMessage(limboViewerIP, "/view"); msg.Append("slideview"); msg.Send(limboViewerIP); }
private void iPadTestButton_Click(object sender, RoutedEventArgs e) { msg = new OscMessage(ipadIP, iPadMsgAddr); msg.Append(iPadMsgArg); msg.Send(ipadIP); }
private void limboViewerSendUserTracked() { OscMessage msg = new OscMessage(limboViewerIP, "/view/user"); msg.Append("tracked"); msg.Send(limboViewerIP); }
// Kinect Message Send private void kinectOn(int kinect) { string addr = "/kinect/" + kinect.ToString(); if(kinect == 1) { OscMessage msg = new OscMessage(kinectFrontIP, addr); ; msg.Append("on"); msg.Send(kinectFrontIP); } else if (kinect == 2) { OscMessage msg = new OscMessage(kinectBackIP, addr); ; msg.Append("on"); msg.Send(kinectBackIP); } else { return; } }
private void limboStandIsAlive() { OscMessage msg = new OscMessage(limboStandIP, "/stand"); msg.Append("test"); msg.Send(limboStandIP); }
private void limboStandReset() { OscMessage msg = new OscMessage(limboStandIP, "/stand"); msg.Append("reset"); msg.Send(limboStandIP); }
private OscMessage GetAliveMessage() { OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); msg.Append("alive"); lock (_cursors) foreach (TuioCursor cursor in _cursors.Values) msg.Append((Int32)cursor.Id); return msg; }
// Limbo Stand Message Send private void limboStandSetStandHeight(int _standHeight) { OscMessage msg = new OscMessage(limboStandIP, "/stand"); msg.Append(_standHeight); msg.Send(limboStandIP); }
private OscMessage GetSequenceMessage() { OscMessage msg = new OscMessage(_ipEndPoint, _cursorAddressPattern); msg.Append("fseq"); msg.Append((Int32)_currentFrame); return msg; }
//Return an OSC bundle for skeleton index provided /* OscBundle skeletonToOSCBundle(Skeleton s, int index) { Skeleton2DdataCoordEventArgs e = Skeleton2DDataExtract.skeletonToSkeleton2DdataCoordEventArgs(s, index); return skeleton2DdataCoordEventArgsToOSCBundle(e); } */ OscBundle skeleton2DdataCoordEventArgsToOSCBundle(Skeleton2DdataCoordEventArgs e) { //Bundles are collections of messages OscBundle bundle = new OscBundle(transmitter_ipendpoint); //Messages are like packets, label with their type by method name OscMessage message = new OscMessage(transmitter_ipendpoint, SKELETON_METHOD); //Both bundles and messages can be nested //Must have at least one bundle and on message //Send the whole skeleton //Send packet number message.Append(sent_bundles); //Debug.WriteLine("Sent bundle: " + sent_bundles); //Send the index message.Append(e.index); //Then append each point in order, x then y int num_points = e._points.Count(); for (int i = 0; i < num_points; i++) { Point normalized_point = normalize_skeleton_point(e._points[i]); message.Append((float)normalized_point.X); message.Append((float)normalized_point.Y); } message.Append(kinect_id); //#19 //There are 19 things appended to this message. If you add more, //you must change the numSkeletonOSCArgs in the c++ code bundle.Append(message); return bundle; }