Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Simple OSD of Current [Winamp] Song

  1. #1
    Join Date
    Oct 2003
    Posts
    46

    Default Simple OSD of Current [Winamp] Song

    I am trying to get the current playing song from Winamp, and then display it on the monitor using Simple OSD.

    I managed to get a pointer to the current song from Winamp (IPC_GETPLAYLISTTITLE), but I do not know how to get the information from this pointer using Girder. If I was in a C++ program I'd be fine, but I don't know what options I have in Girder to deal with this ptr.

    I am reading about Lua now, hopefully I will learn of something there.
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Look for an activex control that will do windows messaging - some of the script web sites have such controls. Look at the luacom doc above.

    Keep us posted on how it works!

    Mike

  3. #3
    Join Date
    Oct 2003
    Posts
    46

    Default

    Quote Originally Posted by Mike C
    Look for an activex control that will do windows messaging - some of the script web sites have such controls. Look at the luacom doc above.

    Keep us posted on how it works!

    Mike
    I shall try!! I had to pause research into this for now, but I will get back to it and see what I can come up with (and will post here).

    On a sad note, I'm back to Stage 1, since the SendMessage that I was using (IPC_GETPLAYLISTTITLE) is defined as only valid to Winamp plugins, and not external programs - which would seem to imply that there is no way, but of course the thousands of other apps (such as this Trillian plugin that I use) tell me that this is incorrect (since they can get the info). Wish Me Luck!!
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  4. #4
    Join Date
    Oct 2003
    Posts
    124

    Default

    It's actually fairly simple. Just run a Window --> Get Caption command and put a variable name in the "X/Timeout [ms]" box. It will save the title of the winamp window to a variable. Here comes the hard part. The title will be in the format "<song number>. <song name> - Winamp". It will also show "[Paused]" or "[Stopped]" after Winamp depending on the play state. You can either output this as is (simple), or you can write a lua script to parse out the details you want. I do not have enough experience with lua yet to help you with that.

  5. #5
    Join Date
    Oct 2003
    Posts
    46

    Default

    Quote Originally Posted by Wagner
    It's actually fairly simple. Just run a Window --> Get Caption command and put a variable name in the "X/Timeout [ms]" box. It will save the title of the winamp window to a variable. Here comes the hard part. The title will be in the format "<song number>. <song name> - Winamp". It will also show "[Paused]" or "[Stopped]" after Winamp depending on the play state. You can either output this as is (simple), or you can write a lua script to parse out the details you want. I do not have enough experience with lua yet to help you with that.
    GENIOUS!!!! Simply genious! Why didn't I think about that....

    The 'simple' version is working now..
    *gets to work on the Lua processing....*
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  6. #6
    Join Date
    Oct 2003
    Posts
    46

    Default

    It's Alive!!! Although the Lua manual was nearly useless, Google saved the day (as usual).

    I will maintain a copy of my .gml file for those of you who wish to use some of my settings.

    The file is available here:
    http://mason.gmu.edu/~tfemino/Files/GirderSettings.rar

    The particular setting discussed in this forum is currently located here:
    "Office Keyboard" -> "App Key"

    It can obviously be customized. Currently, it uses Girder's built-in simple OSD to display the Artist, and then display the SongTitle on the next line. By editing the 'Icon / Device' entry inside the command "Display Song on OSD", this can be changed. "LeadingNumber", "Part1", "Part2" are all valid variables to use here. LeadingNumber is the playlist number, Part1 is the Artist, and Part2 is the SongTitle.

    Edit: I have renamed 'LeadingNumber' to 'Part0' for consistency

    Note: This is dependant upon what Winamp display's as it's Window Title (by default, it is in the format, "XX. ArtistName - SongName - Winamp"). However, I *think* that this can be customized. If it is, then my code will need to be modified to work. If you have any coding experience at all, it should be pretty easy to manipulate my code, as I have commented well. I also offer my limited skills at Girder/Lua if you need some help.
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  7. #7
    Join Date
    Oct 2003
    Posts
    46

    Default

    I found a bug. The Lua code I'm using seems to only allow one char. as the delimiter, so it breaks at every space, instead of at every " - ".

    I'm working on a fix, and the file link above will reflect a fix once I have one..

    If any of you have experience with Lua, you are welcome to look at my code and provide some suggestions *smile*..
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  8. #8
    Join Date
    Oct 2003
    Posts
    46

    Default

    Even though nobody seems to care for this function, I fixed it.

    Apparently the 'strfind' function in the Lau standard template library cannot match the space character as the first character in the string-to-match (so when I wanted to find " - ", it wouldn't work. Now it finds "- " instead, which works but could produce mistakes).

    The URL above has been updated. Note that this will NOT work correctly if in one of the titles (Artist, SongTitle) contains a "- " substring, as my code will recognize that as a separator.
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

  9. #9
    Join Date
    Jan 2004
    Posts
    250

    Default

    Quote Originally Posted by thracx
    Even though nobody seems to care for this function, I fixed it.
    i care!

    i really like this, i downloaded it a few days ago, but just now got to playing with it in girder, so i noticed that i was getting problems with the spaces... so now i'm trying your new one.

    *edit*
    works like a charm... thanks

    oh, if it has another " - " like you said, it stops at the second string.... but if it has a "-" immediately following the artist, it displays:

    artis
    title

    because i guess it finds the dash-space ("- ") and then removes the char just b4 the dash... i'm sure you knew, but just sayin it for the sake of it. nicely, if it's just a dash in the title, it doesn't mess it up at all.
    <sig>
    </sig>

  10. #10
    Join Date
    Oct 2003
    Posts
    46

    Default

    Quote Originally Posted by Grin Reaper
    i care!

    i really like this, i downloaded it a few days ago, but just now got to playing with it in girder, so i noticed that i was getting problems with the spaces... so now i'm trying your new one.

    *edit*
    works like a charm... thanks
    Good! That's what I like to hear! I can't tell who's using/likes it if nobody posts, so thanks for the post!
    -Thracx

    "Man wants to know, and when he ceases to do so, he is no longer a man."
    -Fridtjof Nansen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •