NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 31 32 33 34 35 … 93 Next »
Current time in plugins?

 
  • 0 Vote(s) - 0 Average
Current time in plugins?
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2008-05-12, 01:42 AM
As I'm showing Now/Next information info in the dvbt radio plugin, it makes sense that I should show the current time on the plugin screen.

Is there a built-in way of letting the framework handle this automatically or do I have to create a 'current time' panel in the skin and write the code to manage updating it when the time changes?

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,684
Threads: 767
Joined: Nov 2003
#2
2008-05-12, 01:59 AM
There is nothing specifically for handling display of the current time, but you can use a UiStatic option for displaying something like this...

Member variable
Code:
private UiStatic currentTimeUiStatic;

In your one-off initialisation function:
Code:
Hashtable args = new Hashtable();
args["@currentTime"] = DateTime.Now.ToShortTimeString();
currentTimeUiStatic = new UiStatic(skinHelper, "CurrentTime", args);
You'd need to define a "CurrentTime" composite image in your skin.xml.

In your needsRendering():
Code:
Hashtable args = new Hashtable();
args["@currentTime"] = DateTime.Now.ToShortTimeString();
currentTimeUiStatic.setArgs(args);

In your GetRenderList()
Code:
renderList.AddRange(currentTimeUiStatic.getRenderList());

The UiStatic is pretty intelligent and will only update/redraw if something actually changes.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2008-05-12, 02:18 AM
Thanks. I haven't used UiStatic before - it could also be useful for a few other things I need to tidy up.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,684
Threads: 767
Joined: Nov 2003
#4
2008-05-12, 02:24 AM
Its definitely a useful class, and can make things quite a bit simpler.

It can be used to draw all sorts of complex stuff that is defined in the skin composite images. pictures/text etc
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#5
2008-05-12, 03:19 AM
sub Wrote:Its definitely a useful class, and can make things quite a bit simpler.

It can be used to draw all sorts of complex stuff that is defined in the skin composite images. pictures/text etc
Yep - I'm already redesigning bits of my code in my head (gone 4am so a bit late to start hacking my working code :eekSmile.

Anyway, I now have a working clock in the plugin which keeps perfect track of time. Smile

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Plugins and NPVR. Where do we start? sub 80 68,612 2020-11-26, 10:02 PM
Last Post: mandai
  Extending end time. mvallevand 5 4,079 2018-10-17, 01:21 PM
Last Post: jcole998
  I want to start developing plugins...but how? OrenShapir 6 4,049 2014-11-18, 10:38 PM
Last Post: mvallevand
  Extending recording time mvallevand 2 2,456 2014-09-14, 01:04 AM
Last Post: sub
  Time to make Touch web Service less experimental fred250 106 28,091 2014-06-15, 09:13 PM
Last Post: fred250
  <StartTime> and <EndTime> time formats? spinnaker 3 2,472 2013-10-25, 01:48 AM
Last Post: spinnaker
  Tuner plugins and client id mvallevand 2 2,066 2013-07-03, 01:39 AM
Last Post: mvallevand
  Tuner Plugins - Output folders mvallevand 2 2,045 2013-02-19, 07:45 PM
Last Post: mvallevand
  Album art. Current conventions? bgowland 2 1,589 2012-12-21, 02:08 AM
Last Post: bgowland
  .NET 4 plugins? McBainUK 20 7,738 2012-12-11, 08:48 PM
Last Post: sub

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

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

Linear Mode
Threaded Mode