[fixed] EPG - Inconsistent behaviour when scrolling with page up/down (1 Viewer)

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    The attached logs are from debug mode. Start MP / enter EPG / Down two steps to 3 / Press page up and end up at 67 / Press page down and end up at 72 / A final page down wraps the list to 1.
    //Johannes

    Ah, now I really *can* reproduce! It doesn't seem to be consistent yet - trying to spot the pattern.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Okay, here is what I see. I have 15 channels in my list. Testing wrapping with page-up, I don't get page-up stopping at the top *if I start from positions 1 through 5*. At positions >= 6 I get the page-up stopping at the top, and then a further page-up rolls around. It doesn't focus the last item in the list, which I think would be nicer. I can't reproduce with page-down, and (like I've already said) page-down takes me to the last item->another page-down takes me to the first item (which I like better than the page-up behaviour - it is also consistent with the wrapping in the mini-guide, which wraps from the last item to the first when you press the down arrow and vice-versa).
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    The attached logs are from debug mode. Start MP / enter EPG / Down two steps to 3 / Press page up and end up at 67 / Press page down and end up at 72 / A final page down wraps the list to 1.
    //Johannes

    Ah, now I really *can* reproduce! It doesn't seem to be consistent yet - trying to spot the pattern.

    If you are focused on the channel name, this happens.

    If you are focused on a program name in the EPG, it all works fine.

    If you can both confirm that this is the case, it should not be too hard to fix.

    Mark
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    If you are focused on the channel name, this happens.
    For me that makes a further difference. Focus on the channel name and the focus doesn't ever seem to stop at the first channel - it always wraps 10 (???) places around.

    If you are focused on a program name in the EPG, it all works fine.
    No, my results before were with program names. In other words, the issue occurs when you've selected a program that is within the first 5 channels. It doesn't occur if you select a program from channels greater than or equal to position 6...

    If you can both confirm that this is the case, it should not be too hard to fix.
    I'd have no idea how to fix this, so I'm glad you know. :D

    *Thank you*
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    If you are focused on the channel name, this happens.
    For me that makes a further difference. Focus on the channel name and the focus doesn't ever seem to stop at the first channel - it always wraps 10 (???) places around.

    If you are focused on a program name in the EPG, it all works fine.
    No, my results before were with program names. In other words, the issue occurs when you've selected a program that is within the first 5 channels. It doesn't occur if you select a program from channels greater than or equal to position 6...

    Okay, that is very strange. For me, I cannot reproduce the problem at all if I have focus on a program name, but there is definitely a problem when focus is on the channel name.

    Do you have time to PM Andy (ajp)? This is his area!

    Best wishes,

    Mark
     

    glenn 1990

    Portal Pro
    July 1, 2010
    247
    36
    Home Country
    Belgium Belgium
    If you are focused on the channel name, this happens.
    For me that makes a further difference. Focus on the channel name and the focus doesn't ever seem to stop at the first channel - it always wraps 10 (???) places around.

    If you are focused on a program name in the EPG, it all works fine.
    No, my results before were with program names. In other words, the issue occurs when you've selected a program that is within the first 5 channels. It doesn't occur if you select a program from channels greater than or equal to position 6...

    If you can both confirm that this is the case, it should not be too hard to fix.
    I'd have no idea how to fix this, so I'm glad you know. :D

    *Thank you*

    I fixed the same issue for the 4TR guide yesterday,
    I just modifed OnPageUp() a bit in guidebase.cs

    This is how it looks now.
    Code:
            private void OnPageUp()
            {
                int Steps;
                if (_singleChannelView)
                    Steps = _channelCount; // all available rows
                else
                {
                    if (_guideContinuousScroll)
                    {
                        Steps = _channelCount; // all available rows
                    }
                    else
                    {
                        // If we're on the first channel in the guide then allow one step to get back to the end of the guide.
                        if (_channelOffset == 0 && _cursorX == 0)
                        {
                            Steps = 1;
                        }
                        else
                        {
                            // only number of additional avail channels
                            Steps = Math.Min(_channelOffset + _cursorX + 1, _channelCount);
                        }
                    }
                }
    
                UnFocus();
                for (int i = 0; i < Steps; ++i)
                {
                    OnUp(true, true);
                }
                Correct();
                Update(false);
                SetFocus();
            }
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    If you are focused on the channel name, this happens.
    For me that makes a further difference. Focus on the channel name and the focus doesn't ever seem to stop at the first channel - it always wraps 10 (???) places around.


    No, my results before were with program names. In other words, the issue occurs when you've selected a program that is within the first 5 channels. It doesn't occur if you select a program from channels greater than or equal to position 6...

    If you can both confirm that this is the case, it should not be too hard to fix.
    I'd have no idea how to fix this, so I'm glad you know. :D

    *Thank you*

    I fixed the same issue for the 4TR guide yesterday,
    I just modifed OnPageUp() a bit in guidebase.cs

    This is how it looks now.
    Code:
            private void OnPageUp()
            {
                int Steps;
                if (_singleChannelView)
                    Steps = _channelCount; // all available rows
                else
                {
                    if (_guideContinuousScroll)
                    {
                        Steps = _channelCount; // all available rows
                    }
                    else
                    {
                        // If we're on the first channel in the guide then allow one step to get back to the end of the guide.
                        if (_channelOffset == 0 && _cursorX == 0)
                        {
                            Steps = 1;
                        }
                        else
                        {
                            // only number of additional avail channels
                            Steps = Math.Min(_channelOffset + _cursorX + 1, _channelCount);
                        }
                    }
                }
    
                UnFocus();
                for (int i = 0; i < Steps; ++i)
                {
                    OnUp(true, true);
                }
                Correct();
                Update(false);
                SetFocus();
            }

    Does this also correct the behaviour being different depending on whether you are focused on channel name or program name?

    Edit: wild speculation here. If 'singleChannelView' true if you are in normal EPG view but focused on the channel name? This would explain the current behaviour.

    Mark
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Current SVN has

    Code:
        private void OnPageUp()
        {
          UnFocus();
          for (int i = 0; i < _channelCount; ++i)
          {
            OnUp(true, true);
          }
          Correct();
          Update(false);
          SetFocus();
        }
    
        private void OnPageDown()
        {
          int Steps;
          if (_singleChannelView)
            Steps = _channelCount; // all available rows
          else
          {
            if (_guideContinuousScroll)
            {
              Steps = _channelCount; // all available rows
            }
            else
            {
              // If we're on the last channel in the guide then allow one step to get back to top of guide.
              if (_channelOffset + (_cursorX + 1) == _channelList.Count)
              {
                Steps = 1;
              }
              else
              {
                // only number of additional avail channels
                Steps = Math.Min(_channelList.Count - _channelOffset - _cursorX - 1, _channelCount);
              }
            }
          }
    
          UnFocus();
          for (int i = 0; i < Steps; ++i)
          {
            OnDown(true);
          }
          Correct();
          Update(false);
          SetFocus();
        }

    So it looks as though your change simply brings 'OnPageUp' into line with OnPageDown. Actually, I can't understand why pageup works as well as it does for me. Very odd.

    Within OnUp() there are various checks for cursory == 0, which I assume is focus on channel name.

    Either way, I will test this change locally this evening, and if it works okay, then I would suggest committing it.

    Edit: Don't forget RADIO EPG as well!

    Mark
     

    glenn 1990

    Portal Pro
    July 1, 2010
    247
    36
    Home Country
    Belgium Belgium
    How big is your loopdelay setting in mp,
    this is may be the reason why it's working for you. (can you try a loopdelay from 0)
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Bump.

    I don't think this is in mantis yet, and I don't want it forgotten. Looking at the code provided, I suspect it will be straightforward, to fix, but needs to be done in TV and radio EPG.

    Mark
     

    Users who are viewing this thread

    Top Bottom