Beispiel #1
0
        // Process
        void PlaySong()
        {
            if (List_NowPlaying.Count() == 0)
            {
                return;
            }
            if (Current_NowPlaying < 0 || Current_NowPlaying > List_NowPlaying.Count - 1)
            {
                return;
            }
            Init_Songs(List_NowPlaying[Current_NowPlaying]);
            DTimer.Start();

            DTO_Class.CopySong(List_NowPlaying[Current_NowPlaying]);
            Lyric = List_NowPlaying[Current_NowPlaying].Lyric;

            if (List_NowPlaying[Current_NowPlaying].Stream != null)
            {
                FrameworkDispatcher.Update();
                MediaPlayer.Stop();
                Bool_Play = false;

                BackgroundAudioPlayer.Instance.Track = List_NowPlaying[Current_NowPlaying].Offline_Track;
                BackgroundAudioPlayer.Instance.Play();
            }
            else
            {
                FrameworkDispatcher.Update();
                BackgroundAudioPlayer.Instance.Close();
                Bool_Play = true;
                MediaPlayer.Play(List_NowPlaying[Current_NowPlaying].OfflineSong);
            }
        }
 void Remove_Song_NowPlaying(int index)
 {
     try
     {
         List_NowPlaying.RemoveAt(index);
     }
     catch { }
 }
 int Add_Song_NowPlaying(MySong Item)
 {
     try
     {
         int index;
         if (Item.Stream == null)
         {
             index = Cheack_List_OffNowPlaying(Item);
             if (index == -1)
             {
                 MySong temp = new MySong(Item);
                 List_NowPlaying.Add(temp);
                 return(List_NowPlaying.Count - 1);
             }
             else
             {
                 return(index);
             }
         }
         else
         {
             index = Cheack_List_OnNowPlaying(Item);
             if (index == -1)
             {
                 MySong temp = new MySong(Item);
                 List_NowPlaying.Add(temp);
                 return(List_NowPlaying.Count - 1);
             }
             else
             {
                 if (Item.Path != null)
                 {
                     List_NowPlaying[index].Path = Item.Path;
                     List_NowPlaying[index].Update_Offline_Track();
                 }
                 return(index);
             }
         }
     }
     catch { return(-2); }
 }
Beispiel #4
0
 void Remove_Song_NowPlaying(int index)
 {
     List_NowPlaying.RemoveAt(index);
 }
Beispiel #5
0
        void Add_Song_NowPlaying(MySong Item)
        {
            MySong temp = new MySong(Item);

            List_NowPlaying.Add(temp);
        }