Inheritance: ScpDevice
        public ControlService()
        {
            //sp.Stream = Properties.Resources.EE;
            // Cause thread affinity to not be tied to main GUI thread

            /*Task x360task = new Task(() => { Thread.CurrentThread.Priority = ThreadPriority.AboveNormal; x360Bus = new X360Device(); });
             * x360task.Start();
             * while (!x360task.IsCompleted)
             *  Thread.SpinWait(500);
             */
            tempThread              = new Thread(() => { x360Bus = new X360Device(); });
            tempThread.Priority     = ThreadPriority.AboveNormal;
            tempThread.IsBackground = true;
            tempThread.Start();
            while (tempThread.IsAlive)
            {
                Thread.SpinWait(500);
            }

            AddtoDS4List();

            for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
            {
                processingData[i] = new X360Data();
                MappedState[i]    = new DS4State();
                CurrentState[i]   = new DS4State();
                PreviousState[i]  = new DS4State();
                ExposedState[i]   = new DS4StateExposed(CurrentState[i]);
            }

            _udpServer = new UdpServer(GetPadDetailForIdx);
        }
Ejemplo n.º 2
0
        public ControlService()
        {
            //sp.Stream = Properties.Resources.EE;
            // Cause thread affinity to not be tied to main GUI thread
            Thread x360Thread = new Thread(() => { x360Bus = new X360Device(); });

            x360Thread.IsBackground = true;
            x360Thread.Priority     = ThreadPriority.Normal;
            x360Thread.Name         = "SCP Virtual Bus Thread";
            x360Thread.Start();
            while (!x360Thread.ThreadState.HasFlag(ThreadState.Stopped))
            {
                Thread.SpinWait(500);
            }

            AddtoDS4List();

            for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
            {
                processingData[i] = new X360Data();
                MappedState[i]    = new DS4State();
                CurrentState[i]   = new DS4State();
                PreviousState[i]  = new DS4State();
                ExposedState[i]   = new DS4StateExposed(CurrentState[i]);
            }
        }
Ejemplo n.º 3
0
 public ControlService()
 {
     sp.Stream = Properties.Resources.EE;
     x360Bus   = new X360Device();
     AddtoDS4List();
     for (int i = 0; i < DS4Controllers.Length; i++)
     {
         processingData[i] = new X360Data();
         MappedState[i]    = new DS4State();
         CurrentState[i]   = new DS4State();
         PreviousState[i]  = new DS4State();
         ExposedState[i]   = new DS4StateExposed(CurrentState[i]);
     }
 }
Ejemplo n.º 4
0
        public ControlService()
        {
            //sp.Stream = Properties.Resources.EE;
            // Cause thread affinity to not be tied to main GUI thread
            tempThread              = new Thread(() => { x360Bus = new X360Device(); });
            tempThread.Priority     = ThreadPriority.AboveNormal;
            tempThread.IsBackground = true;
            tempThread.Start();
            while (tempThread.IsAlive)
            {
                Thread.SpinWait(500);
            }

            for (int i = 0, arlength = DS4Controllers.Length; i < arlength; i++)
            {
                processingData[i] = new X360Data();
                MappedState[i]    = new DS4State();
                CurrentState[i]   = new DS4State();
                TempState[i]      = new DS4State();
                PreviousState[i]  = new DS4State();
                ExposedState[i]   = new DS4StateExposed(CurrentState[i]);
            }
        }