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.

Is it possible to show Volume OSD for Media Player Classic

If you have a question or need help, this is the place to be.
Post Reply
molitar
Experienced User
Posts: 209
Joined: Fri Sep 11, 2009 6:44 am

Is it possible to show Volume OSD for Media Player Classic

Post by molitar »

I would like it to show my current volume level either as a bar or volume percentage when I use the volume up or down for Media Player Classic. Can this be done and if so how?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Is it possible to show Volume OSD for Media Player Classic

Post by Pako »

Code: Select all

from eg.WinApi.Dynamic import SendMessage
TBM_GETPOS = 1024
Find_MPC_Volume_Ctrl=eg.WindowMatcher(u'mplayerc.exe', u'{*}Media Player Classic', u'MediaPlayerClassicW', u'', u'msctls_trackbar32', 1, True, 0.0, 0)
hwnd = Find_MPC_Volume_Ctrl()
if len(hwnd) > 0:
    volume = SendMessage(hwnd[0], TBM_GETPOS, 0, 0)
    osd = "Volume: %i%%"
    eg.plugins.EventGhost.ShowOSD(osd % volume, 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)
Pako
molitar
Experienced User
Posts: 209
Joined: Fri Sep 11, 2009 6:44 am

Re: Is it possible to show Volume OSD for Media Player Classic

Post by molitar »

Pako wrote:

Code: Select all

from eg.WinApi.Dynamic import SendMessage
TBM_GETPOS = 1024
Find_MPC_Volume_Ctrl=eg.WindowMatcher(u'mplayerc.exe', u'{*}Media Player Classic', u'MediaPlayerClassicW', u'', u'msctls_trackbar32', 1, True, 0.0, 0)
hwnd = Find_MPC_Volume_Ctrl()
if len(hwnd) > 0:
    volume = SendMessage(hwnd[0], TBM_GETPOS, 0, 0)
    osd = "Volume: %i%%"
    eg.plugins.EventGhost.ShowOSD(osd % volume, 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)
Pako
Thanks Pako worked great.
Post Reply