Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 8th June 2008, 14:13   #1
Dido_net
Junior Member
 
Join Date: Jun 2008
Posts: 3
detect changing track in winamp

Hello everyone, I'm writing a program in C# which will get the current filename of the track and read the ID3 tags from it.
For now the ID3 reader is done, but how to get the filename of track played in winamp? And can I detect changing the tracks, like event or something?

Thanks.
Dido_net is offline   Reply With Quote
Old 19th June 2008, 21:05   #2
zoranlazarevic
Junior Member
 
Join Date: Sep 2004
Posts: 11
Create a general plugin, in the init() install your own window proc
code:

lpWndProcOld = GetWindowLong(plugin.hwndParent, GWL_WNDPROC);
SetWindowLong(plugin.hwndParent,GWL_WNDPROC, (LONG)WndProc);



Then listen for WM_WA_IPC message with lParam=IPC_PLAYING_FILE:

code:

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{

case WM_WA_IPC:

switch( lParam )
{
case IPC_PLAYING_FILE:
//new track, playback started
// the track filename is in wParam
your_object->playing_file(reinterpret_cast<const char *>(wParam) );
break;
}

}

#pragma warning(push)
#pragma warning(disable:4312)
return CallWindowProc( (WNDPROC)lpWndProcOld, hwnd, message, wParam, lParam);
#pragma warning(pop)
}

zoranlazarevic 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