Old 20th May 2010, 20:08   #1
Roob
Member
 
Roob's Avatar
 
Join Date: Jun 2009
Posts: 85
How to update a song rating WHILE it is playing?

Hi there,

I am trying to use a micro-controller to update a song's rating, I have scripted a plugin that listens to the COM port for a certain character (and when it sees that character it will run IPC_SETRATING and have scripted my micro-controller to send that character when i press a button.

It works perfectly except the new rating is only reflected in Winamp when I STOP and START the song OVER

How can I make it so that the change is instant?

Thanks,
Mike
Roob is offline   Reply With Quote
Old 20th May 2010, 20:46   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
there isn't really much you can do as it requires changes in multiple parts of the player to get the rating change to be updated.

-daz
DrO is offline   Reply With Quote
Old 20th May 2010, 21:59   #3
Roob
Member
 
Roob's Avatar
 
Join Date: Jun 2009
Posts: 85
Quote:
Originally Posted by DrO View Post
there isn't really much you can do as it requires changes in multiple parts of the player to get the rating change to be updated.

-daz
well is there a way i can stop the song and start it again at the same position i stopped it at in my plugin code right after i set the rating so that it updates???

there must be a way!! because when i click the stars with my mouse it updates it right away so why not through serial!?
Roob is offline   Reply With Quote
Old 20th May 2010, 22:08   #4
Roob
Member
 
Roob's Avatar
 
Join Date: Jun 2009
Posts: 85
i did it!

code:

void setRating(int rating)
{
SendMessage(plugin.hwndParent,WM_WA_IPC,rating,IPC_SETRATING);
int ms = SendMessage(plugin.hwndParent,WM_WA_IPC,0,IPC_GETOUTPUTTIME);
SendMessage(plugin.hwndParent, WM_COMMAND,WINAMP_STOP,0);
SendMessage(plugin.hwndParent, WM_COMMAND,WINAMP_PLAY,0);
SendMessage(plugin.hwndParent,WM_WA_IPC,ms,IPC_JUMPTOTIME);
}


Roob is offline   Reply With Quote
Old 20th May 2010, 23:11   #5
DrO
 
Join Date: Sep 2003
Posts: 27,873
i've got to say that's just evil doing that. it also will cause a re-triggering of starting events which under a modern skin will restart the notifier if enabled and i know for certain it'd break a number of other external plug-ins. i would reject a plug-in doing something like that if it was submitted to the site.

Quote:
because when i click the stars with my mouse it updates it right away so why not through serial!?
because the player doesn't send out a notification so some parts if they're sending a rating change know they need to update (like the mouse click example) but if done from something else (your plug-in) then that same control which worked via the mouse-click will not know about it and so will display the previous rating value.

it really needs to be resolved in Winamp itself so the UI cannot be updated as required. it was briefly attempted to be fixed in 5.5 but the fix then caused more issues than it was worth and was removed in 5.51 from what i remember.

-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