Beispiel #1
0
        public void GetID3Tags(Song song)
        {
            TagLib.File file = TagLib.File.Create(song.Path);

            if (file == null)
            {
                return;
            }

            song.Title = file.Tag.Title;

            song.Artist = file.Tag.FirstAlbumArtist ?? file.Tag.FirstPerformer ?? "Unknown";
            song.Album = file.Tag.Album;
            song.Disc = (int)file.Tag.Disc;
            song.Track = (int)file.Tag.Track;
            song.Depth = file.Properties.BitsPerSample;
            song.Bitrate = file.Properties.AudioBitrate;
            song.SampleRate = (double)file.Properties.AudioSampleRate / 1000.0;
        }
Beispiel #2
0
 private void PlayOnDemand(Song song)
 {
     Player.Play(song.Path);
     CurrentSongIndex = 0;
     GetSongDuration();
     UpdateCurrentSong(song);
     AddSongsToQueue();
     RaisePropertyChanged(nameof(IsPlaying));
 }
Beispiel #3
0
 private void UpdateCurrentSong(Song song)
 {
     if (!String.IsNullOrEmpty(song.Path))
     {
         CurrentPlayingSong = song;
         CurrentPlayingSongCoverArt = Albums.Where(x => x.Title == CurrentPlayingSong.Album).FirstOrDefault().CoverArt;
     }
 }
Beispiel #4
0
 public void GetID3Tags(Song path)
 {
     //throw new NotImplementedException();
 }