public SoundCloudPlayer(SoundCloudPlaylist playlist, string clientID) { this.clientID = clientID; this.playlist = playlist; track = playlist.tracks[0]; Init(track.stream_url + "?client_id=" + clientID); }
/// <summary> /// Set a new playlist for the player. /// </summary> /// <param name="playlist"></param> public void SetPlaylist(SoundCloudPlaylist playlist) { if (track == null) { player.Dispose(); this.playlist = playlist; track = playlist.tracks[0]; Init(track.stream_url + "?client_id=" + clientID); } }
/// <summary> /// WIP - Downloads a playlist. /// </summary> /// <param name="playlist"></param> /// <param name="dir"></param> /// <param name="format"></param> public void DownloadPlaylist(SoundCloudPlaylist playlist, string dir, string format) { for (int i = 0; i < playlist.track_count; i++) { Parallel.ForEach(playlist.tracks, (track) => { try { DownloadTrack(track, dir, format); } catch { } }); } }