예제 #1
0
        public static int GetIndexOfSongByArtist(Song song)
        {
            int index = 0;

            foreach (Song s in Songs.GetSongsByArtist(song.artist))
            {
                if (song.song == s.song)
                {
                    return(index);
                }
                else
                {
                    index++;
                }
            }
            return(0);
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (song.streamingURL != null)
            {
                currentSongList  = Songs.GetStreamingSongs();
                currentSongCount = currentSongList.Count;
                currentSongIndex = Songs.GetIndexOfStreamingSong(song);
            }
            else
            {
                if (Songs.searching)
                {
                    currentSongList  = Songs.GetSearchedSongsByArtist(song.artist);
                    currentSongCount = currentSongList.Count;
                    currentSongIndex = Songs.GetSearchedIndexOfSongByArtist(song);
                }
                else
                {
                    currentSongList  = Songs.GetSongsByArtist(song.artist);
                    currentSongCount = currentSongList.Count;
                    currentSongIndex = Songs.GetIndexOfSongByArtist(song);
                }
            }
            DisplaySongInfo();
            this.NavigationController.NavigationBar.BackgroundColor = UIColor.DarkGray;
            this.NavigationController.NavigationBar.BarTintColor    = UIColor.DarkGray;
            systemNavBarTintColor = this.NavigationController.NavigationBar.TintColor;
            this.NavigationController.NavigationBar.TintColor = UIColor.LightGray;

            if (musicPlayer.currentSong == null)
            {
                actIndView.StartAnimating();
                actIndView.Hidden = false;
                playPause.UserInteractionEnabled = false;
                playPause.TintColor = UIColor.DarkGray;
            }
            if (song.streamingURL == null || musicPlayer.avPlayer.CurrentItem != null)
            {
                actIndView.Hidden = true;
                actIndView.StopAnimating();
                playPause.UserInteractionEnabled = true;
                playPause.TintColor = UIColor.Blue;
            }
        }