예제 #1
0
        private void SaveToFavoritesPlaylist(MpdFile mpdSong)
        {
            var playlistName = mpdSong.HasGenre ? mpdSong.Genre : "Favorites";

            if (!ExistsInPlaylist(playlistName, mpdSong.File))
            {
                MpdClient.PlaylistAdd(playlistName, mpdSong.File);
            }
        }
예제 #2
0
        public static string GetSong()
        {
            if (!mpc.Connected)
            {
                Connect();
            }
            //get the current song and assign it to the local song variable
            MpdFile song = mpc.CurrentSong();

            //check if song actually exists before returning it
            if (song == null)
            {
                return("No song playing");
            }
            else
            {
                return(song.File);
            }
        }
예제 #3
0
 /// <summary>
 /// Deserializes the specified response text pairs.
 /// </summary>
 /// <param name="response">The response.</param>
 /// <returns>
 /// The deserialized response.
 /// </returns>
 public IEnumerable <IMpdFile> Deserialize(IReadOnlyList <KeyValuePair <string, string> > response)
 {
     return(MpdFile.CreateList(response));
 }
예제 #4
0
 /// <summary>
 /// Deserializes the specified response text pairs.
 /// </summary>
 /// <param name="response">The response.</param>
 /// <returns>
 /// The deserialized response.
 /// </returns>
 public IMpdFile Deserialize(IReadOnlyList <KeyValuePair <string, string> > response)
 {
     return(MpdFile.Create(response, 0).mpdFile);
 }
예제 #5
0
        /// <summary>
        /// Deserializes the specified response text pairs.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <returns>
        /// The deserialized response.
        /// </returns>
        public IEnumerable <IMpdFile> Deserialize(IReadOnlyList <KeyValuePair <string, string> > response)
        {
            var results = response.Select(line => MpdFile.Create(line.Value, int.Parse(line.Key)));

            return(results);
        }