Class

ITLibMediaItem

The ITLibMediaItem class describes a media item (a track) in the iTunes library such as a song, a video, or a podcast. Like all media entities, each media item has a unique identifier and a set of properties.

Declaration

class ITLibMediaItem : ITLibMediaEntity

Topics

Instance Properties

var addedDate: Date?

The date when this media item was added to iTunes.

var album: ITLibAlbum

If this media item is an audio track, this property contains information about the corresponding album.

var artist: ITLibArtist?

Information about the artist associated with this media item.

var artwork: ITLibArtwork?

The artwork of this media item.

var beatsPerMinute: Int

If this media item is an audio track, this property contains the Beats Per Minute (BPM) of the audio.

var bitrate: Int

The bitrate of this media item in kbps.

var category: String?

If this media item is a podcast, this property contains the category of the podcast.

var comments: String?

Any comments associated with this media item.

var composer: String

The name of the composer associated with this media item.

var contentRating: String?

The rating of the content of this media item.

var description: String?

If this media item is a podcast, this property contains the description of the podcast.

var fileType: Int

The Mac OS file type of this media item (deprecated).

Deprecated
var genre: String

The genre associated with this media item as specified in the metadata of the file or by the user in iTunes.

var grouping: String?

The grouping of this media item as specified in the metadata of the file or by the user in iTunes.

var hasArtworkAvailable: Bool

Whether this media item has artwork.

var isDRMProtected: Bool

Whether this media item is DRM protected.

var isPurchased: Bool

Whether this media item was purchased from the iTunes store.

var isRatingComputed: Bool

Whether this media item's rating is computed (calculated from its album rating).

var isUserDisabled: Bool

Whether the user has disabled this media item in iTunes.

var isVideo: Bool

Whether this media item is a video such as a TV show, video podcast, or movie.

var kind: String?

The iTunes-specific string representation of the kind of this media item; for example, "MPEG audio file" or "Book".

var lastPlayedDate: Date?

The date and time this media item was last played in iTunes, or nil if this media item has not been played.

var location: URL?

The location of this media item if available.

var locationType: ITLibMediaItemLocationType

The kind of location of this media item.

var lyricsContentRating: ITLibMediaItemLyricsContentRating

If this media item has associated lyrics, this property specifies the content rating for those lyrics. See the ITLibMediaItemLyricsContentRating enum for a list of possible lyric content ratings.

var mediaKind: ITLibMediaItemMediaKind

This media item's media kind. See the ITLibMediaItemMediaKind enum for a list of possible media kind values.

var modifiedDate: Date?

The date and time this media item was last modified in iTunes.

var playCount: Int

The number of times this media item has been played in iTunes.

var rating: Int

The rating of this media item. See isRatingComputed for more information.

var releaseDate: Date?

The date this media item was released.

var sampleRate: Int

The sample rate of this media item in samples per second.

var size: Int

The size in bytes of this media item.

Deprecated
var skipCount: Int

The number of times the user has skipped this media item in iTunes.

var skipDate: Date?

The most recent date and time when this media item was skipped in iTunes.

var sortComposer: String?

The name that iTunes uses when sorting by composer.

var sortTitle: String?

The title that iTunes uses when it sorts media items by title.

var startTime: Int

If this media item is a podcast, this property contains the podcast start time.

var stopTime: Int

If this media item is a podcast, this property contains the podcast stop time.

var title: String

The title of this media item.

var totalTime: Int

The length of this media item in milliseconds.

var trackNumber: Int

The track number of this media item within its album.

var videoInfo: ITLibMediaItemVideoInfo?

Video information (such as width and height) about this media item, if it is a video media item.

var voiceOverLanguage: String?

The voice-over language of this media item if applicable.

var volumeAdjustment: Int

The volume adjustment used for this media item, if any.

var volumeNormalizationEnergy: Int

The volume normalization energy applied by iTunes to this media item in order to bring the average or peak amplitude to a target level.

var year: Int

The year when this media item was released.

Relationships

Inherits From

Conforms To