I create UIStatic for the elements that make up regions on the screen and only render changes
NPVR the helps by only changing elements that need to change.Code:albumArtScreen = new UiStatic("AlbumArt", new Hashtable(), skinHelperJukebox); playbackTime = new UiStatic("Playback", new Hashtable(), skinHelperJukebox); if (skinHelper.ElementIsDefined("TimeBar")) { timeBar = new UiStatic("TimeBar", new Hashtable(), skinHelperJukebox); } else { timeBar = null; } playlistDetails = new UiStatic("Current", new Hashtable(), skinHelperJukebox);
Martin
Last edited by mvallevand; 2011-12-29 at 07:15 PM.
Did you put a different message in each of the two so you know if the problem is with the plugin or screensaver? Since you indicated it did it with the default screen saver, I'm guessing plugin?
I only logged a message for my plugin's "screensaver" which is just a popup with a Black background and content that is refreshed every second.
Its probably something to do with NeedsRendering() returning true, but not getting a chance to render because of the screensaver being on top and gets rendered instead, so it gets in a bit of a tight loop.
There is a few ways to fix it, but given your code isnt in front of me, the easiest fix is probably what Martin suggested. at the top of your plugin's NeedsRendering() method add:
Code:if (PluginHelperFactory.GetPluginHelper().ScreenSaverIsActive()) { return false; }
If it's not the plugin, and seems to be caused by the screensaver (ie, happens regardless of what screen it's sitting on), then you'd need to take a look at your screen saver NeedsRendering() call to see what exactly is returning true continually and modify it to only true in the situations where you want the screen updated.
I put another logging message in for GetRenderList() on the plugin screen (not the popup/screensaver). I then put in the check at the top of NeedsRendering() that you and Martin suggested. Testing with the default NPVR "FixedImage" screensaver, GetRenderList() for the plugin screen is still being called multiple times even with NeedsRendering() returning false? I also am logging when it returns false so I have verified it is returning false when the screensaver is active.
I know the built in screensaver isnt very optimal. With some options it produces a hole through which you can see the plugin below, so it renders the plugin too. Wattage wasnt high on my list of considerations. You're probably better off just focusing on your own plugin.