Thanks Pako helped me out again.. now I setup a fullscreen check and have the OSD showing on proper display
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()
if len(hwnd) > 0:
timeE,timeR = eg.WinApi.GetWindowText(hwnd[0]).split(' / ')
osd = "Elapsed time: %s\nRemaining time:%s"
eg.plugins.EventGhost.ShowOSD(osd % (timeE,timeR), u'0;-64;0;0;0;700;0;0;0;238;3;2;1;66;Comic Sans MS', (0, 255, 255), (0, 0, 0), 4, (0, 0), 0, 3.0, False)
zian wrote:Hay Pako,
Thanks for this script, it was exactly what I was looking for...almost. I'm a Python code know nothing but I tweaked some of the settings to change the font (easy) and also the OSD's screen position (harder at first).
Now I wonder if this OSD could be made to just be a simple line/bar graph instead of text/numbers? Sort of like some PC's display a volume bar on bottom of screen...the width of the screen would equal 100% of video, 1/3 bar/line of screen about 33% etc. If not doable no biggie.
Thanks again my friend...
ALL of you code guys (& ladies) are AWESOME.
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
<Macro Name="Show Volume Bar Graph" Expanded="True">
<Action>
EventGhost.PythonScript(u"from eg.WinApi.Dynamic import SendMessage\nTBM_GETPOS = 1024\nFind_MPC_Volume_Ctrl=eg.WindowMatcher(u'mplayerc.exe', u'{*}Media Player Classic', u'MediaPlayerClassicW', u'', u'msctls_trackbar32', 1, True, 0.0, 0)\nhwnd = Find_MPC_Volume_Ctrl()\n\nM = 5\n\nif len(hwnd) > 0:\n#if 1:\n volume = int(SendMessage(hwnd[0], TBM_GETPOS, 0, 0)/10)\n #volume = int(eg.WinApi.SoundMixer.GetMasterVolume())/10\n eg.result = volume*M*u'\\u2588'\nelse:\n eg.result = ''")
</Action>
<Action>
EventGhost.ShowOSD(u'{eg.result}', u'0;-48;0;0;0;400;0;0;0;238;3;2;1;49;Lucida Console', (255, 0, 0), (0, 0, 0), 2, (0, 0), 0, 3.0, False)
</Action>
</Macro>
</EventGhost><?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
<Macro Name="Volume Up">
<Action>
MediaPlayerClassic.VolumeUp()
</Action>
<Action>
EventGhost.PythonScript(u'from eg.WinApi.Dynamic import SendMessage\nTBM_GETPOS = 1024\nFind_MPC_Volume_Ctrl=eg.WindowMatcher(u\'mpc-hc.exe\', u\'{*}Media Player Classic{*}\', u\'MediaPlayerClassicW\', u\'\', u\'msctls_trackbar32\', 1, True, 0.0, 0)\nhwnd = Find_MPC_Volume_Ctrl()\n\nM = 2\n\nif len(hwnd) > 0:\n volume = int(SendMessage(hwnd[0], TBM_GETPOS, 0, 0)/5)\n eg.result = volume*M*u\'\\u2588\'\n volume2 = SendMessage(hwnd[0], TBM_GETPOS, 0, 0)\n eg.result2 = volume2\nelse:\n print "Window not found"\n eg.result = \'\'')
</Action>
<Action>
EventGhost.ShowOSD(u'Volume: {eg.result} {eg.result2}%', u'0;-48;0;0;0;400;0;0;0;238;3;2;1;49;Lucida Console', (255, 0, 0), (0, 0, 0), 0, (60, 150), 0, 2.0, False)
</Action>
<Action>
EventGhost.AutoRepeat(0.59999999999999998, 0.59999999999999998, 0.01, 2.0)
</Action>
</Macro>
</EventGhost>zian wrote:Hello Peeps,
Sorry if this is wrong topic or if this info is posted here already (I did look).
Another MPC OSD function I'm looking for...
On screen display for the title of a file that is playing.
Thanks much if you can point me in the right direction and I'll keep looking.
Users browsing this forum: Google [Bot] and 0 guests