Ejemplo n.º 1
0
        public string open(Dictionary <string, object> parameters)
        {
            try
            {
                string host = (string)parameters["host"];
                int    port = int.Parse((string)parameters["port"]);

                if (library == OSCLibrary.SharpOSC)
                {
                    sharposcclient = new SharpOSC.UDPSender(host, port);
                }

                else
                {
                    ventuzclient = new Ventuz.OSC.UdpWriter(host, port);
                }
            }
            catch (Exception ex)
            {
                return(ex.ToString());
            }

            return(null);
        }
        private void InitRuntime()
        {
            udpWriter = new Ventuz.OSC.UdpWriter("127.0.0.1", 20000); // TODO configure in GUI

            //Some Runtimes' status will be NotPowered, or some other error state. Only want to Initialize the runtime, if it is connected.
            if (_Kinect.Status == KinectStatus.Connected)
            {
                bool skeletalViewerAvailable = IsSkeletalViewerAvailable;

                // NOTE:  Skeletal tracking only works on one Kinect per process right now.
                RuntimeOptions = skeletalViewerAvailable ?
                                     RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor
                                     : RuntimeOptions.UseDepth | RuntimeOptions.UseColor;
                _Kinect.Initialize(RuntimeOptions);
                skeletonPanel.Visibility = skeletalViewerAvailable ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
                if (RuntimeOptions.HasFlag(RuntimeOptions.UseSkeletalTracking))
                {
                    _Kinect.SkeletonEngine.TransformSmooth = true;
                }
            }
        }