home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Fanart Handler
Latest Media Handler Additional facade controls
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ajs" data-source="post: 1238005" data-attributes="member: 68833"><p>Very strange ...</p><p>I create test function for facade determine, </p><p>[code=csharp]facade = gw.GetControl(ControlID) as GUIFacadeControl;[/code]</p><p>if facade == null, then function print all children control and i get:</p><p>On startup:</p><p>[code]22-Jan-2018 22:46:25 Debug [LatestMyVideosHandle]: *** InitFacade: LatestMyVideos: 1 </p><p>22-Jan-2018 22:46:26 Debug [ Utils]: GetLatestsFacade: Unable to find facade control [id:919198710]. [/code]</p><p>In Children List no control with ID = 919198710 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" /></p><p></p><p>But if i switch to Home window and back, i give:</p><p>[code]22-Jan-2018 23:02:53 Debug [ Utils]: GetLatestsFacade II: Control [id:919198710] - MediaPortal.GUI.Library.GUIFacadeControl - MediaPortal.GUI.Library.GUIFacadeControl </p><p>...</p><p>22-Jan-2018 23:02:53 Debug [ Utils]: GetLatestsFacade: Found facade control [id:919198710]. </p><p>...</p><p>22-Jan-2018 23:02:53 Debug [ Utils]: *** UpdateFacade: 919198710 - Filmstrip [/code]</p><p>And all work fine ...</p><p>[ATTACH]195732[/ATTACH] </p><p></p><p>[USERGROUP=39]@Developers[/USERGROUP] [USER=60104]@Sebastiii[/USER] need help, why on startup not all control in Children list?</p><p>May be <a href="https://github.com/MediaPortal/MediaPortal-1/commit/b2d536cc935e8cb6ec103912d3452bf99ee2f98f#diff-96a30879b15b833d396deb1e09f413b8" target="_blank">MP1-4887</a> 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.</p><p></p><p>[SPOILER="All code:"][code=csharp] /// <summary></p><p> /// Check if Window fully loaded</p><p> /// </summary></p><p> /// <param name="self"></param></p><p> public static bool WindowIsLoaded(this GUIWindow self)</p><p> {</p><p> int _focused = self.GetFocusControlId();</p><p> // logger.Debug("*** WindowIsLoaded: W: {0} - {1}:{2}", self.GetID, self.WindowLoaded, _focused > 0);</p><p> return self.WindowLoaded && _focused >= 0;</p><p> }</p><p></p><p> internal static GUIFacadeControl GetLatestsFacade(int ControlID)</p><p> {</p><p> if (GUIWindowManager.ActiveWindow <= (int)GUIWindow.Window.WINDOW_INVALID)</p><p> {</p><p> return null;</p><p> }</p><p></p><p> GUIWindow gw = null;</p><p> lock (lockObject)</p><p> {</p><p> try</p><p> {</p><p> do</p><p> {</p><p> gw = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow);</p><p> if (gw == null)</p><p> {</p><p> return null;</p><p> }</p><p></p><p> ThreadToSleep();</p><p> }</p><p> while (!gw.WindowIsLoaded());</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow);</p><p> logger.Error("GetLatestsFacade: " + ex);</p><p> }</p><p></p><p> int i = 0;</p><p> GUIFacadeControl facade = null;</p><p> try</p><p> {</p><p> bool bReady;</p><p> do</p><p> {</p><p> facade = gw.GetControl(ControlID) as GUIFacadeControl;</p><p> if (facade == null)</p><p> {</p><p> i++;</p><p> bReady = false;</p><p> Thread.Sleep(100);</p><p> }</p><p> else</p><p> {</p><p> bReady = true;</p><p> }</p><p> }</p><p> while (i < 5 && !bReady);</p><p> }</p><p> catch (Exception ex)</p><p> {</p><p> logger.Debug("GetLatestsFacade: " + GUIWindowManager.ActiveWindow + " - " + ControlID);</p><p> logger.Error("GetLatestsFacade: " + ex);</p><p> }</p><p></p><p> if (facade == null)</p><p> {</p><p> logger.Debug("GetLatestsFacade: Unable to find facade control [id:{0}].", ControlID);</p><p> facade = gw.Children.GetControlById(ControlID) as GUIFacadeControl;</p><p> if (facade == null)</p><p> {</p><p> foreach (GUIControl c in gw.Children)</p><p> {</p><p> if (c.GetID > 0)</p><p> {</p><p> logger.Debug("GetLatestsFacade II: Control [id:{0}] - {1} - {2}", c.GetID, c, c.GetType());</p><p> }</p><p> if (c.GetID == ControlID)</p><p> {</p><p> facade = c as GUIFacadeControl;</p><p> if (facade == null)</p><p> {</p><p> logger.Debug("GetLatestsFacade III: Unable to find facade control [id:{0}].", ControlID);</p><p> }</p><p> else</p><p> {</p><p> logger.Debug("GetLatestsFacade III: Found facade control [id:{0}].", ControlID);</p><p> }</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> logger.Debug("GetLatestsFacade II: Found facade control [id:{0}].", ControlID);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> logger.Debug("GetLatestsFacade: Found facade control [id:{0}].", ControlID);</p><p> }</p><p> return facade;</p><p> }</p><p> }[/code]</p><p></p><p>[/SPOILER]</p></blockquote><p></p>
[QUOTE="ajs, post: 1238005, member: 68833"] Very strange ... I create test function for facade determine, [code=csharp]facade = gw.GetControl(ControlID) as GUIFacadeControl;[/code] 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]. [/code] 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 [/code] And all work fine ... [ATTACH]195732[/ATTACH] [USERGROUP=39]@Developers[/USERGROUP] [USER=60104]@Sebastiii[/USER] need help, why on startup not all control in Children list? May be [URL='https://github.com/MediaPortal/MediaPortal-1/commit/b2d536cc935e8cb6ec103912d3452bf99ee2f98f#diff-96a30879b15b833d396deb1e09f413b8']MP1-4887[/URL] 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. [SPOILER="All code:"][code=csharp] /// <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; } }[/code] [/SPOILER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Fanart Handler
Latest Media Handler Additional facade controls
Contact us
RSS
Top
Bottom