SFBAudioMetadata
@interface SFBAudioMetadata : NSObject <NSCopying>
Class supporting commonly-used audio metadata and attached pictures
-
Returns an initialized empty \c SFBAudioMetadata object
Declaration
Objective-C
- (nonnull instancetype)init;
-
Returns an initialized \c SFBAudioMetadata object populated with values from \c dictionaryRepresentation
Declaration
Objective-C
- (nonnull instancetype)initWithDictionaryRepresentation: (nonnull NSDictionary<SFBAudioMetadataKey, id> *)dictionaryRepresentation;
Parameters
dictionaryRepresentation
A dictionary containing the desired values
-
The title
Declaration
Objective-C
@property (nonatomic, nullable) NSString *title;
-
The album title
Declaration
Objective-C
@property (nonatomic, nullable) NSString *albumTitle;
-
The artist
Declaration
Objective-C
@property (nonatomic, nullable) NSString *artist;
-
The album artist
Declaration
Objective-C
@property (nonatomic, nullable) NSString *albumArtist;
-
The genre
Declaration
Objective-C
@property (nonatomic, nullable) NSString *genre;
-
The composer
Declaration
Objective-C
@property (nonatomic, nullable) NSString *composer;
-
The release date
Declaration
Objective-C
@property (nonatomic, nullable) NSString *releaseDate;
-
The compilation flag
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *compilation;
-
The track number
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *trackNumber;
-
The track total
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *trackTotal;
-
The disc number
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *discNumber;
-
The disc total
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *discTotal;
-
The lyrics
Declaration
Objective-C
@property (nonatomic, nullable) NSString *lyrics;
-
The Beats per minute (BPM)
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *bpm;
-
The rating
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *rating;
-
The comment
Declaration
Objective-C
@property (nonatomic, nullable) NSString *comment;
-
The Media Catalog Number (MCN)
Declaration
Objective-C
@property (nonatomic, nullable) NSString *mcn;
-
The International Standard Recording Code (ISRC)
Declaration
Objective-C
@property (nonatomic, nullable) NSString *isrc;
-
The MusicBrainz release ID
Declaration
Objective-C
@property (nonatomic, nullable) NSString *musicBrainzReleaseID;
-
The MusicBrainz recording ID
Declaration
Objective-C
@property (nonatomic, nullable) NSString *musicBrainzRecordingID;
-
The title sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *titleSortOrder;
-
The album title sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *albumTitleSortOrder;
-
The artist sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *artistSortOrder;
-
The album artist sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *albumArtistSortOrder;
-
The composer sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *composerSortOrder;
-
The genre sort order
Declaration
Objective-C
@property (nonatomic, nullable) NSString *genreSortOrder;
-
The grouping
Declaration
Objective-C
@property (nonatomic, nullable) NSString *grouping;
-
The additional metadata
Declaration
Objective-C
@property (nonatomic, nullable) NSDictionary *additionalMetadata;
-
The replay gain reference loudness
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *replayGainReferenceLoudness;
-
The replay gain track gain
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *replayGainTrackGain;
-
The replay gain track peak
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *replayGainTrackPeak;
-
The replay gain album gain
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *replayGainAlbumGain;
-
The replay gain album peak
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *replayGainAlbumPeak;
-
Copies all metadata from \c metadata
Note
Does not copy album artworkSee
-copyMetadataOfKind:from:See
-copyAttachedPictures:Declaration
Objective-C
- (void)copyMetadataFrom:(nonnull SFBAudioMetadata *)metadata;
Parameters
metadata
A \c Metadata object containing the metadata to copy
-
Copies the values contained in the specified metadata kinds from \c metadata
Note
Does not copy album artworkSee
-copyMetadataFrom:See
-copyAttachedPicturesDeclaration
Objective-C
- (void)copyMetadataOfKind:(SFBAudioMetadataKind)kind from:(nonnull SFBAudioMetadata *)metadata;
Parameters
metadata
A \c Metadata object containing the metadata to copy
kind
A bitmask specifying the kinds of metadata to copy
-
Sets the values contained in specified metadata kinds to \c nullptr
See
-removeAllMetadataSee
-removeAllAttachedPicturesDeclaration
Objective-C
- (void)removeMetadataOfKind:(SFBAudioMetadataKind)kind;
Parameters
kind
A bitmask specifying the kinds of metadata to remove
-
Sets all metadata to \c nullptr
Note
Leaves album art intactSee
-removeMetadataOfKind:See
-removeAllAttachedPicturesDeclaration
Objective-C
- (void)removeAllMetadata;
-
Get all attached pictures
Declaration
Objective-C
@property (nonatomic, readonly) NSSet<SFBAttachedPicture *> *_Nonnull attachedPictures;
-
Copies album artwork from \c metadata
Note
This clears existing album artworkNote
Does not copy metadataSee
-copyMetadataFrom:Declaration
Objective-C
- (void)copyAttachedPicturesFrom:(nonnull SFBAudioMetadata *)metadata;
Parameters
metadata
A \c SFBAudioMetadata object containing the artwork to copy
-
Get all attached pictures of the specified type
Declaration
Objective-C
- (nonnull NSArray<SFBAttachedPicture *> *)attachedPicturesOfType: (SFBAttachedPictureType)type;
-
Attach a picture
Declaration
Objective-C
- (void)attachPicture:(nonnull SFBAttachedPicture *)picture;
-
Remove an attached picture
Declaration
Objective-C
- (void)removeAttachedPicture:(nonnull SFBAttachedPicture *)picture;
-
Remove all attached pictures of the specified type
Declaration
Objective-C
- (void)removeAttachedPicturesOfType:(SFBAttachedPictureType)type;
-
Remove all attached pictures
Declaration
Objective-C
- (void)removeAllAttachedPictures;
-
Copy the values contained in this object to a dictionary
Declaration
Objective-C
@property (nonatomic, readonly) NSDictionary<SFBAudioMetadataKey, id> *_Nonnull dictionaryRepresentation;
Return Value
A dictionary containing this object’s metadata and attached pictures
-
Sets the metadata and attached pictures contained in this object from a dictionary
Declaration
Objective-C
- (void)setFromDictionaryRepresentation: (nonnull NSDictionary<SFBAudioMetadataKey, id> *)dictionary;
Parameters
dictionary
A dictionary containing the desired values
-
Returns the metadata value for a key
Declaration
Objective-C
- (nullable id)objectForKey:(nonnull SFBAudioMetadataKey)key;
Parameters
key
The key for the desired metadata value
Return Value
The metadata value for \c key
-
Sets the metadata value for a key
Declaration
Objective-C
- (void)setObject:(nonnull id)obj forKey:(nonnull SFBAudioMetadataKey)key;
Parameters
obj
The metadata value to set
key
The key for the metadata value
-
Removes the metadata value for a key
Declaration
Objective-C
- (void)removeObjectForKey:(nonnull SFBAudioMetadataKey)key;
Parameters
key
The key for the metadata value to remove
-
Returns the metadata value for a key
Declaration
Objective-C
- (nullable id)valueForKey:(nonnull SFBAudioMetadataKey)key;
Parameters
key
The key for the desired metadata value
Return Value
The metadata value for \c key
-
Sets or removes a metadata value
Declaration
Objective-C
- (void)setValue:(nullable id)obj forKey:(nonnull SFBAudioMetadataKey)key;
Parameters
obj
The metadata value to set or \c nil to remove
key
The key for the metadata value
-
Returns the metadata value for a key
Declaration
Objective-C
- (nullable id)objectForKeyedSubscript:(nonnull SFBAudioMetadataKey)key;
Parameters
key
The key for the desired metadata value
Return Value
The metadata value for \c key
-
Sets or removes a metadata value
Declaration
Objective-C
- (void)setObject:(nullable id)obj forKeyedSubscript:(nonnull SFBAudioMetadataKey)key;
Parameters
obj
The metadata value to set or \c nil to remove
key
The key for the metadata value
-
The compilation flag
Declaration
Swift
public var compilation: Bool? { get set }
-
The track number
Declaration
Swift
public var trackNumber: Int? { get set }
-
The track total
Declaration
Swift
public var trackTotal: Int? { get set }
-
The disc number
Declaration
Swift
public var discNumber: Int? { get set }
-
The disc total
Declaration
Swift
public var discTotal: Int? { get set }
-
The Beats per minute (BPM)
Declaration
Swift
public var bpm: Int? { get set }
-
The rating
Declaration
Swift
public var rating: Int? { get set }
-
The replay gain reference loudness
Declaration
Swift
public var replayGainReferenceLoudness: Double? { get set }
-
The replay gain track gain
Declaration
Swift
public var replayGainTrackGain: Double? { get set }
-
The replay gain track peak
Declaration
Swift
public var replayGainTrackPeak: Double? { get set }
-
The replay gain album gain
Declaration
Swift
public var replayGainAlbumGain: Double? { get set }
-
The replay gain album peak
Declaration
Swift
public var replayGainAlbumPeak: Double? { get set }