|
|
#1 |
|
Bastificator [Alumni]
Join Date: May 2000
Location: #nullsoft
Posts: 1,260
|
Unpublished API's
After a little natter with Tag about SHOUTcast he clued me into a few unpublished winamp API's that may be handy for you all:
code: These are all sent to the playlist window not the main window. "Beer?" |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Feb 2002
Posts: 7
|
Thanks a lot for posting this, man!! Not needed by me, though.
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2000
Location: Oslo, Norway
Posts: 108
|
This looks nice, but what do they do and how to you send them? What parameters do they take, what do they return, etc..?
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
*licks his lips* time to go to work
|
|
|
|
|
|
#5 |
|
Bastificator [Alumni]
Join Date: May 2000
Location: #nullsoft
Posts: 1,260
|
#define IPC_PE_GETCURINDEX 100
Should be obvious, get position of current track in playlist. Returns an int. #define IPC_PE_DELETEINDEX 104 Remove specified track from list (takes int) #define IPC_PE_SWAPINDEX 105 Swap two files in order on playlist #define IPC_PE_INSERTFILENAME 106 Add a track. These two are very interesting. #define IPC_PE_GETDIRTY 107 #define IPC_PE_SETCLEAN 108 SETCLEAN sets the playlist as clean. If get dirty returns a 1 (I think) then the list has been edited by another process since you last setclean. It's a dirty read thing... I have more info at home, I'll post it when I get a chance. Should be simple to figure them out tho... "Beer?" |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2002
Posts: 2
|
Thanks for the APIs, but I'm having problems how to use them.. Using the following code to insert a playlistitem:
char szTmp[64]; HWND PEWnd = FindWindow("Winamp PE",NULL); strcpy(szTmp, "C:\\mp3\\test.mp3"); SendMessage(PEWnd,WM_USER,(LPARAM)szTmp,106); Is this wrong? Seems to be that because it doesn't work for me.. How do you use IPC_PE_DELETEINDEX? Can you just do the following: int nIndex = 1; SendMessage(WAWnd,WM_USER,nIndex,104); Thanks in advance! |
|
|
|
|
|
#7 |
|
Bastificator [Alumni]
Join Date: May 2000
Location: #nullsoft
Posts: 1,260
|
All I have...
code: And if that doesn't do it for you, then I don't know what will... "Beer?" |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Apr 2002
Posts: 2
|
Works great.. thanks a lot!!!
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jun 2001
Location: Yeovil, Somerset, UK
Posts: 23
|
I see... what I got wrong was the message format difference between this and the normal winamp API messages...
SendMessage(hwnd,WM_USER,data,command) - Winamp main window SendMessage(hwnd,WM_USER,command,data) - Playlist window It works now, ta... Phil, just me |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jul 2002
Posts: 1
|
VB Version?
Does anyone have a Visual Basic version of the code to insert a file into the playlist? I want to be able to insert a file at a particular location within the current playlist. Can this be done?
Thanks. |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Jul 2002
Posts: 4
|
Swap index?
Does anyone know how to use IPC_PE_SWAPINDEX? I have a method, but it's not the best IMO. It works by switching the passed index with 0, so I figure I can just do it like this to swap two specific ones.
code: |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Mar 2001
Posts: 3
|
I want to translate it to Delphi ;-)
But there must be a problem with the pointer... Is there anybody who could help..... ?? procedure InsertMp3ToPlayList(iAfterTrack : Integer; mp3ToAdd:string); Type TFileInfo = record FileName : String; Index : Integer; end; Var cds : CopyDataStruct; f : TFileInfo; begin Mp3ToAdd:=(MP3ToAdd+#0); f.FileName := Mp3ToAdd; f.Index := iAfterTrack; cds.dwData := 106; //int for IPC_PE_INSERTFILENAME cds.lpData := @f; cds.cbData := SizeOf(TFileInfo); GethWnd_WinAmpPL; SendMessage(hwnd_WinampPL, WM_COPYDATA, 0, LParam(@cds)); end; |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Jul 2002
Posts: 10
|
insert file into playlist
I found a solution to load mp3-file into a playlist with C#
If anybody needs this, just search the forum for "C# COPYDATA". It appears under one of the first given search result postings (something with VB COPYDATA or so). Greets, Barney. |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Jun 2002
Posts: 6
|
To Gabi Slonto :
You could try this Type TFileInfo = packed record FileName : Array[0..MAX_PATH-1] of Char; Index : Integer; end; Var cds : CopyDataStruct; f : TFileInfo; begin StrLCopy(f.FileName, PChar(Mp3ToAdd), SizeOf(f.FileName)); f.Index := iAfterTrack; cds.dwData := 106; //int for IPC_PE_INSERTFILENAME cds.cbData := SizeOf(f); cds.lpData := @f; GethWnd_WinAmpPL; SendMessage(hwnd_WinampPL, WM_COPYDATA, 0, LParam(@cds)); end; It works for me : Delphi6, Winamp 2.8 Last edited by shrom; 24th July 2002 at 01:59. |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jun 2000
Location: Manchester, UK
Posts: 106
|
Anyone noticed that this code doesn't work when the Playlist in is Winshade mode? It works when the playlist is full size or even when the playlist is 'closed' but not when in winshade mode.
Anyone have a fix for this? |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Oct 2002
Location: In front of my computer. Yes, I know it says, "Where you _live_."
Posts: 2
|
I'm finding it to be worse than that: I get crashes when I winshade the playlist after deleting an song. It doesn't seem to matter how much time expires between the deletion and the winshading; as soon as that winshade button's clicked, Winamp goes down.
I would've like to be able to delete stuff, too. This is probably why they're unpublished... |
|
|
|
|
|
#17 |
|
Senior Member
Join Date: Jun 2000
Location: Manchester, UK
Posts: 106
|
Well, that's the end of my Winamp 2 development I think. Winamp3 all the way from now on.
|
|
|
|
|
|
#18 |
|
Junior Member
Join Date: Dec 2002
Posts: 9
|
Playlist Position
Hey there
Does anyone know how choose where the new file goes in the playlist? Pref in vb (not to good at c) Thanks |
|
|
|
|
|
#19 |
|
Senior Member
|
When I delete something in the playlist from my program and then windowshade I don't have any problems accept a few miliseconds audio lag.
|
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Oct 2002
Location: In front of my computer. Yes, I know it says, "Where you _live_."
Posts: 2
|
And, for some reason, neither do I now. I wish I still had the old code I was using so I could see what I'm doing differently now. This is really weird.
While you're at it, could you say that your code is really well-organized and works the first time you compile it?
|
|
|
|
|
|
#21 |
|
Senior Member
|
Yes my code is nice and clean (includes spacing and indents)
No it didn't work the first time because I forgot to define the constants. |
|
|
|
|
|
#22 |
|
Junior Member
Join Date: Feb 2001
Posts: 5
|
VB Solution for playlist relocation
Aha! Victory! I got it all working in VB now, but there are some things i still don't understand, even though i got them working using trial and error. Does anyone know why the callback construction does not work? i found a nice workaround for it... And does anyone know why the length of the fileinfo struct can not be
byte(255) + long --> 256+4 = 260 bytes but must be byte(259) + long --> 260+4 = 264 ??? i hope you can enlighten me on this... okay, enough questions now; let's see the code: code: (paste & play: paste it in a module, and call the insertsong & movesong functions te have it work) Please let me know if you think the code is usefull! |
|
|
|
|
|
#23 |
|
Junior Member
Join Date: Jun 2003
Posts: 8
|
The VB code doesn't seem to add songs in at all.... even though it's supposed to... any idea why? I copied and pasted fairly precisely....
|
|
|
|
|
|
#24 |
|
Junior Member
Join Date: Feb 2001
Posts: 5
|
I just tested it again in a clean project, from copying the above, and it really works! I use WA 2.91; maybe you have to up- / downgrade to make it work..
|
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Nov 2003
Location: Cyprus
Posts: 359
|
THEMike
According to the code that you posted the insert file/(s) works perfect as for the folders as well but hte only problem is that when f.index= something then all files of the folder are added to the bottom of the playlist and only the last file of the folder is set to the disired possition.... I would like some help here because i shouldn't have to transfer every file seperatly to the right possition. Also about IPC_PE_SWAPINDEX it will swap the possitions of the indexes in the parenthesis, in the example the 2nd file on the list will become 5th, and the 5th -> 2nd SendMessage(PE_WND,WM_WA_IPC,IPC_PE_SWAPINDEX, MAKELPARAM(1,4)); |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|