NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 19 20 21 22 23 … 93 Next »
Is there a way to force a re-render?

 
  • 0 Vote(s) - 0 Average
Is there a way to force a re-render?
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#1
2010-07-31, 05:02 PM
is there something equivelent in NPVR to

PluginHelperFactory.getPluginHelper().ForceRepaint();

?

I have a function for displaying info as

private void setText(String Text)
{
if (!activated) return;
if (TextMessage == Text) return;

TextMessage = Text;
Hashtable args = new Hashtable();
args.Add("@message", TextMessage);
TextUiStatic.Args = args;
ForceUpdate = true;
}

( I think the syntax was a little different in GB-PVR)

so I can go in my plugin (in some function)

setText("Fetching info, please wait...");

// call retrieve function, whatever that may be. this might take several seconds

setText("Got it. I'm back");

In GB-PVR, it works as expected. In NPVR, the first message is never displayed.

I tried using the class variable ForceUpdate

then in NeedsRendering I go

public override bool NeedsRendering()
{
if (ForceRender == true) {
ForceRender = false;
return true;
}
...

but it still doesn't work.
thanks
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2010-07-31, 05:35 PM
If you return 'true' from NeedsRendering(), then the app will call GetRenderList() on your plugin and show the elements you return. (ie, repaint the screen)

Try this:

Code:
public override bool NeedsRendering()
{
   if (TextUiStatic.NeedsRendering())
      return true;
   .... any other processing....
}
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#3
2010-07-31, 05:49 PM
I already do that, but the first call to setText never shows up. I'm assuming NeedsRendering is not called until after

// call retrieve function, whatever that may be. this might take several seconds

I could put the retrieval function in a separate thread, but was hoping to avoid the complications involved.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2010-07-31, 06:23 PM
Ah, sorry - I didnt read all the details in your post. You're right. There is only a single thread happening, so NeedsRendering() isnt called until your function complete.

For added a IPluginHelper.ForceRender(); method for the next build.
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#5
2010-07-31, 06:35 PM
Very cool. Thanks for the (as usual) fantastically fast response!
I'm a hack programmer at best, and juggling more than a few threads (I already have a another one going) is like juggling chain-saws. You just know there will be a terrible mess at any moment...
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,766
Threads: 954
Joined: May 2006
#6
2010-07-31, 06:53 PM
Thanks sub this is something I have been waiting for too. Would it be possible to add a ForceRefresh into PluginHelperFactory.GetPluginHelper().ShowMessage(...) too?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#7
2010-07-31, 07:06 PM
mvallevand Wrote:Thanks sub this is something I have been waiting for too. Would it be possible to add a ForceRefresh into PluginHelperFactory.GetPluginHelper().ShowMessage(...) too?
I wont make the ShowMessage do it by default, but you can manually do it you need to (if you've got a long running activity happening on the main thread, and know it'll be safe for your situation). The reason for this, it'll most likely lead to reentrancy issues, since it'll cause NeedsRendering/GetRenderList etc to be called on your plugin, and chances are lots of developers would have called it from one of these methods. Google "DoEvents" for a description of similar evil.

In reality it'd be better to not use it, and instead put long processing on a background thread, and just have the main thread just show the status of the background thread. Calls like ShowMessage will show pretty much instantly if you're not blocking on slow activities.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Render order in Videos Jaggy 13 4,332 2011-10-12, 11:20 AM
Last Post: mvallevand
  How to render a graphical volume display in nPVR McBainUK 3 2,005 2010-12-13, 03:25 PM
Last Post: imilne
  TV Guide Element Render order Northpole 0 1,272 2010-10-24, 04:11 PM
Last Post: Northpole
  Force full screen update mvallevand 3 2,091 2010-01-14, 05:11 PM
Last Post: mvallevand
  Force screen saver on? psycik 2 1,454 2008-01-05, 08:08 PM
Last Post: psycik
  timing render pastro 2 1,566 2007-08-30, 06:38 AM
Last Post: pastro
  how to force redraw? Wakalaka 3 1,667 2007-03-27, 09:58 AM
Last Post: psycik
  render only called for mouse and keyboard event rshaw 24 6,301 2006-09-20, 10:45 AM
Last Post: 23skidoo
  Simple Plugin Demonstrates Render Bug 23skidoo 4 2,297 2006-09-20, 10:42 AM
Last Post: 23skidoo
  Possible to force a refresh? McBainUK 3 1,693 2006-01-22, 09:17 AM
Last Post: McBainUK

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode