コード例 #1
0
        private async void ListBox_Click(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox listBox = sender as ListBox;

            ProgressBar_Loading.Visibility = Visibility.Visible;
            long id = (listBox.SelectedItem as RecordDataItem).Song.Id;
            // MusicDetailRoot musicDetailRoot=await Task.Run(()=>SongService.GetMusicDetail_Get(id.ToString()));
            //if (musicDetailRoot == null || musicDetailRoot.songs == null)
            //{
            //    ProgressBar_Loading.Visibility = Visibility.Collapsed;
            //    return;
            //}
            //SongUrlRoot songUrlRoot = await Task.Run(() => SongService.GetMusicUrl(musicDetailRoot.songs.First().Id));
            //if (songUrlRoot == null)
            //{
            //    ProgressBar_Loading.Visibility = Visibility.Collapsed;
            //    return;
            //}
            //ProgressBar_Loading.Visibility = Visibility.Collapsed;
            ////修改播放列表
            //(Application.Current as App).myMainPage.currentPlayList.Clear();
            //(Application.Current as App).myMainPage.currentPlayList.Add(musicDetailRoot.songs.First());
            ////修改mainpage以触发修改正在播放的音乐
            //(Application.Current as App).myMainPage.ChnagePlayingSong(musicDetailRoot.songs.First(), songUrlRoot, (musicDetailRoot.songs.First().Id + 4) * -1);
            await PlayingService.ChangePlayingSong(id, null);

            ProgressBar_Loading.Visibility = Visibility.Collapsed;
        }
コード例 #2
0
        /// <summary>
        /// 双击我喜欢的歌曲
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ListBox_myFavoriteSongs_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = (ListBox)sender;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            if (songsItem == null)
            {
                return;
            }
            //SongUrlRoot songUrlRoot = SongService.GetMusicUrl(songsItem.Id);
            //if (songUrlRoot == null)
            //    return;
            ////添加播放列表
            //if (ListBox_myFavoriteSongs.ItemsSource == null)
            //    return;
            //if (MainPage.PlayingListId != 2)//已在播放此歌单,仅修改播放歌曲,否则,重置播放列表及历史记录
            //{
            //    (Application.Current as App).myMainPage.currentPlayList.Clear();
            //    foreach (var temp in ListBox_myFavoriteSongs.ItemsSource as List<SongsItem>)
            //        (Application.Current as App).myMainPage.currentPlayList.Add(temp);
            //    (Application.Current as App).myMainPage.playHistoryIndex.Clear();
            //    //MainPage.PlayingListId = 2;
            //}
            ////修改mainpage以触发修改正在播放的音乐
            //(Application.Current as App).myMainPage.ChnagePlayingSong(songsItem, songUrlRoot,-2);
            PlayingService.PlayingListId = songsItem.al.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, ListBox_myFavoriteSongs.ItemsSource as List <SongsItem>, songsItem);
        }
コード例 #3
0
        private async void ListBox_musicDetail_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = sender as ListBox;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            if (songsItem == null)
            {
                return;
            }
            //SongUrlRoot songUrlRoot = SongService.GetMusicUrl(songsItem.Id);
            //if (songUrlRoot == null)
            //    return;

            ////修改播放列表
            //if (MainPage.PlayingListId != albumRoot.album.id)//已在播放此歌单,仅修改播放歌曲,否则,重置播放列表及历史记录
            //{
            //    (Application.Current as App).myMainPage.currentPlayList.Clear();
            //    foreach (var temp in albumRoot.songs)
            //        (Application.Current as App).myMainPage.currentPlayList.Add(temp);
            //    (Application.Current as App).myMainPage.playHistoryIndex.Clear();
            //    //MainPage.PlayingListId = albumRoot.album.id;
            //}
            ////修改mainpage以触发修改正在播放的音乐
            //(Application.Current as App).myMainPage.ChnagePlayingSong(songsItem, songUrlRoot, albumRoot.album.id);
            PlayingService.PlayingListId = albumRoot.album.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, albumRoot.songs, songsItem);
        }
コード例 #4
0
ファイル: PlayListDetai.xaml.cs プロジェクト: qedsd/MyNCMusic
        /// <summary>
        /// 双击某一首歌
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ListBox_musicDetail_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = sender as ListBox;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            PlayingService.PlayingListId = playListDetailRoot.playlist.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, musicDetailRootSource.songs, songsItem);
        }
コード例 #5
0
        /// <summary>
        /// 播放全部日推歌曲
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Button_playDailySongs_Click(object sender, RoutedEventArgs e)
        {
            if (ListBox_recommendMusic.ItemsSource == null)
            {
                return;
            }
            var songs = ListBox_recommendMusic.ItemsSource as List <SongsItem>;

            PlayingService.PlayingListId = songs.First().al.id;
            await PlayingService.ChangePlayingSong(songs.First().Id, songs, songs.First());
        }
コード例 #6
0
        private async void ListBox_simiSongs_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = sender as ListBox;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            if (songsItem == null)
            {
                return;
            }
            ProgressBar_loadSimiSongs.Visibility = Visibility.Visible;
            PlayingService.PlayingListId         = songsItem.al.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, ListBox_simiSongs.ItemsSource as List <SongsItem>, songsItem);
        }
コード例 #7
0
        private async void ListBox_searchSong_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = (ListBox)sender;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            if (songsItem == null)
            {
                return;
            }

            PlayingService.PlayingListId = songsItem.al.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, ListBox_searchSong.ItemsSource as List <SongsItem>, songsItem);
        }
コード例 #8
0
        private async void ListBox_hotSongs_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox   listBox   = sender as ListBox;
            SongsItem songsItem = listBox.SelectedItem as SongsItem;

            if (songsItem == null)
            {
                return;
            }

            PlayingService.PlayingListId = songsItem.al.id;
            await PlayingService.ChangePlayingSong(songsItem.Id, artistBaseDetailRoot.hotSongs, songsItem);
        }
コード例 #9
0
        /// <summary>
        /// 播放列表双击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ListBox_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            ListBox listBox            = (ListBox)sender;
            PlayingSongBaseObject song = listBox.SelectedItem as PlayingSongBaseObject;

            if (PlayingService.IsPlayingSong)
            {
                await PlayingService.ChangePlayingSong(song.Id);
            }
            else
            {
                await PlayingService.ChangePlayingRadio(song.Id);
            }
        }
コード例 #10
0
        /// <summary>
        /// 播放全部我喜欢的歌曲
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Button_playFavoriteSongs_Click(object sender, RoutedEventArgs e)
        {
            if (ListBox_myFavoriteSongs.ItemsSource == null)
            {
                return;
            }
            //(Application.Current as App).myMainPage.currentPlayList.Clear();
            //foreach (var temp in ListBox_myFavoriteSongs.ItemsSource as List<SongsItem>)
            //    (Application.Current as App).myMainPage.currentPlayList.Add(temp);
            //(Application.Current as App).myMainPage.playHistoryIndex.Clear();
            //MainPage.PlayingListId = 2;
            //(Application.Current as App).myMainPage.PlayNextSongs(-1);

            var songs = ListBox_myFavoriteSongs.ItemsSource as List <SongsItem>;

            PlayingService.PlayingListId = songs.First().al.id;
            await PlayingService.ChangePlayingSong(songs.First().Id, songs, songs.First());
        }
コード例 #11
0
 private async void Button_playAll_Click(object sender, RoutedEventArgs e)
 {
     PlayingService.PlayingListId = albumRoot.album.id;
     await PlayingService.ChangePlayingSong(albumRoot.songs.First().Id, albumRoot.songs);
 }
コード例 #12
0
 private async void Button_allSongs_Click(object sender, RoutedEventArgs e)
 {
     PlayingService.PlayingListId = artistBaseDetailRoot.hotSongs.First().al.id;
     await PlayingService.ChangePlayingSong(artistBaseDetailRoot.hotSongs.First().Id, artistBaseDetailRoot.hotSongs, artistBaseDetailRoot.hotSongs.First());
 }
コード例 #13
0
ファイル: PlayListDetai.xaml.cs プロジェクト: qedsd/MyNCMusic
 /// <summary>
 /// 播放全部
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void Button_playAll_Click(object sender, RoutedEventArgs e)
 {
     PlayingService.PlayingListId = playListDetailRoot.playlist.id;
     await PlayingService.ChangePlayingSong(musicDetailRootSource.songs.First().Id, musicDetailRootSource.songs, musicDetailRootSource.songs.First());
 }