Ejemplo n.º 1
0
        void ControllerLoop()
        {
            if (XBoxIO.FindXBox())
            {
                if (XBoxIO.XBox.Gamepad == null)
                {
                    MessageBox.Show("Unable To Access Gamepad", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                    return;
                }
                else
                {
                    XBoxIO.XBox.Gamepad.InitializeControllerHook();
                    XBoxIO.XBox.Gamepad.OverrideControllers(true);
                }
            }
            else
            {
                Application.Exit();
                return;
            }

            running = true;
            while (running)
            {
                AcceptKeyboardInput(input, inputState);
                AcceptMouseInput(input, inputState);
            }
        }
Ejemplo n.º 2
0
        void StartStream()
        {
            lock (XBoxIO.XBox)
            {
                if (XBoxIO.XBox.Connected == false && XBoxIO.FindXBox() == false)
                {
                    checkLiveStream.Text = "Live Stream (Off)";
                    return;
                }

                if (videoStream != null)
                {
                    videoStream.End();
                }

                videoStream = new XboxVideoStream(XBoxIO.XBox,
                                                  (XboxVideoStream.VideoSize)cboStreamSize.SelectedItem,
                                                  XboxVideoStream.VideoQuality.Regular,
                                                  (XboxVideoStream.VideoPresentationInterval)cboFrameInterval.SelectedItem);

                videoStream.Begin();

                checkLiveStream.Text = "Live Stream (On)";
            }
        }
 private void cmdApply_Click(object sender, EventArgs e)
 {
     if (XBoxIO.FindXBox() == false)
     {
         return;
     }
     XBoxIO.XBox.SetLEDState((LEDState)cboState1.SelectedItem, (LEDState)cboState2.SelectedItem, (LEDState)cboState3.SelectedItem, (LEDState)cboState4.SelectedItem);
 }
Ejemplo n.º 4
0
 bool FindXbox()
 {
     Enabled = false;
     if (XBoxIO.FindXBox() == false)
     {
         Enabled = true;
         return(false);
     }
     return(true);
 }
        public SystemProperties()
        {
            InitializeComponent();

            if (XBoxIO.FindXBox() == false)
            {
                Close();
            }
            xboxProperties.SelectedObject = XBoxIO.XBox;
        }
Ejemplo n.º 6
0
        void cmdReset_Click(object sender, EventArgs e)
        {
            if (FindXbox() == false)
            {
                return;
            }

            XBoxIO.XBox.Reset();
            XBoxIO.FindXBox();

            CompletedOperation();
        }
Ejemplo n.º 7
0
        static void Main()
        {
            Control.CheckForIllegalCrossThreadCalls = false;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            XBoxIO.LoadSettings();
            if (XBoxIO.FindXBox())
            {
                ShowController();
            }
        }
Ejemplo n.º 8
0
        private void downloadFileWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            FileInformation selectedFile = (FileInformation)((object[])e.Argument)[0];
            string          filename     = (string)((object[])e.Argument)[1];
            string          workingDir   = CurrentDirectory;

            if (selectedFile.Attributes == FileAttributes.Directory)
            {
                XBoxIO.DownloadDirectory(selectedFile, workingDir, StatusChanged);
            }
            else
            {
                XBoxIO.DownloadFile(selectedFile, workingDir, SFD.FileName, StatusChanged);
            }
        }
Ejemplo n.º 9
0
        void ResumeStream()
        {
            lock (XBoxIO.XBox)
            {
                if (XBoxIO.XBox.Connected == false && XBoxIO.FindXBox() == false)
                {
                    checkLiveStream.Text = "Live Stream (Off)";
                    return;
                }

                LiveStreamPaused = false;
                videoStream.Restart();
                checkLiveStream.Text = "Live Stream (On)";
            }
        }
Ejemplo n.º 10
0
        void cmdCyclePower_Click(object sender, EventArgs e)
        {
            if (FindXbox() == false)
            {
                return;
            }

            try { XBoxIO.XBox.DmReboot(BootFlag.Cold, null); }
            catch { }
            finally
            {
                XBoxIO.FindXBox();
            }

            CompletedOperation();
        }
Ejemplo n.º 11
0
        static void Main()
        {
            Control.CheckForIllegalCrossThreadCalls = false;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            LoadExecutables();

            _LEDStateChanger = new LEDStateChanger();
            _memoryHacker    = new MemoryHacker();

            XBoxIO.LoadSettings();
            if (XBoxIO.FindXBox())
            {
                ShowXBoxExplorer();
            }
        }
Ejemplo n.º 12
0
        void sendFileWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string workingDir            = CurrentDirectory;
            List <FileInformation> files = (List <FileInformation>)e.Argument;

            foreach (FileInformation fi in files)
            {
                if (fi.Attributes == FileAttributes.Directory)
                {
                    XBoxIO.SendDirectory(fi, workingDir, StatusChanged);
                }
                else
                {
                    XBoxIO.SendFile(fi, workingDir, StatusChanged);
                }
            }
        }
Ejemplo n.º 13
0
        void deleteFileWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            string workingDir            = CurrentDirectory;
            List <FileInformation> files = (List <FileInformation>)e.Argument;

            foreach (FileInformation fi in files)
            {
                lblStatus.Text = "Deleting: " + fi.Name;
                if (fi.Attributes == FileAttributes.Directory)
                {
                    XBoxIO.DeleteDirectory(fi, workingDir, StatusChanged);
                }
                else
                {
                    XBoxIO.XBox.DeleteFile(Path.Combine(workingDir, fi.Name));
                }
            }
        }