Old 13th July 2010, 23:56   #1
Newbob
Junior Member
 
Join Date: Jul 2010
Posts: 2
Event on track change?

Hi,

as for now I'm having a endless-loop inside a thread I create when my PlugIn has been loaded and check every 250ms (due to cpu usage) if the track has changed somehow to then start the event. I wonder if there's a better approach (one without that 250ms delay) to do something on track change. If so, please tell me.

Thanks
Newbob is offline   Reply With Quote
Old 15th July 2010, 19:14   #2
Newbob
Junior Member
 
Join Date: Jul 2010
Posts: 2
Help plzzzz
Newbob is offline   Reply With Quote
Old 16th July 2010, 08:20   #3
cheezewizz
Junior Member
 
Join Date: Jul 2010
Posts: 1
use the callback messages which are sent on status change instead. for example
code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if((lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS))
{
int status = SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_ISPLAYING);
switch(status)
{
case 0:
//not playing
break;
case 1:
//playing
break;
case 3:
//paused
break;
}
}
int ret = CallWindowProc(lpWndProcOld, hwnd, message, wParam, lParam);
return ret;
}


the playing one will be sent whenever you hit play/next track etc...
cheezewizz is offline   Reply With Quote
Old 23rd July 2010, 15:11   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
IPC_PLAYING_FILE(W) is much better as that doesn't have the ambiguity which IPC_CB_MISC causes in such situations.

-daz
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast 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