本文整理汇总了C#中OscMessage.Append方法的典型用法代码示例。如果您正苦于以下问题:C# OscMessage.Append方法的具体用法?C# OscMessage.Append怎么用?C# OscMessage.Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OscMessage
的用法示例。
在下文中一共展示了OscMessage.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTestBundle
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;
}
示例2: SendMessage
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);
}
示例3: BuildTrackMessage
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);
}
示例4: SendMessage
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);
}
示例5: GetCursorMessage
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;
}
示例6: limboViewerSetScene
// Limbo Viewer Message Send
private void limboViewerSetScene(int sceneNumber)
{
OscMessage msg = new OscMessage(limboViewerIP, "/view/scene");
msg.Append(sceneNumber);
msg.Send(limboViewerIP);
}
示例7: limboViewerSendSuccess
private void limboViewerSendSuccess(bool successStatus)
{
OscMessage msg = new OscMessage(limboViewerIP, "/view");
if (successStatus)
{
msg.Append("success");
}
else
{
msg.Append("fail");
}
msg.Send(limboViewerIP);
}
示例8: limboViewerPlayCountDown
private void limboViewerPlayCountDown()
{
OscMessage msg = new OscMessage(limboViewerIP, "/view");
msg.Append("countdown");
msg.Send(limboViewerIP);
}
示例9: limboViewerGetImageFromServer
private void limboViewerGetImageFromServer(int _userCount, int _cellPhoneNumber)
{
OscMessage msg = new OscMessage(limboViewerIP, "/view/merge");
msg.Append(_userCount.ToString() + "_0" + _cellPhoneNumber.ToString());
msg.Send(limboViewerIP);
}
示例10: limboStandSetStandHeight
// Limbo Stand Message Send
private void limboStandSetStandHeight(int _standHeight)
{
OscMessage msg = new OscMessage(limboStandIP, "/stand");
msg.Append(_standHeight);
msg.Send(limboStandIP);
}
示例11: imageServerIsAlive
private void imageServerIsAlive()
{
OscMessage msg = new OscMessage(imageServerIP, "/image");
msg.Append("test");
msg.Send(imageServerIP);
}
示例12: skeletonToOSCBundle
//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;
}
示例13: skeleton2DdataCoordEventArgsToOSCBundle
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;
}
开发者ID:JulianKemmerer,项目名称:Drexel-SeniorDesign,代码行数:23,代码来源:MainWindow.xaml+(M+C's+conflicted+copy+2013-03-04).cs
示例14: CreateMessage
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;
}
示例15: sendSkeletonData
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);
}
}
}