Is there a way to check/query programmatically the state WMC is in ie: Currently recording TV show, playing Live TV, paused Live TV or paused recorded tv?
I use AHK to automate my HTPC, if I could do it through this it would be great.
At the moment I use MST Standby Tool to sleep my HTPC as this tool can tell when WMC is idle, ie: not recording, live tv etc...
How to check if WMC is recording, in Live TV, paused mode
-
- Posts: 15
- Joined: Sun Feb 07, 2016 8:51 am
- Location:
- HTPC Specs:
-
- Posts: 2841
- Joined: Sun Jun 02, 2013 9:44 pm
- Location:
- HTPC Specs:
WMC tells the system to not go to sleep while it is performing certain operations, you can use this command to see if anything is telling your PC to not sleep:
powercfg -requests
I'm not sure if it has the granularity you need. You can read this thread where this command was used to create a script to reboot the HDHR Prime only when WMC was not currently using it:
http://www.thegreenbutton.tv/forums/vie ... f=6&t=5927
I know that WMC will tell the PC to not sleep when playing back a show (paused or not) or when it is recording a show or playing live TV.
There may be API calls that can do this in a more detailed way, but I am not familiar with the API, so can not help there.
powercfg -requests
I'm not sure if it has the granularity you need. You can read this thread where this command was used to create a script to reboot the HDHR Prime only when WMC was not currently using it:
http://www.thegreenbutton.tv/forums/vie ... f=6&t=5927
I know that WMC will tell the PC to not sleep when playing back a show (paused or not) or when it is recording a show or playing live TV.
There may be API calls that can do this in a more detailed way, but I am not familiar with the API, so can not help there.
-
- Posts: 15
- Joined: Sun Feb 07, 2016 8:51 am
- Location:
- HTPC Specs:
Ive looked into the WMC SDK a while ago but (to me at least) and from what ive read there doesn't seem to be any direct API calls which return WMC current state.
Currently im looking at testing for presence of ehrec.exe as this appears when a tv show is recording. Extracting the I/O rate from ehrecvr.exe as this process seems to process the live tv/ paused tv video streams, so when the IO rate is above say 500 kB/sec or so then WMC must be either in LiveTV or paused LiveTV (buffering).
The last is check wether recorded tv is playing or in paused mode, ive been looking at the cpu % of 'ehshell.exe' in 'Process Hacker', when a recorded show is playing the CPU% doesnt drop below around 2.3% (on my system), and when paused it doesnt go above approx 1.1% CPU usage. Not ideal but could be close enough to code an AHK script.
Any other ideas?
Currently im looking at testing for presence of ehrec.exe as this appears when a tv show is recording. Extracting the I/O rate from ehrecvr.exe as this process seems to process the live tv/ paused tv video streams, so when the IO rate is above say 500 kB/sec or so then WMC must be either in LiveTV or paused LiveTV (buffering).
The last is check wether recorded tv is playing or in paused mode, ive been looking at the cpu % of 'ehshell.exe' in 'Process Hacker', when a recorded show is playing the CPU% doesnt drop below around 2.3% (on my system), and when paused it doesnt go above approx 1.1% CPU usage. Not ideal but could be close enough to code an AHK script.
Any other ideas?
- DavidinCT
- Posts: 1556
- Joined: Mon Feb 13, 2012 3:45 pm
- Location:
- HTPC Specs:
There is a way, like a RSS feed in WMC called MSAS. The little LCD displays use that source to show status of WMC. I still have one of those on my HTPC. It will show what menu I am in, show status when something is recording, etc. When I start a show, it will show the show name and how much time is left.
LCDwriter (google it) is what I use and it accesses this. MSAS should lead you on what your looking for...
LCDwriter (google it) is what I use and it accesses this. MSAS should lead you on what your looking for...
-Dave
Twitter @TheCoolDave
Windows Media Center certified and WMC MVP 2010 - 2012
Twitter @TheCoolDave
Windows Media Center certified and WMC MVP 2010 - 2012