NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 15 16 17 18 19 … 93 Next »
Calling NextPVR restart after config.xml changes

 
  • 0 Vote(s) - 0 Average
Calling NextPVR restart after config.xml changes
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#1
2011-04-25, 11:57 PM
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
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#2
2011-04-26, 12:09 AM
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
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#3
2011-04-26, 12:19 AM
bgowland Wrote: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 Big Grin 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
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2011-04-26, 01:07 AM
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
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#5
2011-04-26, 01:11 AM
bgowland Wrote: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
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#6
2011-04-26, 01:15 AM
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
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,810
Threads: 954
Joined: May 2006
#7
2011-04-26, 01:19 AM
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
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#8
2011-04-26, 01:26 AM
steeb Wrote: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.
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#9
2011-04-26, 01:30 AM
mvallevand Wrote: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 Big Grin
steeb
Offline

Posting Freak

Posts: 2,667
Threads: 183
Joined: Nov 2006
#10
2011-04-26, 01:36 AM
bgowland Wrote: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!
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (4): 1 2 3 4 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  FM tuner support in NextPVR? Goongyae 2 1,327 2022-11-23, 01:22 PM
Last Post: mvallevand
  NextPVR web API for scheduling - DayMask mvallevand 28 9,712 2021-05-11, 10:07 PM
Last Post: mvallevand
  NextPVR 5: When is PIN Required for API Access? pkscout 3 2,637 2020-05-26, 04:45 AM
Last Post: sub
  NextPVR "Service" Backend? jcole998 5 4,734 2018-05-24, 01:17 PM
Last Post: jcole998
  NextPVR and NRecord, between releases, updates p37307 1 2,535 2016-10-29, 01:08 AM
Last Post: sub
  How does NextPVR group recordings for XBMC? spinnaker 2 2,266 2013-11-21, 01:33 AM
Last Post: spinnaker
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,755 2013-10-08, 02:25 AM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,221 2012-02-11, 05:42 PM
Last Post: mvallevand
  Resume or Restart dialog for video psycik 6 2,974 2011-12-22, 02:52 AM
Last Post: mvallevand
  Settings config screen for class IEventNotification plugin imilne 9 3,449 2011-09-17, 06:06 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