void Play(int index) { index %= playQueue.Count(); Tune tune = playQueue[index]; if (tune != null && tune != playing) { player.Load(tune.Path); tune.Duration = player.Duration; playing = tune; } playlist.SelectedIndices.Clear(); playlist.SelectedIndices.Add(index); player.PlayOrPause(); RefreshStatus(); }
private void Import(FileInfo file) { var m = validator.Match(file.Name); if (m.Success) { var tune = new Tune(file.FullName); if (Tunes.Contains(tune)) { var match = Tunes.First(t => t.Equals(tune)); match.Merge(tune); } else { Tunes.Add(tune); } } }