Exemplo n.º 1
0
        private void PlayQueueButton_Click(object sender, RoutedEventArgs e)
        {
            MenuItem    menuItem = (MenuItem)sender;
            DACPElement item     = menuItem.DataContext as DACPElement;

            if (item == null)
            {
                return;
            }

            PlayQueueMode mode;

            switch (menuItem.Name)
            {
            case "PlayNextButton": mode = PlayQueueMode.PlayNext; break;

            case "AddToUpNextButton": mode = PlayQueueMode.AddToQueue; break;

            default: return;
            }

            if (item is Album)
            {
                RemoteUtility.HandleLibraryQueueTask(((Album)item).Play(mode));
                return;
            }

            if (item is Song)
            {
                RemoteUtility.HandleLibraryQueueTask(CurrentGroup.PlaySong((Song)item, mode));
                return;
            }
        }
Exemplo n.º 2
0
        protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
        {
            if (item is Artist)
            {
                if (isPlayButton)
                {
                    RemoteUtility.HandleLibraryPlayTask(((Artist)item).Play());
                }
                else
                {
                    NavigationManager.OpenArtistPage((Artist)item);
                }
                return;
            }

            if (item is Album)
            {
                if (isPlayButton)
                {
                    RemoteUtility.HandleLibraryPlayTask(((Album)item).Play());
                }
                else
                {
                    NavigationManager.OpenAlbumPage((Album)item);
                }
                return;
            }

            if (item is DACPItem)
            {
                RemoteUtility.HandleLibraryPlayTask(CurrentGenre.PlayItem((DACPItem)item));
                return;
            }
        }
Exemplo n.º 3
0
 protected virtual void OnListItemTap(DACPElement item, LongListSelector list, bool isPlayButton)
 {
     if (item is DACPItem)
     {
         RemoteUtility.HandleLibraryPlayTask(((DACPItem)item).Play());
     }
 }
Exemplo n.º 4
0
        private void PlayQueueButton_Click(object sender, RoutedEventArgs e)
        {
            var composer = CurrentComposer;

            if (composer == null)
            {
                return;
            }

            MenuItem    menuItem = (MenuItem)sender;
            DACPElement item     = menuItem.DataContext as DACPElement;

            if (item == null)
            {
                return;
            }

            PlayQueueMode mode;

            switch (menuItem.Name)
            {
            case "PlayNextButton": mode = PlayQueueMode.PlayNext; break;

            case "AddToUpNextButton": mode = PlayQueueMode.AddToQueue; break;

            default: return;
            }

            if (item is DACPItem)
            {
                RemoteUtility.HandleLibraryQueueTask(composer.PlayItem((DACPItem)item, mode));
                return;
            }
        }
 protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
 {
     if (item is iTunesUCourse)
     {
         NavigationManager.OpeniTunesUCourseEpisodesPage((iTunesUCourse)item);
         return;
     }
 }
Exemplo n.º 6
0
 protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
 {
     if (item is Song)
     {
         RemoteUtility.HandleLibraryPlayTask(CurrentGroup.PlaySong((Song)item));
         return;
     }
 }
Exemplo n.º 7
0
 protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
 {
     if (item is TVShow)
     {
         TVShow tvShow = (TVShow)item;
         NavigationManager.OpenTVShowEpisodesPage(tvShow);
         return;
     }
 }
Exemplo n.º 8
0
 protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
 {
     if (item is Podcast)
     {
         Podcast podcast = (Podcast)item;
         NavigationManager.OpenPodcastEpisodesPage(podcast);
         return;
     }
 }
Exemplo n.º 9
0
        protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
        {
            if (item is DACPGenre)
            {
                NavigationManager.OpenMovieGenrePage((DACPGenre)item);
                return;
            }

            base.OnListItemTap(item, list, isPlayButton);
        }
        protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
        {
            if (item is Playlist)
            {
                NavigationManager.OpenInternetRadioStationsPage((Playlist)item);
                return;
            }

            base.OnListItemTap(item, list, isPlayButton);
        }
Exemplo n.º 11
0
        protected override async void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
        {
            if (item is DACPItem)
            {
                SetProgressIndicator(null, true);
                await RemoteUtility.HandleLibraryPlayTaskAsync(((DACPItem)item).Play());

                ClearProgressIndicator();
            }
        }
Exemplo n.º 12
0
        protected override void OnListItemTap(DACPElement item, Common.Phone.Controls.LongListSelector list, bool isPlayButton)
        {
            if (item is Playlist)
            {
                NavigationManager.OpenPlaylistPage((Playlist)item);
                return;
            }

            if (item is DACPItem)
            {
                RemoteUtility.HandleLibraryPlayTask(CurrentContainer.PlayItem((DACPItem)item));
            }
        }