Exemplo n.º 1
0
 public async void deleteMusicLibFolder(LibFolder folder)
 {
     if (await musicLib.RequestRemoveFolderAsync(folder.StorageFolder))
     {
         LibFolders.Remove(folder);
         MusicItems.Clear();
     }
 }
Exemplo n.º 2
0
    /// <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);
        }
    }
Exemplo n.º 3
0
 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();
     }
 }
Exemplo n.º 4
0
    /// <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);
        }
    }
Exemplo n.º 5
0
 public MusicItem GetItem(string relativePath)
 {
     return(MusicItems.FirstOrDefault(i => i.Path == relativePath));
 }