Beispiel #1
0
 private void OnPlaylistChanged(PlayListType nPlayList, PlayList playlist)
 {
     // changes to the current track are dealt with by g_player events
     // but user can udpate the playlist without firing g_player events
     // make sure the next track details shown are correct
     if ((_playlistIsCurrent && nPlayList == PlayListType.PLAYLIST_MUSIC) ||
         (!_playlistIsCurrent && nPlayList == PlayListType.PLAYLIST_MUSIC_TEMP))
     {
         var nextFilename = playlistPlayer.GetNext();
         if (!string.IsNullOrEmpty(nextFilename))
         {
             var tag = GetTag(nextFilename);
             SetNextSkinProperties(tag, nextFilename);
         }
         else
         {
             SetNextSkinProperties(null, string.Empty);
         }
     }
 }
        public void GetNextReturnsFileName()
        {
            PlayListPlayer player = new PlayListPlayer();

            player.CurrentPlaylistType = PlayListType.PLAYLIST_MUSIC;
            PlayList     playlist = player.GetPlaylist(PlayListType.PLAYLIST_MUSIC);
            PlayListItem item1    = new PlayListItem("apa", "c:\\apa.mp3");

            playlist.Add(item1);
            Assert.AreEqual("c:\\apa.mp3", player.GetNext());
        }
        private void DoOnStarted(g_Player.MediaType type, string filename)
        {
            var      isInternetStream = Util.Utils.IsAVStream(filename);
            MusicTag tag;

            if (string.IsNullOrEmpty(filename))
            {
                return;
            }
            // last.fm radio sets properties manually therefore do not overwrite them.
            if (Util.Utils.IsLastFMStream(filename))
            {
                return;
            }

            // Radio Properties are set already in Play routine
            if (g_Player.IsRadio)
            {
                return;
            }

            // When Playing an Internet Stream, via BASS, skin properties are set during the Play method in BassAudio.cs
            if (BassMusicPlayer.IsDefaultMusicPlayer && isInternetStream)
            {
                return;
            }
            else
            {
                tag = GetTag(filename);
            }

            SetCurrentSkinProperties(tag, filename);

            if (isInternetStream)
            {
                SetNextSkinProperties(null, string.Empty);
                return;
            }

            // Show Information of Next File in Playlist
            string nextFilename = playlistPlayer.GetNext();

            if (nextFilename == string.Empty)
            {
                return;
            }
            tag = GetTag(nextFilename);
            SetNextSkinProperties(tag, nextFilename);
        }