Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1048
  • Last Modified:

Add songs at winamp

How can I add a mp3 from a delphi program in the winamp3-list.

I use this code to play the first song:
song:='c:\...anysong...mp3';
ShellExecute(Handle, 'open',PChar(song),nil,nil,SW_SHOWNORMAL);

When I add the next song, it has to take place in the queue of winamp. Now, the first song stops playing and the second begins.
0
misterstefano
Asked:
misterstefano
  • 2
1 Solution
 
MannSoftCommented:
There are a couple ways.  

First, you can use the above method.  To find out how Winamp queue's files you need to open up the "File Types" dialog (View Menu -> Folder Options -> File Types while in Windows Explorer) and find the entry for .MP3.  When you find it, check to see what commandline parameters are used for the Enque action.  The drawback here is you'll need to know the full path\filename of the winamp.exe file, you wont just be able to specify the mp3 file in the shellexecute() command.

Second (and the method I would probably use) would be to use the Winamp API.  It's documented quite well on the winamp webpage.  If you dont understand it, you can probably find a wrapper component that handles all the tough work at www.torry.net
0
 
misterstefanoAuthor Commented:
I used the first methode, this works.
For the 2th methode, you have to download a new component for delphi?
0
 
MannSoftCommented:
No you dont have to download a component for the second method.  It would just be a lot easier than reading their documentation and writing your own implementation.

The docs for Winamp 2 can be found at http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now