예제 #1
0
파일: Winamp.cs 프로젝트: MrSm1th/lastfm
 void OnSongRepeated(TrackInfoEventArgs e)
 {
     if (SongRepeated != null)
         SongRepeated(this, e);
 }
예제 #2
0
파일: Plugin.cs 프로젝트: MrSm1th/lastfm
 void Winamp_SongRepeated(object sender, TrackInfoEventArgs e)
 {
     //scrobbler.SetCurrentTrack(new Track(e.Song));
     //var msg = string.Format("Repeat:\r\n{0} - {1}", e.Song.Artist, e.Song.Title);
     var msg = "Repeat? " + e.Track.ToString();
     MessageBox.Show(msg, "Winamp Last.fm scrobbler");
 }
예제 #3
0
파일: Winamp.cs 프로젝트: MrSm1th/lastfm
 void OnSongChanged(TrackInfoEventArgs e)
 {
     if (SongChanged != null)
         SongChanged(this, e);
 }
예제 #4
0
파일: Plugin.cs 프로젝트: MrSm1th/lastfm
        void Winamp_SongChanged(object sender, TrackInfoEventArgs e)
        {
            Logger.WriteEmptyLine();
            Logger.LogMessage("Track changed");

            //if (Winamp.Status != Status.Playing) return;

            if (!e.Track.HasMetadata)
            {
                Logger.LogMessage("No metadata available for playlist entry: " + e.Track);
                return;
            }

            var track = e.Track;
            //MessageBox.Show(string.Format("Current track: {0} [{1:m':'ss}]", track, track.NaturalDuration));

            if (track.Duration <= 0)
            {
                Track.GetInfoAsync(e.Track.Artist, e.Track.Title, true, (t) =>
                {
                    t.Filename = track.Filename;
                    track = t;
                    //t.IsChosenByUser = false;
                    LogTrackInfo(track);
                    if (!(e.Track.IsRadioStream && !scrobblingSettings.ScrobbleRadio))
                    {
                        scrobbler.ResetCurrentTrack(track);
                    }
                });
            }
            else
            {
                LogTrackInfo(track);
                scrobbler.ResetCurrentTrack(track);
            }
        }