Some useful info I found in the audioscrobblers sources. I knew about the 666 message, but this explains it a little better. It is relative to the PE window. Credit to Spib from the audioscrobbler plugin for this.
#define WA_STATE_CHANGE 0x0000029A
PEWndproc:
if(message == WM_USER)
{
if(wParam == WA_STATE_CHANGE)
{
int nType = HIWORD(lParam);
int nTrack = LOWORD(lParam);
// Ignore the double issue play message
if(nType != 16384)
return TRUE;
if(SendMessage(m_hWndWinamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1)
{
DWORD dwNow = GetTickCount();
// Winamp Sends two quick song change notifications so
// here we check if the last notification arrived less than
// 400 milliseconds after the last in which case we ignore it.
if((dwNow - m_dwLastPlay) < 400)
{
// Ignore second notifcation
}
else
{
m_dwLastPlay = dwNow;
//Track changed
}
}
}
This is more useful than the 'PLAYING_FILE' IPC, as it also catches track changes within http streams. Be careful though, as it is called multiple times with http streams for the same title, so you need to check that it has actually changed.
I think the 'GetLibraryWndIPC' or whatever it is plus the other library ipc calls should be added in ml.h or somewhere. I have written up a brief summary under 'Unodocmented APIs' [sic].
#define WA_STATE_CHANGE 0x0000029A
PEWndproc:
if(message == WM_USER)
{
if(wParam == WA_STATE_CHANGE)
{
int nType = HIWORD(lParam);
int nTrack = LOWORD(lParam);
// Ignore the double issue play message
if(nType != 16384)
return TRUE;
if(SendMessage(m_hWndWinamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1)
{
DWORD dwNow = GetTickCount();
// Winamp Sends two quick song change notifications so
// here we check if the last notification arrived less than
// 400 milliseconds after the last in which case we ignore it.
if((dwNow - m_dwLastPlay) < 400)
{
// Ignore second notifcation
}
else
{
m_dwLastPlay = dwNow;
//Track changed
}
}
}
This is more useful than the 'PLAYING_FILE' IPC, as it also catches track changes within http streams. Be careful though, as it is called multiple times with http streams for the same title, so you need to check that it has actually changed.
I think the 'GetLibraryWndIPC' or whatever it is plus the other library ipc calls should be added in ml.h or somewhere. I have written up a brief summary under 'Unodocmented APIs' [sic].
Comment