NextPVR Forums

Full Version: RecStatus.exe - returns current recording status
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Per a request in the Wishlist forum, I've written a command-line utility called RecStatus.exe.

You run it from the command line (or from within a batch file) with the following options:
 time=xx  where xx is the number of MINUTES to look ahead for a pending program to be recorded;
 silent=yes [no]  this sets whether the utility suppresses all text output about the results.
                 EXAMPLE: RecStatus.exe time=10 silent=no

The utility returns the following exit codes, which can be processed by the batch file that calls it:
2 - there is a program currently recording;
1 - program is scheduled to start within the specified number of minutes (takes into account scheduled prepadding);
   0 - all clear - neither of the above is true;

Unless you run it in silent mode, RecStatus will report what program is currently being recorded, otherwise it will report the details of any pending recording that is scheduled to begin within the specified time frame.

Download it here: RecStatus.exe



[b Wrote:Quote[/b] (jimh @ Mar. 07 2005,18:58)]The utility returns the following exit codes, which can be processed by the batch file that calls it:
   2 - program is scheduled to start within the specified number of minutes (takes into account scheduled prepadding);
   1 - there is a program currently recording;
   0 - all clear - neither of the above is true;
Did you go and reverse exit codes 1 & 2 again or are you just trying to confuse me?  [Image: smile.gif]

Cheers,
Brian
[b Wrote:Quote[/b] (bgowland @ Mar. 07 2005,22:31)]
[b Wrote:Quote[/b] (jimh @ Mar. 07 2005,18:58)]The utility returns the following exit codes, which can be processed by the batch file that calls it:
   2 - program is scheduled to start within the specified number of minutes (takes into account scheduled prepadding);
   1 - there is a program currently recording;
   0 - all clear - neither of the above is true;
Did you go and reverse exit codes 1 & 2 again or are you just trying to confuse me?  [Image: smile.gif]

Cheers,
Brian
Brian: Neither - I looked back at my original notes (before your suggested swap of the exit codes) when I wrote that post.  I've edited my original post to show the correct exit codes.

So, to make it crystal clear:
The utility returns the following exit codes, which can be processed by the batch file that calls it:
  2 - there is a program currently recording;
  1 - program is scheduled to start within the specified number of minutes (takes into account scheduled prepadding);
  0 - all clear - neither of the above is true;



An updated version of my RecStatus.exe command-line utility (version 0.95beta) is now available.

Link: RecStatus.exe

These are the enhancements:
1. Added a new commandline parameter "GBPVR=". For those users who do not have GBPVR installed in the customary c:\program files\devnz\gbpvr directory, use this to specify where GBPVR is installed;
This feature also enables you to check for pending programs by running the util on a PC that is networked to your GBPVR box - simply specify the network path to the GBPVR directory.

2. RecStatus now lists all pending programs found within the specified time frame.
This is a handy way to quickly see, for example, all recordings scheduled for the next 24 hours (specify time=1440).

I welcome any posts regarding bugs/comments/suggestions.



Jimh, if you use the WIN32 perl module, you should be able to read the Registry to grab the location that GBPVR is installed in, eliminating the need for the extra command line option.

Here is some example C# code that extracts this information:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
RegistryKey regKey = Registry.LocalMachine;
regKey = regKey.OpenSubKey("SOFTWARE");
regKey = regKey.OpenSubKey("devnz");
this.gbpvrPath = (string)regKey.GetValue("GBPVR InstallDir");
[/QUOTE]

Using the WIN32 module you should be able to extract the same information.
[b Wrote:Quote[/b] (KingArgyle @ Mar. 13 2005,11:50)]Jimh, if you use the WIN32 perl module, you should be able to read the Registry to grab the location that GBPVR is installed in, eliminating the need for the extra command line option.

Here is some example C# code that extracts this information:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
RegistryKey regKey = Registry.LocalMachine;
regKey = regKey.OpenSubKey("SOFTWARE");
regKey = regKey.OpenSubKey("devnz");
this.gbpvrPath = (string)regKey.GetValue("GBPVR InstallDir");

Using the WIN32 module you should be able to extract the same information.[/QUOTE]
KingArgyle:

Thanks for the tip. I'll update the utility so that it pulls the GBPVR dir from the registry unless overridden by a command-line parameter.

- Jim
Am I mistaken, or do you only get the current recording listed? I have two recording sources and none of the other scheduled recordings come up when I'm currently recording something.
[b Wrote:Quote[/b] (gblinckmann @ Mar. 17 2005,21:33)]Am I mistaken, or do you only get the current recording listed? I have two recording sources and none of the other scheduled recordings come up when I'm currently recording something.
Yes - that is correct.

I wrote this utility because people needed a way to know whether GBPVR was currently recording or was about to start recording so that their batch file would know if it was safe to proceed with a certain operation.

As a result, if the utility finds that GBPVR is currently recording, there is (or was) no reason to look to pending recordings.

If there is a need for this, I can certainly add that feature to the next release.

- Jim
Works great. Thanks! I don't really have a need for it, but I have some ideas....
[b Wrote:Quote[/b] (jimh @ Mar. 18 2005,06:40)]As a result, if the utility finds that GBPVR is currently recording, there is (or was) no reason to look to pending recordings.

If there is a need for this, I can certainly add that feature to the next release.

I've actually found a completely different use for this utility, in addition to the one that you intended. I've made a batch file that I'm calling in the postEPGupdate routine. This writes a temporary file with the output of RecStatus for the next 24 hours and then I use blat to email it to myself and my wife. This allows us to double-check that we are not missing any recordings for the day.

It may not be what you intended, but the wife sure appreciates it!  [Image: biggrin.gif]
Pages: 1 2