[solved] Latest Media Handler Additional facade controls (1 Viewer)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    15,959
    13,420
    Kyiv
    Home Country
    Ukraine Ukraine
    At startup, the plugin can not find the facade
    Very strange ...
    I create test function for facade determine,
    C#:
    facade = gw.GetControl(ControlID) as GUIFacadeControl;
    if facade == null, then function print all children control and i get:
    On startup:
    Code:
    22-Jan-2018 22:46:25 Debug [LatestMyVideosHandle]: *** InitFacade: LatestMyVideos: 1 
    22-Jan-2018 22:46:26 Debug [               Utils]: GetLatestsFacade: Unable to find facade control [id:919198710].
    In Children List no control with ID = 919198710 :(

    But if i switch to Home window and back, i give:
    Code:
    22-Jan-2018 23:02:53 Debug [               Utils]: GetLatestsFacade II: Control [id:919198710] - MediaPortal.GUI.Library.GUIFacadeControl - MediaPortal.GUI.Library.GUIFacadeControl 
    ...
    22-Jan-2018 23:02:53 Debug [               Utils]: GetLatestsFacade: Found facade control [id:919198710]. 
    ...
    22-Jan-2018 23:02:53 Debug [               Utils]: *** UpdateFacade: 919198710 - Filmstrip
    And all work fine ...
    upload_2018-1-22_22-32-8.png

    @Developers @Sebastiii need help, why on startup not all control in Children list?
    May be MP1-4887 made some changes, and it is necessary to define something like that on another. Previously it worked perfectly. But in what version I do not remember.

    C#:
        /// <summary>
        /// Check if Window fully loaded
        /// </summary>
        /// <param name="self"></param>
        public static bool WindowIsLoaded(this GUIWindow self)
        {
          int _focused = self.GetFocusControlId();
          // logger.Debug("*** WindowIsLoaded: W: {0}  - {1}:{2}", self.GetID, self.WindowLoaded, _focused > 0);
          return self.WindowLoaded && _focused >= 0;
        }
    
        internal static GUIFacadeControl GetLatestsFacade(int ControlID)
        {
          if (GUIWindowManager.ActiveWindow <= (int)GUIWindow.Window.WINDOW_INVALID)
          {
            return null;
          }
    
          GUIWindow gw = null;
          lock (lockObject)
          {
            try
            {
              do
              {
                gw = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow);
                if (gw == null)
                {
                  return null;
                }
    
                ThreadToSleep();
              }
              while (!gw.WindowIsLoaded());
            }
            catch (Exception ex)
            {
              logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow);
              logger.Error("GetLatestsFacade: " + ex);
            }
    
            int i = 0;
            GUIFacadeControl facade = null;
            try
            {
              bool bReady;
              do
              {
                facade = gw.GetControl(ControlID) as GUIFacadeControl;
                if (facade == null)
                {
                  i++;
                  bReady = false;
                  Thread.Sleep(100);
                }
                else
                {
                  bReady = true;
                }
              }
              while (i < 5 && !bReady);
            }
            catch (Exception ex)
            {
              logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow + " - " + ControlID);
              logger.Error("GetLatestsFacade: " + ex);
            }
    
            if (facade == null)
            {
              logger.Debug("GetLatestsFacade: Unable to find facade control [id:{0}].", ControlID);
              facade = gw.Children.GetControlById(ControlID) as GUIFacadeControl;
              if (facade == null)
              {
                foreach (GUIControl c in gw.Children)
                {
                  if (c.GetID > 0)
                  {
                    logger.Debug("GetLatestsFacade II: Control [id:{0}] - {1} - {2}", c.GetID, c, c.GetType());
                  }
                  if (c.GetID == ControlID)
                  {
                    facade = c as GUIFacadeControl;
                    if (facade == null)
                    {
                      logger.Debug("GetLatestsFacade III: Unable to find facade control [id:{0}].", ControlID);
                    }
                    else
                    {
                      logger.Debug("GetLatestsFacade III: Found facade control [id:{0}].", ControlID);
                    }
                  }
                }
              }
              else
              {
                logger.Debug("GetLatestsFacade II: Found facade control [id:{0}].", ControlID);
              }
            }
            else
            {
              logger.Debug("GetLatestsFacade: Found facade control [id:{0}].", ControlID);
            }
            return facade;
          }
        }
     

    wizard123

    Retired Team Member
  • Premium Supporter
  • January 24, 2012
    2,523
    2,715
    Home Country
    United Kingdom United Kingdom
    • Thread starter
    • Moderator
    • #53
    Very strange, i hope the guys can help you because this has huge potential for skin designs.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,523
    10,466
    France
    Home Country
    France France

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,959
    13,420
    Kyiv
    Home Country
    Ukraine Ukraine
    There are 2 commits for it. Yep maybe this is MP1-4887 that breaking it, so to be sure, this need to be tested against the change.
    All LMH controls in Titanius skin in include xml ...
    XML:
    <include condition="#(plugin.isenabled('Latest Media Handler'))">BasicHome.LatestMyVideosFacade.xml</include>
    Maybe delay load? Or? Background in thread?
    I dont Debug MP with LMH on my test computer :( ...
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,959
    13,420
    Kyiv
    Home Country
    Ukraine Ukraine
    Implemented in LatestMediaHandler 2.4.0.66 :):whistle::coffee:
     

    Users who are viewing this thread

    Similar threads

    That screen is generated by the file "MyVideo.xml", but it uses various other files too. When the list on the right is a list of episodes, the area in the middle contains the programme information for the episode that has the focus. In your screen shot, the list on the right is a list of folders. You could fill the area in the...
    That screen is generated by the file "MyVideo.xml", but it uses various other files too. When the list on the right is a list of...
    Can someone please assist me in the file name and location of which XML controls this screen. I want to create an additional box...
    Replies
    1
    Views
    1K
    Greetings to all Denizens of the land of MediaPortal... It seems our Zap2XML/GraceNote access is broken again. I (as many others) have been using the latest NewZap2xml_6 and it has worked flawlessly. A few days ago it all died. I wonder if anyone is working a solution to save the masses. I am hoping the good citizen of past is...
    Greetings to all Denizens of the land of MediaPortal... It seems our Zap2XML/GraceNote access is broken again. I (as many others)...
    Greetings to all Denizens of the land of MediaPortal... It seems our Zap2XML/GraceNote access is broken again. I (as many others)...
    Replies
    0
    Views
    747
    If you’re planning to submit a pull request, let’s go through the list of issues and their solutions. I or someone from the team will create a Jira ticket, and for each ticket, you’ll make the changes and submit a pull request. This will be transparent and straightforward.
    If you’re planning to submit a pull request, let’s go through the list of issues and their solutions. I or someone from the team...
    I'm very glad to see that mediaportal 1 is on github, where ordinary devs with github accounts can make contributions. Please can...
    Replies
    7
    Views
    1K
    Hi, I'll move this into an own thread under "feature requests". I like the idea, but I think we can currently not implement this with further changes. I've checked the models and there are no variables, that could be easily called.
    Hi, I'll move this into an own thread under "feature requests". I like the idea, but I think we can currently not implement this...
    MP2 is great, but I‘d rely one change. I can have optional help texts, which are nice for a first time use, but then do not have...
    Replies
    1
    Views
    3K
    maybe setting loglevel to debug might pinpoint the difference between normal and stuck? Preferable with as much disabled as possible also try to see if anything is happening during stuck for the mediaportal process(resource monitor, disk activity, cpu usage, anything) maybe other programs competing for resouces?
    maybe setting loglevel to debug might pinpoint the difference between normal and stuck? Preferable with as much disabled as...
    Since over a year my MP sometimes stucks while showing the welcome screen. It started once a week now it happens every second time...
    Replies
    4
    Views
    1K
    Top Bottom