Beispiel #1
0
        public Track Replacement(Track track)
        {
            ISpotify connection = GetConnection();

            Track result = connection.Replacement(track);

            ReleaseConnection(connection);

            return result;
        }
Beispiel #2
0
        public Track Browse(Track track)
        {
            ISpotify connection = GetConnection();

            Track result = connection.Browse(track);

            ReleaseConnection(connection);

            return result;
        }
Beispiel #3
0
        public MusicStream GetMusicStream(Track track, File file, TimeSpan timeout)
        {
            ISpotify connection = GetConnection();

            MusicStream result = connection.GetMusicStream(track, file, timeout);

            ReleaseConnection(connection);

            return result;
        }
Beispiel #4
0
        public bool PlaylistAddTrack(Playlist playlist, Track track, int position)
        {
            ISpotify connection = GetConnection();

            bool result = connection.PlaylistAddTrack(playlist, track, position);

            ReleaseConnection(connection);

            return result;
        }
Beispiel #5
0
 public void AddTrack(Track track)
 {
     this.Tracks.Add(track);
 }
Beispiel #6
0
 /// <summary>
 /// Update the checksum with a <see cref="Track"/>.
 /// </summary>
 /// <param name="track">A <see cref="Track"/> object.</param>
 public void Update(Track track)
 {
     this.Update(Hex.ToBytes(track.Id));
     this.Update((byte)0x01);
 }
 /// <summary>
 /// Add a track to a playlist.
 /// </summary>
 /// <param name="playlist">The playlist.</param>
 /// <param name="track">The track to be added.</param>
 /// <param name="position">The target position of the added track.</param>
 /// <returns>true on success and false on failure.</returns>
 public bool PlaylistAddTrack(Playlist playlist, Track track, int position)
 {
     List<Track> tracks = new List<Track>();
     tracks.Add(track);
     return this.PlaylistAddTracks(playlist, tracks, position);
 }
Beispiel #8
0
 /// <summary>
 /// Create a <see cref="Link"/> from a <see cref="Track"/>.
 /// </summary>
 /// <param name="track">An <see cref="Track"/> object.</param>
 /// <returns>A <see cref="Link"/> object</returns>
 public static Link Create(Track track)
 {
     return new Link(LinkType.TRACK, track.Id, null, null);
 }
 /// <summary>
 /// Add a track to a playlist.
 /// </summary>
 /// <param name="playlist">The playlist.</param>
 /// <param name="track">The track to be added.</param>
 /// <returns></returns>
 public bool PlaylistAddTrack(Playlist playlist, Track track)
 {
     return this.PlaylistAddTrack(playlist, track, playlist.Tracks.Count);
 }
 public MusicStream GetMusicStream(Track track, Sharpotify.Media.File file, TimeSpan timeout)
 {
     ChannelCallback listener = new ChannelCallback();
     ChannelHeaderCallback callback2 = new ChannelHeaderCallback();
     try
     {
         this.protocol.SendPlayRequest();
     }
     catch (ProtocolException)
     {
         return null;
     }
     try
     {
         this.protocol.SendAesKeyRequest(listener, track, file);
     }
     catch (ProtocolException)
     {
         return null;
     }
     byte[] key = listener.Get(timeout);
     MusicStream output = new MusicStream();
     try
     {
         ChannelStreamer streamer = new ChannelStreamer(this.protocol, file, key, output);
     }
     catch (Exception)
     {
         /* Ignore */
     }
     return output;
 }
 /// <summary>
 /// Request a replacement track.
 /// </summary>
 /// <param name="track">The track to search the replacement for.</param>
 /// <returns></returns>
 public Track Replacement(Track track)
 {
     List<Track> list = new List<Track>();
     list.Add(track);
     return this.Replacement(list)[0];
 }
 /// <summary>
 /// Browse track info.
 /// </summary>
 /// <param name="track">A <see cref="Track"/> object identifying the track to browse.</param>
 /// <returns></returns>
 public Track Browse(Track track)
 {
     return this.BrowseTrack(track.Id);
 }
Beispiel #13
0
 public void AddTrack(Track track)
 {
     this.Tracks.Add(track);
 }