/// <summary> /// Initializes a new instance of the <see cref="LoopedSong" /> class. /// </summary> /// <param name="URI">The URI to the song to be played</param> /// <param name="play">Whether or not to start it immediately</param> /// <param name="loops">The amount of times to loop the song. -1 for infinite times, 0 for one play, no loops, 1 for two plays, one loop etc.</param> public LoopedSong(string URI, bool play = false, int loops = -1) { _loops = loops; song = new Song(URI, play); song.PlaybackStopped += song_PlaybackStopped; }
/// <summary> /// Initializes a new instance of the <see cref="ChainedSong"/> class. /// </summary> /// <param name="URIs">The list of URIs containing the absolute path of the songs to be played.</param> public ChainedSong(IEnumerable<string> URIs) { SongList = new List<Song>(); foreach (String s in URIs) { Song song = new Song(s); song.PlaybackStopped += song_PlaybackStopped; SongList.Add(song); } SongQueue = new Queue<Song>(SongList); }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!_disposed) { if (disposing) { if (song != null) { this.Stop(); song.Dispose(); } } song = null; _disposed = true; } }
/// <summary> /// Adds a song to the manager. /// </summary> /// <param name="URI">The URI to be played.</param> /// <param name="play">if set to <c>true</c> then the song will automatically play once added.</param> /// <returns>The song to be played</returns> public Song AddSong(string URI, bool play = false) { Song s = new Song(URI, play); AddSong(s, play); return s; }