Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 13th February 2010, 21:24   #1
Tsuyo
Junior Member
 
Join Date: Dec 2009
Posts: 37
Get Path of playing song?

Hi, How do i get the Path of the Playing song? I mean something like : C:/music/bla.mp3

Greetings
Tsuyo is offline   Reply With Quote
Old 13th February 2010, 21:54   #2
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,464
code:
//this gets the current song (ansi version)
char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,
SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);
//or as a unicode version
wchar_t* file = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,
SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILEW);

or you can just get it when IPC_PLAYING_FILE or IPC_PLAYING_FILEW is sent (see wa_ipc.h for how to get the notification).

-daz
DrO is offline   Reply With Quote
Old 13th February 2010, 22:54   #3
Tsuyo
Junior Member
 
Join Date: Dec 2009
Posts: 37
Hi, Thanks for your Answer.
I tried that:
code:

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
{
// do what you need to do here, e.g.
HWND hWnd = FindWindow(NULL,L"G-Amp");
if (hWnd){
SendMessage(hWnd,WM_songpath,0,wParam);
}
}
return TRUE;
}



But, i get nothing :/
Tsuyo is offline   Reply With Quote
Old 14th February 2010, 08:51   #4
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,464
you can't send a pointer to a string between processes like that. you'd need to use something like a WM_COPYDATA message to transfer between Winamp and your app (as seems to be what you're trying to do - hadn't we already covered this in earlier posts?).

-daz
DrO is offline   Reply With Quote
Old 14th February 2010, 15:14   #5
Tsuyo
Junior Member
 
Join Date: Dec 2009
Posts: 37
Hm, i already fixed it. I used the wrong "Window"
Tsuyo is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump