• Welcome to Valhalla Legends Archive.
 

winamp play wildcard

Started by Tass, November 26, 2005, 08:34 PM

Previous topic - Next topic

Stealth

Quote from: shadypalm88 on November 27, 2005, 11:10 AM
Quote from: l2k-Shadow on November 27, 2005, 02:17 AM
You can also open up the playlist file inside the winamp folder, parse it, and figure out which position in the playlist is the song you want it to play. Then you just set the winamp playlist to that position and play.
Yep, that's how I do it, anyway.  Just a reminder, when you read it in VB, make sure you use Line Input #n, SomeStringVar instead of Input #n, SomeStringVar.

Quote from: Tass on November 27, 2005, 10:34 AM
Rabbit, know where I can get a good api. I can't find any with this..
Go to the NSDN website and download the SDK.  The definitions for the Windows messages that you can send to Winamp to get information or to make it do things are in winamp/wa_ipc.h inside that archive.  Declare the SendMessage function in VB, define some constants if you want and go.

In order to send the messages to Winamp you first need to acquire its window handle (HWND).  If you only want to support Winamp 2.x, you can just use FindWindow to search for "Winamp 1.x" (literally an 'x' character there).  If you want Winamp 5 support, you'll need to use EnumWindows and scan for it, because the window title in 5 is either "Winamp 5.##" when there's nothing playing or loaded, or "#. Artist - Title - Winamp" when there is.

Rabbit, that's exactly what happens.

Shady, as far as I can remember, I didn't have to make any code changes to support Winamp 5. The Winamp5 parent window class name remains "Winamp 1.x" -- for third-party compatibilty, apparently.
- Stealth
Author of StealthBot