![]() |
|
#1
|
|||
|
|||
|
hello there...ive been trying to figure out, with no luck yet, how to display the name of the song currently playing in winamp thru OSD. im using girder 3.3. thanks!
|
|
#2
|
||||
|
||||
|
Hi,
I was looking for a similar solution about a year ago, and came across an even better one. In Winamp use the "Geiss 2" or the "Milkdrop" visualisation plugin, and set it to automatically start the plugin when music starts playing. Take a look at my primary GML of Girder 3.3.9 in the group "HTPC combo" made for myHTPC with Winamp, MediaPlayerClassic and GotTV, here's where I've setup Winamp in a group called "MUSIC" inside the "bottom layer commands" group. Using the "video mode" command swithes between "Geiss 2" :minimised, maximised with songtitle and timer, minimised, maximised without songtitle and timer. Also the menu showing the playlist (wich allows you to browse and select) of "Geiss 2" is set up in the "music fulscreen mode" subgroup. EDIT: don't mind the stuff in misc automation, a lot of it is work in progress. :wink: I've noticed that the "myHTPC plugin" is no longer available in the downloads section, whitch is needed in the myHTPC navigation, so I added it.(myHTPC.rar) Note: the osd commands are made with the "XP osd plugin". Have fun! I you've got questions, just ask! :wink: |
|
#3
|
||||
|
||||
|
I use this, I believe I found something similar on the girder.nl forums somewhere, it's probably lost by now... but....
I lua functionized it and made it more useful :- Code:
function RetrieveWinAmpTitle()
local strWinAmpTitle, strTemp, intStatus
strWinAmpTitle = ""
local hWnd = FindWindow("Winamp v1.x", nil)
if ( hWnd ~= 0 ) then
strWinAmpTitle = gsub(GetWindowText(hWnd), "- Winamp", "&;^")
intStatus = strfind(strWinAmpTitle, "&;^")
if intStatus ~= nil then
strTemp = strsub(strWinAmpTitle, 1, intStatus - 2)
strWinAmpTitle = strsub(strTemp, strfind(strTemp, " ") + 1)
end
end
return strWinAmpTitle
end
Just dump the above and the following code into a lua window (Girder->Variable Manipulaton Script), run winamp, press play, press F5 in the girder script editor window and watch the output window) Code:
WA_GETSHUFFLESTATUS = 250
WA_GETREPEATSTATUS = 251
WA_SETSHUFFLESTATUS = 252
WA_SETREPEATSTATUS = 253
WA_REFRESHPLCACHE = 247
WA_RESTARTWINAMP = 135
WA_PLAYFILE = 100
WA_CLEARPLAYLIST = 101
WA_STARTPLAY = 102
WA_ISPLAYING = 104
WA_GETOUTPUTTIME = 105
WA_SETTRACK = 121
WA_SETVOLUME = 122
WA_SETBALANCE = 123
WA_GETLISTLENGTH = 124
WA_GETLISTPOS = 125
WA_GETINFO = 126
WA_GETEQDATA = 127
WA_ENQUEUEPLAYLIST = 129
WA_GETPLAYLISTTITLE = 212
WM_USER = 1024
WM_WA_IPC = WM_USER
WinAmpData = {}
local hWnd = FindWindow("Winamp v1.x", nil)
if ( hWnd ) then
WinAmpData.strTitle = RetrieveWinAmpTitle()
WinAmpData.intSampleRate = SendMessage(hWnd,WM_WA_IPC,0,WA_GETINFO) -- khz
WinAmpData.intBitRate = SendMessage(hWnd,WM_WA_IPC,1,WA_GETINFO) -- kbps
WinAmpData.intChannels = SendMessage(hWnd,WM_WA_IPC,2,WA_GETINFO) -- Stereo or Mono
WinAmpData.intPosition = SendMessage(hWnd,WM_WA_IPC,0,WA_GETLISTPOS)+1 -- PlayListPos
WinAmpData.intLength = SendMessage(hWnd,WM_WA_IPC,0,WA_GETLISTLENGTH) -- PlayListLength
WinAmpData.intElapsed = floor((SendMessage(hWnd,WM_WA_IPC,0,WA_GETOUTPUTTIME))/1000) -- Song Time Elapsed in Secs
WinAmpData.intDuration = SendMessage(hWnd,WM_WA_IPC,1,WA_GETOUTPUTTIME) -- Song Time Length In Secs
WinAmpData.intRepeat = SendMessage(hWnd,WM_WA_IPC,0,WA_GETREPEATSTATUS) -- 0 = off 1 = on
WinAmpData.intShuffle = SendMessage(hWnd,WM_WA_IPC,0,WA_GETSHUFFLESTATUS) -- 0 = off 1 = on
WinAmpData.intStatus = SendMessage(hWnd,WM_WA_IPC,0,WA_ISPLAYING) -- 0 = stopped, 1 = playing, 3 = paused
end
print ("SongName ", WinAmpData.strTitle)
print ("SampleRate ", WinAmpData.intSampleRate )
print ("BitRate ", WinAmpData.intBitRate )
print ("Channels ", WinAmpData.intChannels )
print ("Position ", WinAmpData.intPosition )
print ("Length ", WinAmpData.intLength )
print ("Elapsed ", WinAmpData.intElapsed )
print ("Duration ", WinAmpData.intDuration )
print ("Repeat ", WinAmpData.intRepeat )
print ("Shuffle ", WinAmpData.intShuffle )
print ("Status ", WinAmpData.intStatus )
p.s. This works for winamp 2.x and 5.x, dunno about 3.x and who cares about 1.x ![]() Enjoy! |
|
#4
|
||||
|
||||
|
New routine for RetrieveWinAmpTitle(), on previous post, because of the "Scroll title in Windows taskbar" option in winamp 5.x
Code:
function RetrieveWinAmpTitle() -- V1.1g
local strWinAmpTitle, strTemp, intStatus, intStatusScroll
strWinAmpTitle = ""
local hWnd = FindWindow("Winamp v1.x", nil)
if ( hWnd ~= 0 ) then
strWinAmpTitle = GetWindowText(hWnd)
intStatusScroll = strfind(strWinAmpTitle, "***")
if (intStatusScroll ~= nil ) then
strWinAmpTitle = strsub(strWinAmpTitle,intStatusScroll)
end
strWinAmpTitle = gsub(strWinAmpTitle, "- Winamp", "&^")
intStatus = strfind(strWinAmpTitle, "&^")
if (intStatus ~= nil) then
strTemp = strsub(strWinAmpTitle, 1, intStatus - 2)
strWinAmpTitle = strsub(strTemp, strfind(strTemp, " ") + 1)
end
if (intStatusScroll ~= nil ) then
strWinAmpTitle = strsub(strWinAmpTitle, strfind(strWinAmpTitle, " ") + 1)
end
end
return strWinAmpTitle
end
ops:
|
|
#5
|
|||
|
|||
|
The second script (which begins with WA_GETSHUFFLESTATUS = 250...)
Generates the following error in Girder 4: [string "OFA 9910 control.gml:\X10 - Automation\On S..."]:28: attempt to call global `FindWindow' (a nil value) stack traceback: [string "OFA 9910 control.gml:\X10 - Automation\On S..."]:28: in main chunk Any clue how to resolve this? Thx |
|
#6
|
||||
|
||||
|
Try using win.FindWindow, you'll also need to use win.GetWindowText and change strfind, strsub, strgsub to string.find, string.sub and string.gsub
__________________
--Rob |
|
#7
|
|||
|
|||
|
Thank you, it works.
Except for "floor" which needs to be replaced with "math.floor" Thanks again
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|