I don't know all I had done was install latest version of EventGhost and this plugin and when I went to execute the file it would open two files.. One blank Media Player and one with the file selected. I than read the plugin information and changed it to only open single instance as recommended and tried it again and once again I got 2 Media Players open.. one blank and one with the select file.
Maybe a newer version of this plugin I should be trying than? What is the latest known working version?
BTW with latest EventGhost I tend to see this being repeated every few seconds is this normal?
System.RemoteDisconnect [u'']
System.RemoteConnect [u'']
------------------------------------------------------------------------------------------------------------------------------
Now on a side note is it possible to take the Get Times and ShowOSD and show a progress bar? I am currently using this code.
Code: Select all
import re
mpc = eg.WindowMatcher(u'mpc-hc.exe', None, u'MediaPlayerClassicW', None, None, None, True, 0.0, 0)
hWnd = mpc()
if len(hWnd) > 0:
from eg.WinApi import GetWindowText
title = GetWindowText(hWnd[0])
if re.search(".mkv",title,re.I):
title = title.split(".mkv")[0]
elif re.search(".mp4",title,re.I):
title = title.split(".mp4")[0]
elif re.search(".avi",title,re.I):
title = title.split(".avi")[0]
elif re.search(".ogm",title,re.I):
title = title.split(".ogm") [0]
else:
title = title.split(".")[0]
elaps, rem, total = eg.plugins.MediaPlayerClassic.GetTimes()
#print "elaps, rem, total =",elaps, rem, total
x = 1
while x < 4:
if elaps != "00:00:00":
if eg.globals.WindowsState == "Fullscreen": howManyBars = 100
if eg.globals.WindowsState != "Fullscreen": howManyBars = 100
secArray = elaps.split(':')
secArrayTotal = total.split(':')
secondsTotal = int(secArrayTotal[0])*(3600)+int(secArrayTotal[1])*(60)+int(secArrayTotal[2])
secondsElapsed = int(secArray[0])*(3600)+int(secArray[1])*(60)+int(secArray[2])
percent = (1.0*secondsElapsed)/(secondsTotal)*100
percent = int(round(percent))
bars = (percent * howManyBars)/100
#print "percent =",percent
#print "bars =",bars
osd = title + "\n \n" + "[ " + "|" * bars + " " * (howManyBars - bars) + " ]" + "\n" + " "*30 + elaps + " / " + total
if eg.globals.WindowsState <> "Fullscreen":
eg.plugins.EventGhost.ShowOSD(osd, u'0;-40;0;0;0;700;0;0;0;0;3;2;1;49;Arial', (0, 255, 255), (0, 0, 0), 4, (0, 0), 1, 1.0, False)
else:
eg.plugins.EventGhost.ShowOSD(osd, u'0;-40;0;0;0;700;0;0;0;0;3;2;1;49;Arial', (0, 255, 255), (0, 0, 0), 4, (0, 0), 2, 1.0, False)
eg.Wait(0.8)
#print x
x += 1
The problem with above code is for the 3 seconds it's displaying I can not do any other action. But the new Get Times and Show OSD does not affect any other actions. So is it possible to replicate the code above to the ShowOSD plugin? Currently I have the code below.
Code: Select all
Time: {eg.result[0]} / {eg.result[2]}
But as you can tell it's a static display with no progress bar. As you can tell also this is really old code before Get Times worked properly with MPC. So even if there is not any suggestions on trimming this code to be more efficient?
Here is how It looks now which I like but just want to know if I can clean this code up some by using the Get Times.
