Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Calling NextPVR restart after config.xml changes

  1. #1
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535

    Calling NextPVR restart after config.xml changes

    If steeb in a mad moment decided to try some coding that introduced changes to the config.xml what would be the best approach to apply any changes made?

    Currently I tend to use the stop/start service controls if I've been tweaking. Can this be done silently? Is there a better way?

    cheers

    steeb

  2. #2
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    Tricky one.

    Depending on what you're tweaking, the setting may or may not be loaded dynamically (by NextPVR.exe for example) or you may need a restart of the NRecord service....

    ...at that point you may be treading on thin ice depending on whether a recording is in progress or not.

    There are ways of controlling services programatically if you need to - what are you coding in?

    Cheers,
    Brian

  3. #3
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535
    Quote Originally Posted by bgowland View Post
    Tricky one.

    Depending on what you're tweaking, the setting may or may not be loaded dynamically (by NextPVR.exe for example) or you may need a restart of the NRecord service....

    ...at that point you may be treading on thin ice depending on whether a recording is in progress or not.

    There are ways of controlling services programatically if you need to - what are you coding in?

    Cheers,
    Brian
    Hi Brian, indeed a tricky one Hence why I ask the higher gods such as you. Bear in mind my coding experience is zilch so I have started with Autoit, which appears to have some basics along the lines of VB.

    I've worked up some stuff which seems to be going the way I want but now I need to check the endgame and make sure that it 'plays' through, as it were. Ultimately what I hope to be working towards is to make changes to the config.xml and then apply them dynamically. Of course if I could factor in a check to see if NextPVR was recording before applying changes......?

    steeb

  4. #4
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    Hi steeb,

    I think I may have used AutoIt in one of its earlier incarnations (or something similar) but I'm not that familiar with scripting tools these days.

    I'd start with trying to emulate the stop/start behaviour but accept you'll need to know if a recording is in progress (it's a beginning at least for test purposes).

    Most scripting languages should allow using a 'shell' or executing a command-line statement.

    Using

    Code:
    net stop "NPVR Recording Service"
    and an associated 'net start' command from the command prompt is what you need. I've had a quick look at AutoIt and it should be able to do this easily.

    As for monitoring recording status, I'm not sure if it's available externally to NextPVR and is probably only available to plugins within the NextPVR framework. I may be wrong though but that's generally how things were with gbpvr.

    You could make an assumption by querying npvr.db3 but that gets more complex and I'm not sure if that's within the scope of AutoIt.

    Cheers,
    Brian

  5. #5
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535
    Quote Originally Posted by bgowland View Post
    Hi steeb,

    I think I may have used AutoIt in one of its earlier incarnations (or something similar) but I'm not that familiar with scripting tools these days.

    I'd start with trying to emulate the stop/start behaviour but accept you'll need to know if a recording is in progress (it's a start).

    Most scripting languages should allow using a 'shell' or executing a command-line statement.

    Using

    Code:
    net stop "NPVR Recording Service"
    and an associated 'net start' command from the command prompt is what you need. I've had a quick look at AutoIt and it should be able to do this easily.

    As for monitoring recording status, I'm not sure if it's available externally to NextPVR and is probably only available to plugins within the NextPVR framework. I may be wrong though but that's generally how things were with gbpvr.

    You could make an assumption by querying npvr.db3 but that gets more complex and I'm not sure if that's within the scope of AutoIt.

    Cheers,
    Brian
    Hi Brian, thank you for all input so far. Yes no problem with the shell command. So out of interest how are the plugins calling the NextPVR framework? Is that a .dll call or something else far more magical going on?

    steeb

  6. #6
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535
    Oh and should have added an sql db query is I think perfectly do-able with Autoit but in an ideal world what would be the best way of checking whether a record was in progress?

    cheers

    steeb

  7. #7
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,752
    Don't forget Win7/Vista and UAC protect you from scripts that try and stop services, so you have the issue that you need to run them as administrator.

    Martin

  8. #8
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    Quote Originally Posted by steeb View Post
    So out of interest how are the plugins calling the NextPVR framework? Is that a .dll call or something else far more magical going on?
    When writing a plugin, in .NET terms, you'd include references to the npvr class libraries (dlls) such as NUtility and NShared. They give direct access to APIs which can be used for interacting with npvr. I'm not sure how much (if any) would be usable outside of a plugin but in any case it probably means developing with something that could access them.

  9. #9
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535
    Quote Originally Posted by mvallevand View Post
    Don't forget Win7/Vista and UAC protect you from scripts that try and stop services, so you have the issue that you need to run them as administrator.

    Martin
    Thanks Martin, a timely reminder of the joys of UAC! Yet something else for the mix

  10. #10
    Join Date
    Nov 2006
    Location
    Sunninghill, UK
    Posts
    2,535
    Quote Originally Posted by bgowland View Post
    When writing a plugin, in .NET terms, you'd include references to the npvr class libraries (dlls) such as NUtility and NShared. They give direct access to APIs which can be used for interacting with npvr. I'm not sure how much (if any) would be usable outside of a plugin but in any case it probably means developing with something that could access them.
    Brian so for the uneducated....., me! To call the API's I need to be coding within an environment recognised by NextPVR? This is not something that could be done from 'without'? Even a potential messy option that somehow bridges between my main program that then can call a NextPVR 'native' function that checks the recording service and report back? Apologies for my total lack of knowledge!

Posting Permissions

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