Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: Winamp playlist OSD menu

  1. #1
    Join Date
    May 2001
    Location
    Chestnut Hill, MA, USA
    Posts
    527

    Default Winamp playlist OSD menu

    If you'd rather have a trivial UI for navigating the Winamp playlist with your remote, here's one way to do it in Girder using SendMessage and OSDMenu (but not DVDSpy :cry: ).

    Write a MultiGroup to build and display the OSD menu.
    • Use SendMessage to send Winamp a WM_WA_IPC message with IPC_WRITEPLAYLIST.
    • Send WM_WA_IPC with IPC_GETLISTPOS and put the result in a variable.
    • Convert the winamp.m3u file into a .ini file for OSDMenu. This can be done inside Girder with the new GVMS, which ought to have file I/O and looping. But for now, run the VBScript below to do it.
    • Start OSDMenu with the resultant .ini file.


    Code:
    ' Convert Winamp playlist (M3U) file to OSDMenu definition (INI) file.
    Option Explicit
    
    ' Command line arguments: "c:\Program Files\Winamp\winamp.m3u" "c:\Program Files\girder32\plugins\osdmenu\winampmenu.ini" [curpos]
    Dim args, fso, istr, ostr, pos
    Const ForReading = 1, ForWriting = 2
    Set args = Wscript.Arguments
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set istr = fso.OpenTextFile(args(0), ForReading)
    Set ostr = fso.OpenTextFile(args(1), ForWriting, True)
    
    istr.ReadLine   'Skip header line
    
    ' Header info
    ostr.WriteLine "[visual]"
    ostr.WriteLine "wnd_size=fit2text"
    ostr.WriteLine "startpos=" & args(2)
    ostr.WriteLine ""
    ostr.WriteLine "[main]"
    
    ' One item line per playlist entry
    pos = 0
    Do
      Dim line
      line = Null
      On Error Resume Next
      line = istr.ReadLine()
      istr.ReadLine 'Skip filename
      On Error Goto 0
      If IsNull(line) Then Exit Do
      If Left(line, 8) = "#EXTINF:" Then
        line = Mid(line, InStr(line, ",") + 1)
      End If
      ostr.WriteLine line & "=#18#waplay#" & pos
      pos = pos + 1
    Loop
    istr.Close
    ostr.Close
    Set up a second MultiGroup to respond to OSDMenu's event, waplay.
    • Send WM_WA_IPC IPC_SETPLAYLISTPOS with the payload to change the playlist position.
    • Send WM_COMMAND WINAMP_BUTTON2 to push the Play button.

  2. #2
    Join Date
    Sep 2001
    Location
    Sheffield, UK
    Posts
    320

    Default

    Wow! That sounds pretty cool.

  3. #3
    Join Date
    Jun 2002
    Posts
    19

    Default

    Can you spell that out even further for this newbie. I don't get how to use SendMessage to send Winamp a WM_WA_IPC message with IPC_WRITEPLAYLIST, etc. It sounds pretty neat to have Winamp's playlist as an OSD, but this coding stuff is hurting my head. Is there any step by step guide you could whip up? Much appreciated.

    SD

  4. #4
    Join Date
    May 2001
    Location
    Chestnut Hill, MA, USA
    Posts
    527

    Default

    It is probably easier to just show it. Look at the .GML file inside the .ZIP file I attached. WM_WA_IPC etc. are constants. The numeric values are in the SendMessage commands in the example file.

    • Extract the contents of the .ZIP file under c:\Program Files\Girder32 (where Girder was installed).
    • Launch Winamp if it is not already running.
    • Launch Girder and load WinampMenu.GML.
    • Adjust filenames for Winamp playlist and VBS script as necessary.
    • Select the "Menu" command.
    • Commands>Test Command (F5) to run it manually.
    • List of titles should appear.
    • Use arrow keys to navigate.
    • Use Enter key to select.
    • Selected title should play immediately.


    As I said, you can look at the settings for each command to see how it's doing it precisely.

    After you have it basically checked out, you will want to merge the commands into your normal Girder file. Probably you will want to launch the menu via some button on your remote.

  5. #5
    Join Date
    Jun 2002
    Posts
    19

    Default

    I am having trouble using the arrow keys to get to other parts of my playlist. The list is stationary at whatever spot it is and the cursor moves off the screen in either direction. Also, I am not sure where to put the events based on the gml file you left there, like how do I get arrow keys on my remote to work with the OSD playlist? Thanks.

    SD

  6. #6
    Join Date
    May 2001
    Location
    Chestnut Hill, MA, USA
    Posts
    527

    Default

    May I suggest that you first get the Winamp specific parts to work using the keyboard and then move on to the remote, if you have not already done so. I'll assume that you have something you like using the arrow keys on the keyboard.

    I'll further assume that you have your remote working with Girder. If not, get it to do something trivial, like Simple OSD of "Hello, SD!" first.

    Then the remaining tricky part is how to get the arrow keys on the remote to navigate OSDMenu. The OSDMenu.GML sample, which is in the same .ZIP file as the OSDMenu plug-in, shows how to do this. The idea is that when the menu comes up it runs a command that enables a group of commands that simulate the arrow keyboard keys typing at the special OSD menu window. And when it comes down a similar command disables the group. That way the remote's arrow keys are available for other useful stuff when the menu isn't displayed.

    So,
    • Paste together the two groups in OSDMenu.GML and the two commands in WinampMenu.GML. (Which is pretty straightforward: open the file, select the root, Edit Copy, open the other file, Edit Paste. Drag children up a level if you don't like nested groups.)
    • Set Command on Menu start and Command on Menu end for Menu (under Winamp OSD Menu) to be like Start OSDMenu (under OSDMenu).
    • Learn an IR command for each of Up, Down, and Enter (under Menu Keys). These will navigate.
    • Learn an IR command for Menu (under Winamp OSD Menu). This will launch it.
    • Try it.

  7. #7
    Join Date
    Jun 2002
    Posts
    19

    Default

    I appreciate the prompt responses but I guess my main concern was the fact that I could only see one part of my list and I guess that concern still remains unresolved. If you can help further, I would appreciate it. Thanks again.

    The Speediest Demon of them ALL

  8. #8
    Join Date
    Feb 2002
    Location
    Haifa, Israel.
    Posts
    209

    Default

    SpeedRacer:

    I believe your problem should go away if you add the following the line of text to the m3u2osdmenu.vbs file, right below the line that reads "ostr.WriteLine "[visual]""


    Code:
    ostr.WriteLine "itemsperscreen=X"
    (where X is the amount of lines you can see on the screen at one time).

    This way, once you go past the borders, the list will scroll down and your selection will remain visible.

    MMcM:

    I found it necessary to change:

    Code:
    ostr.WriteLine "startpos=" & args(2)
    to:

    Code:
    ostr.WriteLine "startpos=" & (args(2) + 1)
    so as to compensate for the 0-based-indexing.

    Thanks a lot! I used to do this proccess via batch scripting (I didn't know you can use Visual Basic script outside of Microsoft Office and Internet scripts ops: )

  9. #9
    Join Date
    Feb 2002
    Location
    Haifa, Israel.
    Posts
    209

    Default

    Wow, this solution just became even more attractive to me now with the advent of OSDMenu 1.6, which has support for Menu Titles. If you usually use the classic "Artist - Title" format display, and you usually have one album in your playlist at a time, you can now cut out the Artist Name from each Menu Item, and instead put the Artist Name in the Menu Title, thus saving space and making for an even nicer-looking straight-forward interface for selecting your song.

    All you have to do is edit the .vbs a little bit. If anyone wants me to post a more thorough explanation of how to do this, let me know.

  10. #10
    Join Date
    Jan 2002
    Location
    Amersfoort, NL
    Posts
    70

    Default

    great script!

    but I've got a small problem with big playlists. The OSD Menu doesn't seem to like very long ini files. Is this a limitation of the plugin?

    I check on the precise number of lines and characters:
    The OSDMenu won't display more than 555 lines (which is 576 lines (24333 characters) in the INI file)

    this is a bit anoying. anybody an idea?
    I justs love Girder and my remote... and now I wan\'t lots of OSD menus!!! :)

Posting Permissions

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