View Single Post
Old 4th January 2008, 19:13   #1
gonemad
Member
 
Join Date: May 2006
Posts: 52
Track skipping problem

I posted this a month or 2 ago in the development forum but never got any responses

the basic bug as i see it is if you change the playlist position (IPC_SETPLAYLISTPOS) then call play (40045), or even stop (40047) and then play immediately after.... the new song selected in the playlist never gets played, it just continues playing the current track

original post:

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:
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