View Full Version : PlayList
7th March 2002, 13:04
I'm making a system that use WinAmp.
In this system I manage play a file and add ti playlist a file.
To play, I use:
Shell "C:\Winamp\winamp.exe c:\mp3\track01.mp3"
Shell "C:\Winamp\winamp.exe /ADD c:\mp3\track05.mp3"
But if I've tracks in playlist and I want to jump to one tracks, I don't know how to do this.
The PlayList has 10 tracks
The tracks that is playing in the first
I want to jump to the fifth tracks.
How I do this???
7th March 2002, 21:05
I'm going out on a limb, seeing as I lack the knowledge of many other languages, but that looks like a vb command, soze, here goes:
use the API function in Winamp to set the CurrentPlaylistPosition to the Index, starting with 0, of the position you want. Then use the API function for playing to tell Winamp to Play the current song. If you really, really, cant figure that out, I will dig up some source, of course, if your not on VB, then I cant help you anyway :P
7th March 2002, 21:53
I'm using VB, but I'm not use API for WinAmp!!!!?????:confused:
7th March 2002, 22:42
I'll dig you up some code, hold a bit
7th March 2002, 23:07
here ya go:
---Put these Public Declarations in your General Declarations Section of a Module, they CAN NOT go in the gen declare section of a form
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public hWndWinAMP As Long
---Then run this command in the beginning of your program to find to find the winamp window, you need to do this so you can use this parameter in the SendMessage function, you probably should put this in Form_Load seeing as it needs to be called right away and it barely takes a cpu tick to do it anyway
hWndWinAMP = FindWindow("Winamp v1.x", vbNullString)
---This command will set winamp's playlist position to the INDEX number you desire, remember this starts at 0, so song 3 in the list will have an INDEX of 2...this command will obviously go wherever you need it, this one and the following one
SendMessage hwndwinAMP, WM_USER, INDEX, 121
--Next we must tell winamp to play our newly selected track
SendMessage hwndwinAMP, WM_USER, 0, 102
8th March 2002, 00:54
Ok, I'll try your code.
Very thanks one more time!
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.