Old 20th November 2007, 05:09   #1
gonemad
Member
 
Join Date: May 2006
Posts: 52
track skipping problem

Alright firstly I used to use an activewinamp script to do this.. but it seems with the latest version it stopped working.

The idea is to skip over songs with ratings less than 4 stars.. pretty simple

since my script wasnt working anymore i decided to write an actual plugin.. but still run into the exact same problem as the script... the playlist will skip over any songs below 4.. but winamp will continue to play the song that was supposed to be skipped over

here is the main part of my code

code:

#define WA_NEXT 40048
#define WA_PLAY 40045
#define WA_STOP 40047


if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
{
int rating = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
if (rating < 4 && rating > 0)
{
int shuffle = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);

if (shuffle)
{
SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WA_NEXT,0),0);
}
else
{
int position = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
int playlistlength = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);

do
{
position++;
SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS);
rating = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
}
while(rating < 4 && rating > 0 && position < playlistlength);

if (rating >= 4 || rating <= 0)
{
//play new song
SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WA_STOP,0),0);
SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WA_PLAY,0),0);
//SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_STARTPLAY);
}
else
{
//stop because we are at hte end of the playlist
SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WA_STOP,0),0);
}
}

}
}



is this some sort of bug or something?
gonemad 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