Jump to channel 1 EPG (2 Viewers)

PickPocket

Portal Pro
January 3, 2007
112
2
Home Country
Germany Germany
Hi
1. If I press 1 at the EPG channel List, the Cursor jumps to channel 1 in the list. In MP2 nothing happens.

2 when I scroll the EPG channel List Till the End, it will in MP1 jump to the top
(channel 1). In MP2 you must click all Channels upwards. Is there a way to change it to the same as in MP1.
Thanks
Marc
 

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Hi
    1. If I press 1 at the EPG channel List, the Cursor jumps to channel 1 in the list. In MP2 nothing happens.

    2 when I scroll the EPG channel List Till the End, it will in MP1 jump to the top
    (channel 1). In MP2 you must click all Channels upwards. Is there a way to change it to the same as in MP1.
    Thanks
    Marc
    The Input controls of MP2 are shown here. MP2 is developed not based on MP1, so many things work differently. Many controls are more oriented to WMC, Kodi or Plex to follow the mainstream and allow intuitive navigation.
    The loop scrolling in EPG is not possible, because then the buttons on top of the EPG would be not reachable anymore.

    • With "PageUp/ChannelUp" and "PageDown/ChannelDown" you can jump through the EPG vertically
    • With "Pos1" you reach the first channel directly
    • With "End" you reach the last channel directly

    Jumping to the EPG channel position by pressing the number buttons might be something we could take a look at.
    @morpheus_xx what do you think?
     
    Last edited:

    PickPocket

    Portal Pro
    January 3, 2007
    112
    2
    Home Country
    Germany Germany
    @ge2301
    Thanks a lot.
    loop scrolling is so intuitive. MP is the Mainstream
    There is no hardkey on my Harmony one for page up / page down.
    But jumping with number channel will be fine.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    loop scrolling is so intuitive. MP is the Mainstream
    From the user numbers unfortunately not. For me MP1 was always out of scope.

    There is no hardkey on my Harmony one for page up / page down.
    There is an imput manager in MP2. You can map other keys to page up / down. Also double mapping is possible, means you can map e.g. page up and channel up to the same key.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @Brownard
    I could implement loop scrolling in the main EPG by modifying this code to below.
    I want just to add another condition "loop scrolling in skin settings activated". Can you give a hint how to add it in C? :)

    C:
        private bool ScrollVertical(int scrollDirection)
        {
          if(!SaveFocusPosition(out _))
            return false;
          int row = (int)_lastFocusedRow;
          if (scrollDirection < 0)
          {
            if (row == _numberOfRows - 1)
            {
              if (IsViewPortAtBottom)
              {
                OnHome();
                FocusFirstProgramInRow(_channelViewOffset);
              }
              else
                UpdateViewportVertical(scrollDirection);
            }
            else
              row++;
          }
          else
          {
            if (row == 0)
            {
              if (IsViewPortAtTop)
              {
                OnEnd();
                FocusLastProgramInRow(_channelViewOffset);
              }
              else
                UpdateViewportVertical(scrollDirection);
            }
            else
              row--;
          }
          _lastFocusedRow = row;
          RestoreFocusPosition(false);
          return true;
        }
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    Can you give a hint how to add it in C? :)
    The general approach is to create a bindable property, which you can bind whatever skin setting value to from the skin file, then check that property's value when deciding if to loop.
    e.g.
    C#:
    // Add a field for the bindable property
    protected AbstractProperty _loopScrollProperty;
    
    // In the control's existing constructor create the property, specifying the type and initial value
    // Controls should use SProperty (models use WProperty)
    public EpgGrid()
    {
        ...
        _loopScrollProperty = new SProperty(typeof(bool), false);
        ...
    }
    
    // Controls get copied by the skin engine when applying styles/templates so make
    // sure the property's value gets copied across too, so in the existing DeepCopy method
    // copy the value from the control being copied.
    public override void DeepCopy(IDeepCopyable source, ICopyManager copyManager)
    {
        ...
        EpgGrid c = (EpgGrid)source;
        ...
        LoopScroll = c.LoopScroll;
        ...
        Attach();
    }
    
    // Create public accessors for the property
    
    // This is what gets bound to behind the scenes
    public LoopScrollProperty
    {
        get{ return _loopScrollProperty; }
    }
    
    // This gets and sets the underlying value of the property,
    // It needs to be named the same as the above property, minus the 'Property' suffix.
    public bool LoopScroll
    {
        get{ return (bool)_loopScrollProperty.GetValue(); }
        set{ _loopScrollProperty.SetValue(value); }
    }
    
    // Then in your logic you can check the property's value to decide whether to loop, e.g.
    If (IsViewPortAtBottom)
    {
        if (LoopScroll)
        {
            // Do your loop scroll changes
        }
        else
        {
            // Keep existing behaviour of not looping
            return;
        }
    }
    
    // Now you can bind to the property from skins
    <EpgGrid LoopScroll="{Binding ...}">
     
    Last edited:

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Thanks a lot, this was quite helpful to understand the structure (y) A few more steps more as expected were needed, but to make it bindable in xaml is clever, because binding to the nereus skin settings within C would be problematic, because also other skin refer to it!

    I need to change two positions to make it build and run, but the result is as expected :D
    • public LoopScrollProperty -> public AbstractProperty LoopScrollProperty
    • return; -> return false;
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    2,290
    1,872
    Home Country
    United Kingdom United Kingdom
    A few more steps more as expected were needed, but to make it bindable in xaml is clever, because binding to the nereus skin settings within C would be problematic, because also other skin refer to it!
    Yes, the golden rule is to always keep stuff as simple/dumb as possible. All the control needs to know is whether to scroll in a loop or not, it should not/does not need to care how that was determined.

    I need to change two positions to make it build and run, but the result is as expected :D
    That's what happens when I write code off the top of my head without VS prompting me.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    That's what happens when I write code off the top of my head without VS prompting me.
    I wish I could reach there someday! Even VS is promping me I'm lost, if the code is not simple enough. But your explanation helped a lot.
     

    Users who are viewing this thread

    Top Bottom