Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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);
 }