Ejemplo n.º 1
0
        /// <summary>
        /// Joystick Pressed event
        /// </summary>
        /// <param name="e">Buttons, DPad, DirectionHat</param>
        void Joystick_JoystickPressed(JoystickPressedEventArgs e)
        {
            if (osdChannelList1.InvokeRequired)
            {
                JoystickPressedCallback d = new JoystickPressedCallback(Joystick_JoystickPressed);
                this.Invoke(d, new object[] { e });
            }
            else
            {
                label1.Text = e.TraceMessage;
                if (e.Buttons.Start)
                //if (e.Buttons.L)
                {
                    //_Timer.Stop();
                    this.Close();
                }
                if (e.Buttons.L)
                {
                    int nVolume = axVLCPlugin21.volume - 5;
                    if (nVolume < 0)
                        nVolume = 0;
                    axVLCPlugin21.volume = nVolume;

                }
                if (e.Buttons.R)
                {
                    int nVolume = axVLCPlugin21.volume + 5;
                    if (nVolume > 100)
                        nVolume = 100;
                    axVLCPlugin21.volume = nVolume;

                }
                if (_IsMenuShown)
                {
                    if (e.DPadDirection == DPad.Up || e.HatDirection == HatPosition.Up)
                    {
                        osdChannelList1.channelUp();
                    }
                    else if (e.DPadDirection == DPad.Down || e.HatDirection == HatPosition.Down)
                    {
                        osdChannelList1.channelDown();
                    }
                    else if (e.Buttons.A)
                    {
                        if (_IsMenuShown)
                        {
                            showOSD(!_IsMenuShown);
                            Application.DoEvents();
                            if (_CurrentPlaying != osdChannelList1.ChannelAddress)
                            {
                                axVLCPlugin21.playlist.clear();
                                axVLCPlugin21.playlist.add(osdChannelList1.ChannelAddress, null, null);
                                axVLCPlugin21.playlist.playItem(0);
                                _CurrentPlaying = osdChannelList1.ChannelAddress;
                            }
                        }
                    }
                    else if (e.Buttons.B)
                    {
                        showOSD(false);
                    }
                }
                else
                {
                    if (e.Buttons.A || e.Buttons.B || e.DPadDirection == DPad.Up || e.DPadDirection == DPad.Down || e.HatDirection == HatPosition.Up || e.HatDirection == HatPosition.Down )
                        showOSD(!_IsMenuShown || !e.Buttons.B);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Joystick Pressed event
 /// </summary>
 /// <param name="e">Buttons, DPad, DirectionHat</param>
 void j_JoystickPressed(JoystickPressedEventArgs e)
 {
     if (osdChannelList1.InvokeRequired)
     {
         JoystickPressedCallback d = new JoystickPressedCallback(j_JoystickPressed);
         this.Invoke(d, new object[] { e });
     }
     else
     {
         if (e.Buttons.L)
         {
             _Timer.Stop();
             this.Close();
         }
         if (_IsMenuShown)
         {
             if (e.DPadDirection == DPad.Up || e.HatDirection == HatPosition.Up)
             {
                 osdChannelList1.channelUp();
             }
             else if (e.DPadDirection == DPad.Down || e.HatDirection == HatPosition.Down)
             {
                 osdChannelList1.channelDown();
             }
             else if (e.Buttons.A)
             {
                 if (_IsMenuShown)
                 {
                     //axVLCPlugin21.playlist.clear();
                     //axVLCPlugin21.playlist.add(osdChannelList1.ChannelAddress, null, null);
                     //axVLCPlugin21.playlist.playItem(0);
                     showOSD(!_IsMenuShown);
                 }
             }
             if (e.Buttons.B)
             {
                 showOSD(false);
             }
         }
         else
         {
             showOSD(!_IsMenuShown && !e.Buttons.B);
         }
     }
 }