Beispiel #1
0
        void UpdateCurrentSong(object sender, MetadataEventArgs args)
        {
            const string metadataSongPattern = @"StreamTitle='(?<artist>.+?) - (?<title>.+?)';";
            Match        match = Regex.Match(args.NewMetadata, metadataSongPattern);

            if (match.Success)
            {
                CurrentSong = new SongInfo(match.Groups["artist"].Value, match.Groups["title"].Value);
            }
        }
Beispiel #2
0
 void UpdateCurrentSong(object sender, MetadataEventArgs args)
 {
     foreach (var metadataSongPattern in metadataSongPatterns)
     {
         Match match = Regex.Match(args.NewMetadata, metadataSongPattern);
         if (match.Success)
         {
             CurrentSong = new SongInfo(match.Groups["artist"].Value.Trim(), match.Groups["title"].Value.Trim());
             return;
         }
     }
 }
Beispiel #3
0
 void UpdateCurrentSong(object sender, MetadataEventArgs args)
 {
     foreach (var metadataSongPattern in metadataSongPatterns)
     {
         Match match = Regex.Match(args.NewMetadata, metadataSongPattern);
         if (match.Success)
         {
             string artist = match.Groups["artist"].Value.Trim();
             string title  = match.Groups["title"].Value.Trim();
             if (ArtistTitleOrderInverted)
             {
                 CurrentSong = new SongInfo(title, artist);
             }
             else
             {
                 CurrentSong = new SongInfo(artist, title);
             }
             return;
         }
     }
 }
Beispiel #4
0
 void UpdateCurrentSong(object sender, MetadataEventArgs args)
 {
     const string metadataSongPattern = @"StreamTitle='(?<artist>.+) - (?<title>.+)';";
     Match match = Regex.Match(args.NewMetadata, metadataSongPattern);
     if (!match.Success)
         CurrentSong = null;
     else
         CurrentSong = new SongInfo(match.Groups["artist"].Value, match.Groups["title"].Value);
 }