How to show OSD on secondary display?

If you have a question or need help, this is the place to be.

How to show OSD on secondary display?

Postby molitar » Wed Sep 16, 2009 9:49 am

How can I make the OSD show on the secondary monitor? Now that I moved to Windows 7 when I maximize I can't have the video on both monitors only one. So now when it's maximized the video shows on the secondary display.

Thanks Pako helped me out again.. now I setup a fullscreen check and have the OSD showing on proper display :)
Last edited by molitar on Tue Jan 26, 2010 7:32 am, edited 2 times in total.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby jinxdone » Wed Sep 16, 2009 11:05 am

Sounds like you get some info from a media player prgoram.. which one?
User avatar
jinxdone
Plugin Developer
 
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: OSD to show current time / end time

Postby molitar » Wed Sep 16, 2009 5:19 pm

MediaPlayer Classic Home Cinema from the CCCP pack.. mpc-hc.exe is the name of the executable.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby Pako » Wed Sep 16, 2009 6:16 pm

Code: Select all
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)
Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: OSD to show current time / end time

Postby molitar » Wed Sep 16, 2009 9:20 pm

Awesome thanks Pako both you and Jinxdone you helped me to make a very functional mpc-hc remote commands :) Now got my volume osd, playtime osd, and my window state toggle.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby zian » Fri Sep 25, 2009 2:13 pm

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.
eventghost.net
Be there or be square.
zian
Site Admin
 
Posts: 285
Joined: Wed Jun 24, 2009 3:54 pm

Re: OSD to show current time / end time

Postby molitar » Fri Sep 25, 2009 2:34 pm

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.


That would be cool. Question which part of the line is the seconds? What I would like to do is make it only show for about .60 seconds and loop/repeat about 5 times.. that would make a realtime update count for about a 3 second view. Got a good script to do this I was thinking one method is to increment a value and use a loop and if the value is not equal or greater than loop again as one method.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby Pako » Fri Sep 25, 2009 6:27 pm

Code: Select all
<?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) &gt; 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>
Copy & paste everything from the code box into EG.

You can change the constant M in the script and font size, so you at 100% volume got a bar over the whole width of the screen.
Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: OSD to show current time / end time

Postby molitar » Fri Sep 25, 2009 11:03 pm

Pako, thanks but your missing a set of brackets in the Find where it is u'{*}Media Player Classic', it should be u'{*}Media Player Classic{*}',. Took me a little bit of studying of the prior OSD to figure out what was different.

I modified the script to further show the percentage at the end of the volume bar. Note I also had to change the /10 to /5 in volume = int(SendMessage(hwnd[0], TBM_GETPOS, 0, 0)/5 to get proper display for each press for MPC seems it uses a divisible of 5 not by 10.

Code: Select all
<?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) &gt; 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>
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby zian » Sat Sep 26, 2009 1:18 am

Okie dokie,

Cool, I have been looking for that volume bar graph type OSD a while back. Gonna try to see if I can get it to work with my general volume and not only MPC.

But...
We have two macros/scripts on this topic now. One for MPC play times and one for MPC volumes. I tried combining them...sort of and failed. I'm looking to make the MPC time OSD bar/graph style.
Any help would be great.
Thanks again.
eventghost.net
Be there or be square.
zian
Site Admin
 
Posts: 285
Joined: Wed Jun 24, 2009 3:54 pm

Re: OSD to show current time / end time

Postby Pako » Sat Sep 26, 2009 5:32 am

I'm sorry.
I am in error into the Volume macro put the MPC time script.
I tried it only with master volume (commented lines).
When I made the first script (MPC volume), it was normal MPC. Therefore there is only u'{*}Media Player Classic'.
The second script (MPC time) was made for the mpc-hc.exe. Therefore, there was u'{*}Media Player Classic{*}'.
Pako
User avatar
Pako
Plugin Developer
 
Posts: 1283
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic

Re: OSD to show current time / end time

Postby molitar » Sat Sep 26, 2009 6:57 am

For Main volume control I use a freeware software called 3RVX it has all sorts of skins for volume control. So when you change primary volume you have an OSD bar. So I don't bother with a main volume OSD in Ghost for their is no need nothing beats 3RVX for that purpose.

On side note I have really learned how to use global variables to check window state for Fullscreen. When I toggle fullscreen I toggle a value.. than when I hit fullscreen button it checks to see if windows is maximized or minimized first and will restore the window before fullscreen takes affect. It was your script that eg.result that showed me how to use variables so thanks with that bit of knowledge I created a variable called eg.fullscreen and set it to True or False.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby zian » Sat Oct 17, 2009 4:39 pm

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.
eventghost.net
Be there or be square.
zian
Site Admin
 
Posts: 285
Joined: Wed Jun 24, 2009 3:54 pm

Re: OSD to show current time / end time

Postby molitar » Sat Oct 17, 2009 4:48 pm

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.


If your using mpc than usually you have ffdshow running also.. I have set my ffdshow to always run for all file types.. setup OSD that shows just what your looking for.. the ffdshow OSD can show alot of information.
molitar
Experienced User
 
Posts: 149
Joined: Fri Sep 11, 2009 6:44 am

Re: OSD to show current time / end time

Postby zian » Sat Oct 17, 2009 6:35 pm

Thanks molitar...I'll check that out.

I also somewhat took care of the issue with the information in this link...
TextGrab Plug-in
viewtopic.php?f=2&t=1962
It was very handy.
eventghost.net
Be there or be square.
zian
Site Admin
 
Posts: 285
Joined: Wed Jun 24, 2009 3:54 pm

Next

Return to General Support

Who is online

Users browsing this forum: Google [Bot] and 0 guests