Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Read & show resolution and frequency of the screen.
Read & show resolution and frequency of the screen.
Hello,
I want to know the frequency and the resolution of my screen using EventGhost. I just want to press a key and see an message via the OSD.
Some body know how I can do this? I don't find a function in EventGhost.
Can you help me please?
Regards.
I want to know the frequency and the resolution of my screen using EventGhost. I just want to press a key and see an message via the OSD.
Some body know how I can do this? I don't find a function in EventGhost.
Can you help me please?
Regards.
Re: Read & show resolution and frequency of the screen.
Hello,
Nobody can help me?
Actually it's to choose the good parameters to see my movie via XBMC :
Regards.
Nobody can help me?
Actually it's to choose the good parameters to see my movie via XBMC :
- Bluray => 72Hz
- DVD Pal => 50Hz
- DVD NTSC => 60Hz
Regards.
-
eatmeimadanish
- Experienced User
- Posts: 118
- Joined: Thu Oct 01, 2009 5:11 pm
Re: Read & show resolution and frequency of the screen.
Decompress the EG_DB_site-packages.zip from viewtopic.php?f=2&t=4005#p23194 to your sitepackages directory. (C:\Eventghost\lib26\site-packages\) then restart EG. Once this is done, create a python script with below. You can then just feed the variables to the screen anyway you want. I just print them to give you an example.
Hope that helps!
Hope that helps!
Code: Select all
import wmi
d = wmi.WMI ()
for s in d.Win32_DisplayConfiguration ():
# If you want to see everything uncomment below
# print s
eg.globals.displaywidth = s.PelsWidth
eg.globals.displayheight = s.PelsHeight
eg.globals.displayfrq = s.DisplayFrequency
eg.globals.displaypix = s.LogPixels
eg.globals.displaybit = s.BitsPerPel
eg.globals.displayname = s.Caption
print "Device: ",eg.globals.displayname
print "Resolution: ",eg.globals.displaywidth, "x", eg.globals.displayheight
print "Frequency: ",eg.globals.displayfrq
print "Pixel Density: ",eg.globals.displaypix
print "Color Depth: ",eg.globals.displaybit,"bit"Re: Read & show resolution and frequency of the screen.
There is an option in XBMC for this here, it's called "Adjust display refresh rate to match video".FCB38 wrote:Perhaps there a solution to do this automatically but for the moment I think it's easier to choose the good fr├®quency manually.
jonib
Re: Read & show resolution and frequency of the screen.
Hello,
Thank you Eatmeimadanish & Jonib.
I've seen before the option in XBMC in the past but I forgot it. I will try.
I will try the solution of Eatmeimadanish. It can be useful to know if the screen really change his frequency.
Regards.
Thank you Eatmeimadanish & Jonib.
I've seen before the option in XBMC in the past but I forgot it. I will try.
I will try the solution of Eatmeimadanish. It can be useful to know if the screen really change his frequency.
Regards.
Re: Read & show resolution and frequency of the screen.
OK, I decompress the file "EG_DB_site-packages.zip" in my folder (C:\Logiciels\Utilitaires\EventGhost\lib26\site-packages).
I create the new python script at the begining of my XML file:
Now I can read this in the log file:
How can I read this and put it in an OSD message?
Thank you for your help!
I create the new python script at the begining of my XML file:
Code: Select all
import wmi
d = wmi.WMI ()
for s in d.Win32_DisplayConfiguration ():
# If you want to see everything uncomment below
# print s
eg.globals.displaywidth = s.PelsWidth
eg.globals.displayheight = s.PelsHeight
eg.globals.displayfrq = s.DisplayFrequency
eg.globals.displaypix = s.LogPixels
eg.globals.displaybit = s.BitsPerPel
eg.globals.displayname = s.Caption
print "Device: ",eg.globals.displayname
print "Resolution: ",eg.globals.displaywidth, "x", eg.globals.displayheight
print "Frequency: ",eg.globals.displayfrq
print "Pixel Density: ",eg.globals.displaypix
print "Color Depth: ",eg.globals.displaybit,"bit"Code: Select all
Device: NVIDIA GeForce 8600 GT
Resolution: 1024 x 768
Frequency: 60
Pixel Density: 96
Color Depth: 32 bitThank you for your help!
Re: Read & show resolution and frequency of the screen.
Putting this in the ShowOSD {eg.globals.displaywidth} should show the displaywidth, just change it to one of the other eg.globals. for other data.FCB38 wrote:How can I read this and put it in an OSD message?
jonib
Re: Read & show resolution and frequency of the screen.
It' me again. I've got a problem. I execute the script to show me information in the log file. But If I change resolution (after EventGhost starts), the script doesn't see the new values.
What's wrong? How can I repare it?
Can you help me?
Thank you.
What's wrong? How can I repare it?
Can you help me?
Thank you.
Re: Read & show resolution and frequency of the screen.
Your command Jonib is functionning perfectly. Thank you for this.jonib wrote:Putting this in the ShowOSD {eg.globals.displaywidth} should show the displaywidth, just change it to one of the other eg.globals. for other data.FCB38 wrote:How can I read this and put it in an OSD message?
jonib
I always got my problem of reading values for frequencies and r├®solution. The script given by eatmeimadanish seen to return always the same values.
I don't know where I have too put the script. For the moment I put it at the begening of my configuration tree with an other one:
Code: Select all
#Script "Minimize XBMC"
from win32gui import FindWindow, GetWindowPlacement
try:
if (GetWindowPlacement(FindWindow('XBMC','XBMC'))[1] == 2):
eg.result = True
else:
eg.result = False
except:
pass
#Script "Read screen's state"
import wmi
d = wmi.WMI ()
for s in d.Win32_DisplayConfiguration ():
# If you want to see everything uncomment below
# print s
eg.globals.displaywidth = s.PelsWidth
eg.globals.displayheight = s.PelsHeight
eg.globals.displayfrq = s.DisplayFrequency
eg.globals.displaypix = s.LogPixels
eg.globals.displaybit = s.BitsPerPel
eg.globals.displayname = s.Caption
print "Device: ",eg.globals.displayname
print "Resolution: ",eg.globals.displaywidth, "x", eg.globals.displayheight
print "Frequency: ",eg.globals.displayfrq
print "Pixel Density: ",eg.globals.displaypix
print "Color Depth: ",eg.globals.displaybit,"bit"-
eatmeimadanish
- Experienced User
- Posts: 118
- Joined: Thu Oct 01, 2009 5:11 pm
Re: Read & show resolution and frequency of the screen.
Code: Select all
import wmi
d = wmi.WMI ()
for s in d.Win32_VideoController ():
# If you want to see everything uncomment below
# print s
eg.globals.displaywidth = s.CurentHorizontalResolution
eg.globals.displayheight = s.CurrentVerticalResolution
eg.globals.displayfrq = s.CurrentRefreshRate
eg.globals.displaybit = s.CurrentBitsPerPixel
eg.globals.displayname = s.Name
print "Device: ",eg.globals.displayname
print "Resolution: ",eg.globals.displaywidth, "x", eg.globals.displayheight
print "Frequency: ",eg.globals.displayfrq
print "Color Depth: ",eg.globals.displaybit,"bit"
Re: Read & show resolution and frequency of the screen.
Hello,
It's me. I try you solution and I'm sorry but it doesn't work.
In attached you can find 2 files:
Thank you and regards.
It's me. I try you solution and I'm sorry but it doesn't work.
In attached you can find 2 files:
- First give no error but the returned resolution and frequency are alwayys the same.
- Second give errors and return nothing:
It seems to be hard, I don't understand what I do, but if you can help me I'll be happy.---> Welcome to EventGhost <---
Error compiling script.
Traceback (most recent call last) (1582):
File "C:\Logiciels\Utilitaires\EventGhost\eg\Classes\ActionItem.py", line 121, in SetArguments
self.compiled = self.executable.Compile(*args)
File "C:\Logiciels\Utilitaires\EventGhost\plugins\EventGhost\PythonScript.py", line 71, in __init__
self.PrintTraceback()
File "C:\Logiciels\Utilitaires\EventGhost\plugins\EventGhost\PythonScript.py", line 97, in PrintTraceback
treeItem.PrintError("Traceback (most recent call last):")
AttributeError: 'NoneType' object has no attribute 'PrintError'
Autostart
Plugin: ATI Remote Wonder II (WinUSB)
Plugin: Task Create/Switch Events
Plugin: XBMC2
JSON-RPC connected
HTTP API connected
Disable: Monitor Switching
Listening for XBMC broadcast events
Plugin: OS Menu
Plugin: On screen explorer
Plugin: ffdshow
Main.OnInit
Thank you and regards.
-
eatmeimadanish
- Experienced User
- Posts: 118
- Joined: Thu Oct 01, 2009 5:11 pm
Re: Read & show resolution and frequency of the screen.
That error is when a value is empty. Just declare the variables at the top of the script, and give them empty values. This should resolve that issue.
Like:
eg.globals.displaywidth = "NA"
eg.globals.displayheight = "NA"
eg.globals.displayfrq = "NA"
eg.globals.displaybit = "NA"
eg.globals.displayname = "NA"
Like:
eg.globals.displaywidth = "NA"
eg.globals.displayheight = "NA"
eg.globals.displayfrq = "NA"
eg.globals.displaybit = "NA"
eg.globals.displayname = "NA"
Re: Read & show resolution and frequency of the screen.
Hello,
I have no more errors but the returned values are always the same. I change resolution and the values don't change.
Thank you very much for your help.
PS : I put the new configuration file.
I have no more errors but the returned values are always the same. I change resolution and the values don't change.
If you don't understand let it fall.---> Welcome to EventGhost <---
Autostart
Plugin: ATI Remote Wonder II (WinUSB)
Plugin: Task Create/Switch Events
Plugin: XBMC2
JSON-RPC connected
HTTP API connected
Disable: Monitor Switching
Listening for XBMC broadcast events
Plugin: OS Menu
Plugin: On screen explorer
Plugin: ffdshow
Main.OnInit
Scripts
Device: NVIDIA GeForce 8600 GT
Resolution: 1024 x 768
Frequency: 60
Pixel Density: 96
Color Depth: 32 b
Thank you very much for your help.
PS : I put the new configuration file.
- Attachments
-
- 2012-10-27 - XBMC.xml
- (28.04 KiB) Downloaded 187 times
Re: Read & show resolution and frequency of the screen.
Hello,
I find what's wrong. In fact I was using "Win32_DisplayConfiguration" instead of "Win32_VideoController".
I can read the good values now.
Thank you and see you later.
I find what's wrong. In fact I was using "Win32_DisplayConfiguration" instead of "Win32_VideoController".
I can read the good values now.
Thank you and see you later.
