NextPVR Forums

Full Version: Keep GB-PVR under control
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
This is a new app called StartGBPVR. Its primary aim is to ensure that GB-PVR remains the top window and so remains responsive. But that's not all it does.

Why did I write StartGBPVR?
I wrote it because my media PC sits in the living room under the TV and it's driven by a remote control, not a keyboard or mouse (except in extremis). In other words, it's treated an an appliance, not a PC. Also, I am not the only user, so others rightly get frustrated if it appears that GB-PVR is not responding, when in fact it's just lost the focus.

What StartGBPVR does in detail
1. It keeps the GB-PVR program in focus. It does this non-aggressively - ie it checks only every 20 seconds, so if you're quickly doing something else on the PC, it won't annoy you. What this means is that Windows errors and random dialogue boxes which open on a second monitor or unseen under the app can no longer make GB-PVR appear frozen.
2. That said, I found that if I was using the Config program or GB-PVR is minimised, then I didn't want GB-PVR stealing focus. So if Config is running or GB-PVR is active but minimised, StartGBPVR waits until Config quits, then either starts or reactivates GB-PVR.
3. If GB-PVR stops for any reason, StartGBPVR restarts it (with a splash screen) - but again, it waits 20 seconds beforehand to give you time to stop the StartGBPVR application if required.
4. When GB-PVR starts, on my machine when it maximises there's a two-pixel border. Annoying, and I couldn't fix it any way other than to use this program to automatically issue a Restore then a Maximise command to get rid of the border when GB-PVR starts. It only does this once per GB-PVR start.

Instructions for use
1. Simply start StartGBPVR in the usual way and leave it running. There's no CPU overhead except briefly when it takes action.
2. If you want to pause StartGBPVR, simply click on the icon in the system tray.
3. If you want to stop StartGBPVR permanently, right-click the tray icon and select Exit.
4. If you start StartGBPVR and GB-PVR is already running, StartGBPVR will silently get on with its monitoring function.
5. If you start a second copy of StartGBPVR when it's already running, it detects that and quits.

StartGBPVR was written and compiled using AutoIt.

Please feel free to make comments and suggest improvements - I'm sure there are plenty that could be made...

The executable is downloadable here.
Source code is downloadable here.
That is cool - and the fact you used AU for it is cooler (i'm also a big fan). I have several AU scripts on my GB-PVR machine, exactly for the reasons you mentioned (being appliance, the rest of the audience, etc. I have a wireless KB tacked away for more technical jobs).
Scripts like "restart_wifi_card" and "gb_pvr_on_off".

The later, will start GB-PVR if it's not running, or kill it if it is. It's a GB-PVR "toggle".
Theoretically, can also be used for cases where GB-PVR will loose focus (although I can't recall this happened to me), but also use it if GB-PVR crashes or becomes otherwise unstable.

Nice work.
Thanks for the comment - it's my first public app! The biggest problems I've found is Windows update notices and my firewall (ZoneAlarm), both of which will pop up a box from time to time that grabs the focus - which is why I wrote StartGBPVR.

And yes, I've a GBPVR toggle too, very useful...
Hi,

I would be interested in seeing your script for a 'GBPVR' toggle. My version occasionally locks up on starting playing back a video so this would be great (I guess it can be bound to an remote key??).

A further thought, would it be possible to have such a script check GBPVR to see if it is hung and if so crash the process and restart it?

Cheers

Garyeuph
garyeuph Wrote:Hi,

I would be interested in seeing your script for a 'GBPVR' toggle. My version occasionally locks up on starting playing back a video so this would be great (I guess it can be bound to an remote key??).

A further thought, would it be possible to have such a script check GBPVR to see if it is hung and if so crash the process and restart it?

Cheers

Garyeuph
Well, mine is very simple (too simple?).
Code:
$GB_title = "GB-PVR"

$exists = WinExists ($GB_title)
if $exists == 1 Then
    ;MsgBox(0, "", "Exists")
    WinClose($GB_title)
    Sleep(1)
    run("pskill gbpvr.exe", "")
Else
    ;MsgBox(0, "", "Does not Exist")
    run("c:\Program Files\devnz\gbpvr\gbpvr.exe", "c:\Program Files\devnz\gbpvr\")
    WinActivate("GB-PVR")
EndIf
It has one problem - when GB-PVR is running, sometimes I need two clicks (run the script twice) to make it close GB-PVR. Maybe first time it "kills" the tray icon? not sure. I'm happy to hear ideas.

the "MsgBox" are there obviosuly for debug purposes.

Ah, also I used a "pskill.exe" commnamd from SysInternals (now seems to be part of M$). I felt this would be more efficient (brut force?), in the rare case GB-PVR is really stuck and the "WinClose" didn't work.
Mine looks pretty much like yours, although I use ProcessClose ( "gbpvr.exe" ) instead of pskill. Seems to only need one click Smile.

Doesn't really need anything more complex imho...
I updated the HIPGuide a few days ago to include info and my config files on how to use HIP and not lose focus on your PC apps. The remote codes still get processed by GB-PVR.
Does not work for me. My default location is on the D drive.
dgroover Wrote:Does not work for me. My default location is on the D drive.

What doesn't work?
dgroover Wrote:Does not work for me. My default location is on the D drive.

I looked at the code posted by liteswap, made a few minor adjustments and then recompiled it but I am waiting to hear back from liteswap to see if it is okay that I post it. One of the changes that I made involves reading the install directory from the registry so that it should find the proper location of where GBPVR is installed so it should work for non standard installations.

I should also mention that I used resource hacker to pull the GBPVR icon file which I hope is okay with Sub?

I will wait to hear if everyone is okay with this before posting Cool
Pages: 1 2 3