public async void deleteMusicLibFolder(LibFolder folder) { if (await musicLib.RequestRemoveFolderAsync(folder.StorageFolder)) { LibFolders.Remove(folder); MusicItems.Clear(); } }
/// <summary> /// Registers the music. /// </summary> public void RegisterMusic(MusicItems item) { // TODO: get the index of sound. var indexMusic = (int)item.musicIndex; // TODO: check the exists. if (!musicLibrary.ContainsKey(indexMusic)) { // TODO: remove the index. musicLibrary.Add(indexMusic, item.music); } }
protected void UpdateMusicItemsViews(bool sortRequired = false) { OnPropertyChanged("IsEmptyAndLoading"); OnPropertyChanged("ShowHelp"); if (sortRequired) { MusicItems = new ObservableCollection <MusicItem>(MusicItems.OrderBy(SortKey)); //Debug.WriteLine("Items: " + MusicItems.Count); } else { UpdateMusicItemsList(); } }
/// <summary> /// Removes the music. /// </summary> public void RemoveMusic(MusicItems item) { // TODO: Check null. if (!object.ReferenceEquals(MusicPlayer, null)) { // TODO: Check the current play. if (MusicPlayer.isPlaying && MusicPlayer.clip.name == item.music.name) { // TODO: Stop the current music is playing. StopMusic(); } } // TODO: get the index of music. var indexMusic = (int)item.musicIndex; // TODO: check the exists. if (musicLibrary.ContainsKey(indexMusic)) { // TODO: remove the index. musicLibrary.Remove(indexMusic); } }
public MusicItem GetItem(string relativePath) { return(MusicItems.FirstOrDefault(i => i.Path == relativePath)); }