Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 57

Thread: Plugins and NPVR. Where do we start?

  1. #21
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    Thanks, sub - that was enough info to get going with it, and it seems a much cleaner way of doing it too.

    Iain

  2. #22
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    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?

  3. #23
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,552
    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().GetServe rStatus(), then try parsing the xml it returns.

  4. #24
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    Quote Originally Posted by sub View Post
    The "1)" above is realtively straight forward.
    It was indeed. Thanks.

    Quote Originally Posted by sub View Post
    For "2)" you'd probably need to call ScheduleHelperFactory.GetScheduleHelper().GetServe rStatus(), 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

  5. #25
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,552
    Quote Originally Posted by imilne View Post
    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);

  6. #26
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    Here's today's question

    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

  7. #27
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,552
    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();
        }

  8. #28
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    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

  9. #29
    Join Date
    Feb 2008
    Location
    Scotland, UK
    Posts
    2,085
    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

  10. #30
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,552
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •