MediaQueue Class

Provides methods and properties to access and control the queue of playing songs.

Namespace: Microsoft.Xna.Framework.Media
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public sealed class MediaQueue

Remarks

MediaQueue provides properties and methods that query and control the queue of playing songs. The ActiveSong property returns the currently playing Song. ActiveSongIndex gets or set the queue index of the currently playing song. Count returns the number of songs in the queue. The Item indexer returns the Song at the specified index in the queue.

MediaQueue is a read-only queue of songs. With MediaQueue, you can control which song is playing in the queue, but you cannot add or remove songs from the queue. Either MediaPlayer.Play or the songs already queued up when the game starts determine the songs that are in the queue of playing songs.

Note

All of the collections, playlists, and queues returned by methods and properties in the Microsoft.Xna.Framework.Media namespace are immutable. You cannot add or remove objects from those collections or playlists. To create a custom 'playlist' of songs, games must maintain their own list of songs to play, and play those songs one at a time by calling MediaPlayer.Play.

See Also

Reference

MediaPlayer.Play Method
MediaQueue Members
Microsoft.Xna.Framework.Media Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone