Originally Posted by vjforum
Excellent Program. Even a noob like me with zero knowledge of commands can make this work. Wanted to know how to get current picture mode information from the projector and store it and use it later.
My Scenario: Want to switch to Natural mode every single time when playback stops. I can write a macro in EventGhost to combine "Media_Stop" and JvcControl 6A, but projector (RS500) always sets the picture mode to Natural even-though it's already in this picture mode. It takes a few seconds to adjust picture mode, and screen goes blank every time the macro is run. If I can query current picture mode and find a way to prevent change in picture mode if its already on, it will be better.
Looks like JVCControl has a command "StorePictureMode":
JvcControl StorePictureMode c:\htpc\current.txt
Then you can open current.txt and see whats in it. I don't know much about EventGhost, but it looks like it's backed by python scripting so you should be able to use python's built in file read routines. I think the logic for me would be:
Run JvcControl StorePictureMode c:\htpc\current.txt
Get file contents of current.txt in python.
If not in natural mode, issue JVCControl 6A to switch
FYI, you can use the RAWREAD command to have jvccontrol grab the state from the projector for *any* command and dump it into a file called JvcReturnValue.txt. Here is an example in autoit. This was for game of thrones episode 8x03 which was super dark. It saves off the original gamma then restores it after the file exits.
The code example grabs the gamma value using RawRead:PMGC.
Then I load the right 2 nibbles of the string returned from the projector in the file JvcReturnValue.txt.
Then I create a file called "restoredata.txt" which contains the full JVCControl command to run when the file exits.
If StringInStr($cmdline, "S08E03") Then
RunWait("c:\htpc\JvcControl.exe RawRead:PMGC"); PMGC Reads gamma correction and saves to JvcReturnValue.txt
Local $GammaCorrection = StringRight(FileRead('C:\htpc\JvcReturnValue.txt'), 2);
FileWrite(@ScriptDir & "\restoredata.txt", 'c:\htpc\JvcControl.exe Raw:PMGC' & $GammaCorrection);
RunWait('c:\htpc\JvcControl.exe Raw:PMGC06'); PMGC is gamma correction, 06 is 1.9.
Here is the code that restores it afterwards using the result:
Local $hFile = FileOpen(@ScriptDir & "\restoredata.txt", $FO_READ);
If $hFile <> -1 Then
Local $RunRestoreCommand = FileRead($hFile);
FileDelete(@ScriptDir & "\restoredata.txt");
RunWait($RunRestoreCommand); PMBR is for brightness, then 0000 is 0, 0001 1 etc
So you can test the RAWREAD command and look in the JvcReturnValue.txt and see what types of values are returned.