NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
1 2 3 4 5 … 93 Next »
Plugins and NPVR. Where do we start?

 
  • 0 Vote(s) - 0 Average
Plugins and NPVR. Where do we start?
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#21
2010-07-09, 10:36 PM
Thanks, sub - that was enough info to get going with it, and it seems a much cleaner way of doing it too.

Iain
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#22
2010-07-10, 05:21 PM
Please bare with me while I ask for yet more help...

There's a couple of simple things I'd like to do, but I can't suss out how (assuming they're even possible).

1) Display the current version number of nPVR.
2) Display whether recordings are in progress, or if not, when the next one will be.

For 2), I had in mind a single line entry that stated something like "[n] recordings are in progress" or "Next recording starts in [n] hours". I thought it would be helpful to have a quick reminder before you shut down or rebooted, etc.

As you can see, I'm also working on trying to display information from multiple drives, along with an icon for their type. I've still to test whether the EPG update works (wife won't let me near the main HTPC!), but I get a message back from implementing SetEPGUpdateStatus() after calling EPGManager.UpdateEPG(this) so hopefully I'm fumbling about in the right area?
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,775
Threads: 769
Joined: Nov 2003
#23
2010-07-10, 06:47 PM
The "1)" above is realtively straight forward. Assuming you've got a UiStatic for the image, add a parameter like:

args["@version"] = settings.GetSetting("/Settings/Version/CurrentVersion", "unknown");

For "2)" you'd probably need to call ScheduleHelperFactory.GetScheduleHelper().GetServerStatus(), then try parsing the xml it returns.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#24
2010-07-11, 04:05 PM
sub Wrote:The "1)" above is realtively straight forward.
It was indeed. Thanks.

sub Wrote:For "2)" you'd probably need to call ScheduleHelperFactory.GetScheduleHelper().GetServerStatus(), then try parsing the xml it returns.
Hmm, yep, that looks doable. I assume the times are always GMT regardless of the user's location?

Iain
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,775
Threads: 769
Joined: Nov 2003
#25
2010-07-11, 04:43 PM
imilne Wrote:Hmm, yep, that looks doable. I assume the times are always GMT regardless of the user's location?
Yes. They're in .net's "Round-trip date/time pattern", and can be reassembled into a date with:

DateTime someDate = DateTime.SpecifyKind(DateTime.Parse(datetimetext), DateTimeKind.Utc);
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#26
2010-07-12, 05:17 PM
Here's today's question Big Grin

What is the correct way to do screen updates?

My first attempt just set a new args value to whatever UiStatic objects I was using, but I'm seeing occasional blanking of parts of the display - sometimes the whole static, sometimes just some of its elements (both text and images). The buttons are fine.

My second attempt (also a failure) involved messing around with overriding NeedsRendering() but I guess I'm still doing something wrong as I get the same blank bits.

Ultimately, I have a Timer running that is generating events every X seconds. I need to refresh all my data, and repaint the screen on each event.

Thanks

Iain
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,775
Threads: 769
Joined: Nov 2003
#27
2010-07-12, 05:27 PM
If you want the application to update the screen, then return 'true' from NeedsRendering().

The application takes care of this all automatically for the base classes based on information in the lists etc. If you've got additional elements you're displaying on the screen then you may need to override NeedsRendering to do something like:

Code:
....somewhere you're updating your your static
    myExtraUiStatic.Args = args;
    

    ....override NeedsRendering()
    public override bool NeedsRendering()
    {
          if (myExtraUiStatic.NeedsRendering())
                return true;
          return base.NeedsRendering();
    }
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#28
2010-07-12, 08:59 PM
Thanks, sub. I'm still getting the odd bit of screw-up after changing, but I think that's down to running it in a VM. Can't really trust anything graphics wise it does. The briefest of tests on a real machine seems to show it being ok though.

Iain
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#29
2010-07-14, 10:32 PM
A quick question about the SettingsHelper object. I can use it to read stuff from config.xml and I can use it to update the values of existing elements in the xml, but I can't seem to find a way to add new elements. Perhaps that functionality isn't there yet?

My assumption would be that calling SettingsHelper.SetSetting(path, value) would either update an existing entry or add it if it didn't exist. You'd then call Save().

Iain
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,775
Threads: 769
Joined: Nov 2003
#30
2010-07-14, 10:35 PM
It only updates existing settings. You can use the SettingsHelper.GetBackingDocument() call to get the XmlDocument object though, then use the normal Microsoft API to insert or append nodes though.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (9): « Previous 1 2 3 4 5 … 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  API channel.stream.start mvallevand 2 1,430 2023-05-07, 09:40 PM
Last Post: mvallevand
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,430 2021-03-11, 03:59 PM
Last Post: mvallevand
  Test/Development environment for npvr.db3 scJohn 10 4,487 2020-09-04, 09:14 PM
Last Post: scJohn
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,520 2018-10-23, 07:24 AM
Last Post: almightyj
  ios app to control npvr ui idea jnbooker15 4 3,676 2015-09-21, 10:19 PM
Last Post: sub
  ios app to control npvr ui idea jnbooker15 0 2,516 2015-09-21, 06:39 PM
Last Post: jnbooker15
  I want to start developing plugins...but how? OrenShapir 6 4,139 2014-11-18, 10:38 PM
Last Post: mvallevand
  Couple of questions about hacking npvr.db3 drmargarit 6 4,322 2014-09-08, 02:22 AM
Last Post: sub
  Absolute newbie trying to realize an idea - where to start? Oopsjoppe 13 5,742 2013-11-11, 05:33 PM
Last Post: Oopsjoppe
  high res (256x256+) npvr icon? reven 15 5,969 2013-09-01, 05:13 AM
Last Post: psycik

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

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

Linear Mode
Threaded Mode