Promixis, LLC Forums  

Go Back   Promixis, LLC Forums > Old software > Girder 3.3

Reply
 
Thread Tools Display Modes
  #1  
Old November 2nd, 2005, 02:42 AM
ember447 ember447 is offline
Junior Member
Newbie
 
Join Date: Aug 2005
Posts: 2
Default Winamp Song name OSD

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!
Reply With Quote
  #2  
Old November 2nd, 2005, 05:43 AM
blubberhoofd's Avatar
blubberhoofd blubberhoofd is offline
Senior Member
Experienced User
 
Join Date: Jul 2005
Location: Uithuizen, The Netherlands
Posts: 537
Default

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:
Attached Files
File Type: rar myhtpc_backup.rar (67.2 KB, 148 views)
File Type: rar myhtpc.rar (3.9 KB, 151 views)
Reply With Quote
  #3  
Old November 18th, 2005, 08:07 AM
thug's Avatar
thug thug is offline
Junior Member
Intermediate User
 
Join Date: Aug 2003
Posts: 13
Default

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
I also use this LUA code, I know this works in Girder 3.3!
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 )
Whilst DVDSpy does send events for winamp to girder, it doesn't send the title event that often, so I go retrieve the info direct from winamp using the above script.

p.s. This works for winamp 2.x and 5.x, dunno about 3.x and who cares about 1.x

Enjoy!
Reply With Quote
  #4  
Old March 12th, 2006, 06:23 AM
thug's Avatar
thug thug is offline
Junior Member
Intermediate User
 
Join Date: Aug 2003
Posts: 13
Default

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
Thanks to eparizzi for alerting me to this serious issue. ops:
Reply With Quote
  #5  
Old February 21st, 2010, 06:19 PM
ylaviolette ylaviolette is offline
Member
Experienced User
 
Join Date: Nov 2006
Posts: 68
Default

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
Reply With Quote
  #6  
Old February 22nd, 2010, 01:56 AM
Rob H's Avatar
Rob H Rob H is offline
Senior Member
Promixis Team
 
Join Date: May 2004
Location: Cardigan, UK
Posts: 9,278
Default

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
Reply With Quote
  #7  
Old February 22nd, 2010, 05:33 PM
ylaviolette ylaviolette is offline
Member
Experienced User
 
Join Date: Nov 2006
Posts: 68
Default

Thank you, it works.

Except for "floor" which needs to be replaced with "math.floor"

Thanks again
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright (c) Promixis, LLC