Table of Contents

Class Song

Namespace
Microsoft.Xna.Framework.Media
Assembly
MonoGame.Framework.dll

Provides access to a song in the song library.

public sealed class Song : IEquatable<Song>, IDisposable
Inheritance
Song
Implements
Inherited Members

Properties

Album

Gets the Album on which the Song appears.

public Album Album { get; }

Property Value

Album

Artist

Gets the Artist of the Song.

public Artist Artist { get; }

Property Value

Artist

Duration

Gets the duration of the Song.

public TimeSpan Duration { get; }

Property Value

TimeSpan

Genre

Gets the Genre of the Song.

public Genre Genre { get; }

Property Value

Genre

IsDisposed

Gets a value indicating whether the object is disposed.

public bool IsDisposed { get; }

Property Value

bool

IsProtected

Gets a value that indicates whether the song is DRM protected content.

public bool IsProtected { get; }

Property Value

bool

IsRated

Gets a value that indicates whether the song has been rated by the user.

public bool IsRated { get; }

Property Value

bool

Name

Gets the name of the Song.

public string Name { get; }

Property Value

string

PlayCount

Gets the song play count.

public int PlayCount { get; }

Property Value

int

Position

Gets the position of the Song.

public TimeSpan Position { get; }

Property Value

TimeSpan

Rating

Gets the user's rating for the Song.

public int Rating { get; }

Property Value

int

User's rating for this Song, or 0 if the song is unrated. Ratings range from 1 (dislike the most) to 10 (like the most).

TrackNumber

Gets the track number of the song on the song's Album.

public int TrackNumber { get; }

Property Value

int

Track number of this Song on the song's Album.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Equals(Song)

Determines whether two instances of Song are equal.

public bool Equals(Song song)

Parameters

song Song

The Song to compare with the current object

Returns

bool

true if the specified Song is equal to the current object; otherwise, false

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

~Song()

protected ~Song()

FromUri(string, Uri)

Returns a song that can be played via MediaPlayer.

public static Song FromUri(string name, Uri uri)

Parameters

name string

The name for the song. See Song.Name.

uri Uri

The path to the song file.

Returns

Song

GetHashCode()

Gets the hash code for this instance.

public override int GetHashCode()

Returns

int

Operators

operator ==(Song, Song)

Determines whether the specified Song instances are equal.

public static bool operator ==(Song song1, Song song2)

Parameters

song1 Song
song2 Song

Returns

bool

operator !=(Song, Song)

Determines whether the specified Song instances are not equal.

public static bool operator !=(Song song1, Song song2)

Parameters

song1 Song
song2 Song

Returns

bool