molitar
September 7th, 2006, 02:53 PM
Secondly is it possible to show OSD on the full screen display secondary output?
I wish to show an OSD on my secondary display with the file currently being played when using the next or previous button. Also it should only show up for about 5 seconds. So how can I accomplish this?
You really need some type of OSD builder it's to cryptic on what and how to start using it. Examples are lacking on how to get filenames currently playing, progress, ect. I honesly found the OSD examples useless for my needs.
blubberhoofd
September 8th, 2006, 07:50 AM
hi,
have a look at this OSD for Media player classic. It displays the players current progress and title on the secondary monitor. Never mind the "Title" variable, in my setup it's generated when I launch videos from Meedio
-- get time from MPC
local m = {}
m.ChildClass = "static"
m.Filename = "mplayerc.exe"
m.MatchHidden = true
index = 1
local test = gir.GetWindowMatches(m)
if test ~= nil then
Handle = table.tostring(gir.GetWindowMatches(m))
repeat
Start = string.find(Handle, "= ", index)
if Start ~= nil then
index = string.find(Handle, ",", Start)
handle = string.sub(Handle, Start+2, index-1)
windowtext = win.GetWindowText(handle)
if windowtext ~= nil then
if string.find(windowtext, "%d%d%s/%s%d") then
print (windowtext)
--convert to percentage
_, _, hours, minutes, seconds, thours, tminutes, tseconds = string.find(windowtext, "(%d%d)%p(%d%d)%p(%d%d)%s%p%s(%d%d)%p(%d%d)%p(%d%d)")
if hours == nil then
_, _, minutes, seconds, tminutes, tseconds = string.find(windowtext, "(%d%d)%p(%d%d)%s%p%s(%d%d)%p(%d%d)")
hours = 0
thours = 0
end
hours = 3600 * hours
minutes = minutes * 60
seconds = seconds + minutes + hours
print ("current="..seconds)
thours = 3600 * thours
tminutes = tminutes * 60
tseconds = tseconds + tminutes + thours
print ("total="..tseconds)
ratio = seconds / tseconds
percentage = ratio * 100
print (percentage.."%")
if Title == nil then Title = "test" end
--show progressbar
if not ProgOSD then
ProgOSD = osd.Classes.Progress:New(osd.GetStyle("ProgressDarkBlue",{Monitor = 2, Position = "NEARBOTTOMCENTERW", BorderSize = 0, BGColor1 = osd.MakeARGB(255, 136, 136, 136), BGColor2 = osd.MakeARGB(255, 17, 17, 17), FGColor1 = osd.MakeARGB(255, 221, 221, 221), FGColor2 = osd.MakeARGB(255, 136, 136, 136), TimeOut = 1500, AutoSizeWidth = 95, Caption = Title.."\n"..windowtext, Min = 0, Max = 100}))
end
ProgOSD.Caption = Title.."\n"..windowtext
ProgOSD:Show(true, percentage, 1)
end
end
end
until Start == nil
end
hope this helps ;)
molitar
September 8th, 2006, 02:10 PM
Ok I put that code into the On Screen Display and tied it to a button press. The logger shows it running but I see no OSD. So I changed the monitor to 1 to see if it is showing up local. Still not showing.
Nevermind figured out it needed to be using the script component not the OSD. Guess not sure what use the OSD component is for then. Guess it's also impossible if using monitor clone mode. To bad because I hate multi monitor mode since I can not stand my mouse always going off screen to the right when resizing windows. Wish the stupid companies like Nvidia and ATI would fix it so clone with full screen could show everything.
Rob H
September 8th, 2006, 02:38 PM
Handy tip for avoiding the mouse moving off the main screen if you use the other screen for e.g. video, is to open the display properties to the settings tab and drag the secondary display so that it only touches the primary by a corner.
Then you have to move the mouse the the appropriate corner to move to the other monitor.
molitar
September 8th, 2006, 04:13 PM
rah99 thanks for that information. I didn't know that. I will try that out. Thanks
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.