Steven, I believe
PluginNotifyType.RatingChanging is still not working properly (MB 2.0.4663).
It seemed most of the time not working and very randomly working. To help you discover what's wrong, I traced it a bit.
Here are the results of what a serie that I think could be reproducible. Notice that only the first rating changing of the serie did it right! All the others tell the future rating:
For the record, in all the changing of ratings below, I always did it via key shortcut.
1 .restart MB, playing song, changng rating from "no rating" -> 1:
RatingChanging - Rating: norating
RatingChanged - Rating: 1
2. While still playing same song, 1->2:
RatingChanging - Rating: 2
RatingChanged - Rating: 2
3. Playing another song, switching back to above song, 2->1:
RatingChanging - Rating: 1
RatingChanged - Rating: 1
4. Playing a never played song (since MB started), no rating->1:
RatingChanging - Rating: 1
RatingChanged - Rating: 1
(I tried other ways with failed results, though different series)
public void ReceiveNotification(string sourceFileUrl, NotificationType type)
{
string debug = "", rating ="";
// perform some action depending on the notification type
rating = mbAPI.Library_GetFileTag(sourceFileUrl, MetaDataType.Rating);
rating = rating=="0,0"?"0":rating==""?"norating":rating;
switch (type)
{
case NotificationType.PluginStartup:
// perform startup initialisation
myPlay(about.Name+" launched");
break;
case NotificationType.TagsChanging:
debug = " - Rating: " + rating;
myPlay("tagschanging");
break;
case NotificationType.RatingChanging:
debug = " - Rating: " + rating;
//myPlay("ratingchanging");
break;
case NotificationType.RatingChanged:
debug = " - Rating: " + rating;
myPlay("ratingchangedfrom");
myPlay("2"); //function not as the numbern but the word, "to" :-)
myPlay(rating);
break;
case NotificationType.TagsChanged:
//debug = " - Rating: " + rating;
myPlay("changessaved");
break;
}
if (debug!="") Out(type + debug); //debug
}