Code: Select all
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])
eg.result = title.split(".m")[0]
Find_MPC_Time=eg.WindowMatcher(u'mpc-hc.exe', u'{*}Media Player Classic{*}', u'MediaPlayerClassicW', None, u'Static', 2, True, 0.0, 0)
hwnd = Find_MPC_Time()
x = 1
While x < 4:
if len(hwnd) > 0:
if eg.globals.WindowsState == "Fullscreen": howManyBars = 80
if eg.globals.WindowsState != "Fullscreen": howManyBars = 80
timeE,timeR = eg.WinApi.GetWindowText(hwnd[0]).split(' / ')
secArray = timeE.split(':')
secArrayTotal = timeR.split(':')
secondsTotal = int(secArrayTotal[0])*(60)+int(secArrayTotal[1])
secondsElapsed = int(secArray[0])*(60)+int(secArray[1])
percent = (secondsElapsed*howManyBars)/secondsTotal
osd = eg.result + "\n \n" + "[" + "|"*(percent) + " "*(howManyBars-percent) + "]" + "\n" + " "*30 + timeE + " / " + timeR
if eg.globals.WindowsState != "Fullscreen":
eg.plugins.EventGhost.ShowOSD(osd, u'0;-50;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (0, 255, 255), (0, 0, 0), 4, (0, 0), 0, 1.0, False)
else:
eg.plugins.EventGhost.ShowOSD(osd, u'0;-50;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (0, 255, 255), (0, 0, 0), 4, (0, 0), 1, 1.0, False)
mpc = eg.WindowMatcher(u'mpc-hc.exe', None, u'MediaPlayerClassicW', None, None, None, True, 0.0, 0)
hWnd = mpc()
X = X + 1