MSFKMediaMetadata Class Reference
| Inherits from | NSObject |
| Declared in | MSFKMediaMetadata.h MSFKMediaMetadata.m |
Overview
Container class for media metadata. Metadata has a media type, an optional list of images, and a collection of metadata fields. Keys for common metadata fields are predefined as constants, but the application is free to define and use additional fields of its own.
The values of the predefined fields have predefined types. For example, a track number is
an NSInteger and a creation date is a NSString containing an ISO-8601
representation of a date and time. Attempting to store a value of an incorrect type in a field
will assert.
Note that the Flint protocol limits which metadata fields can be used for a given media type. When a MediaMetadata object is serialized to JSON for delivery to a Flint receiver, any predefined fields which are not supported for a given media type will not be included in the serialized form, but any application-defined fields will always be included.
Tasks
-
– initWithMetadataType: -
– init -
– metadataType -
– images -
– removeAllMediaImages -
– addImage: -
– containsKey: -
– allKeys -
– setString:forKey: -
– stringForKey: -
– setInteger:forKey: -
– integerForKey: -
– integerForKey:defaultValue: -
– setDouble:forKey: -
– doubleForKey: -
– doubleForKey:defaultValue: -
– setDate:forKey: -
– dateForKey: -
– dateAsStringForKey: -
– initWithJSONObject: -
– JSONObject
Instance Methods
JSONObject
Create a JSON object which can serialized with NSJSONSerialization to pass to the receiver.
- (id)JSONObjectDiscussion
Create a JSON object which can serialized with NSJSONSerialization to pass to the receiver.
Declared In
MSFKMediaMetadata.haddImage:
Adds an image to the list of images.
- (void)addImage:(MSFKImage *)imageDiscussion
Adds an image to the list of images.
Declared In
MSFKMediaMetadata.hallKeys
Returns a set of keys for all fields that are present in the object.
- (NSArray *)allKeysDiscussion
Returns a set of keys for all fields that are present in the object.
Declared In
MSFKMediaMetadata.hcontainsKey:
Tests if the object contains a field with the given key.
- (BOOL)containsKey:(NSString *)keyDiscussion
Tests if the object contains a field with the given key.
Declared In
MSFKMediaMetadata.hdateAsStringForKey:
Reads the value of a date field, as a string. Asserts if the key refers to a predefined field which is not a date field.
- (NSString *)dateAsStringForKey:(NSString *)keyParameters
- key
The field name.
Return Value
The date, as a {@code String} containing the restricted ISO-8601 representation of the date, or {@code null} if this field has not been set. @throw IllegalArgumentException If the specified field’s predefined type is not a date.
Discussion
Reads the value of a date field, as a string. Asserts if the key refers to a predefined field which is not a date field.
Declared In
MSFKMediaMetadata.hdateForKey:
Reads the value of a date field from the restricted ISO-8601 representation of the date. Asserts if the key refers to a predefined field which is not a date field.
- (NSDate *)dateForKey:(NSString *)keyParameters
- key
The field name.
Return Value
The date, or {@code nil} if this field has not been set.
Discussion
Reads the value of a date field from the restricted ISO-8601 representation of the date. Asserts if the key refers to a predefined field which is not a date field.
Declared In
MSFKMediaMetadata.hdoubleForKey:
Reads the value of a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
- (double)doubleForKey:(NSString *)keyReturn Value
The value of the field, or 0 if the field has not been set.
Discussion
Reads the value of a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
Declared In
MSFKMediaMetadata.hdoubleForKey:defaultValue:
Reads the value of a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
- (double)doubleForKey:(NSString *)key defaultValue:(double)defaultValueParameters
- defaultValue
The value to return if the field has not been set.
Return Value
The value of the field, or the given default value if the field has not been set.
Discussion
Reads the value of a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
Declared In
MSFKMediaMetadata.himages
Gets the list of images.
- (NSArray *)imagesDiscussion
Gets the list of images.
Declared In
MSFKMediaMetadata.hinit
Initialize with the generic metadata type.
- (id)initDiscussion
Initialize with the generic metadata type.
Declared In
MSFKMediaMetadata.hinitWithJSONObject:
Initialize this object with its JSON representation.
- (id)initWithJSONObject:(id)jsonObjectDiscussion
Initialize this object with its JSON representation.
Declared In
MSFKMediaMetadata.hinitWithMetadataType:
Initializes a new, empty, MediaMetadata with the given media type. Designated initializer.
- (id)initWithMetadataType:(MSFKMediaMetadataType)metadataTypeParameters
- metadataType
The media type; one of the {@code MEDIA_TYPE_*} constants, or a value greater than or equal to {@link MEDIA_TYPE_USER} for custom media types.
Discussion
Initializes a new, empty, MediaMetadata with the given media type. Designated initializer.
Declared In
MSFKMediaMetadata.hintegerForKey:
Reads the value of an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
- (NSInteger)integerForKey:(NSString *)keyReturn Value
The value of the field, or 0 if the field has not been set.
Discussion
Reads the value of an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
Declared In
MSFKMediaMetadata.hintegerForKey:defaultValue:
Reads the value of an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
- (NSInteger)integerForKey:(NSString *)key defaultValue:(NSInteger)defaultValueParameters
- defaultValue
The value to return if the field has not been set.
Return Value
The value of the field, or the given default value if the field has not been set.
Discussion
Reads the value of an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
Declared In
MSFKMediaMetadata.hmetadataType
The metadata type.
- (MSFKMediaMetadataType)metadataTypeDiscussion
The metadata type.
Declared In
MSFKMediaMetadata.hremoveAllMediaImages
Removes all the current images.
- (void)removeAllMediaImagesDiscussion
Removes all the current images.
Declared In
MSFKMediaMetadata.hsetDate:forKey:
Stores a value in a date field as a restricted ISO-8601 representation of the date. Asserts if the key refers to a predefined field which is not a date field.
- (void)setDate:(NSDate *)date forKey:(NSString *)keyParameters
- key
The key for the field.
- value
The new value for the field.
Discussion
Stores a value in a date field as a restricted ISO-8601 representation of the date. Asserts if the key refers to a predefined field which is not a date field.
Declared In
MSFKMediaMetadata.hsetDouble:forKey:
Stores a value in a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
- (void)setDouble:(double)value forKey:(NSString *)keyParameters
- value
The new value for the field.
- key
The key for the field.
Discussion
Stores a value in a {@code double} field. Asserts if the key refers to a predefined field which is not a {@code double} field.
Declared In
MSFKMediaMetadata.hsetInteger:forKey:
Stores a value in an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
- (void)setInteger:(NSInteger)value forKey:(NSString *)keyParameters
- value
The new value for the field.
- key
The key for the field.
Discussion
Stores a value in an integer field. Asserts if the key refers to a predefined field which is not an {@code NSInteger} field.
Declared In
MSFKMediaMetadata.hsetString:forKey:
Stores a value in a string field. Asserts if the key refers to a predefined field which is not a {@code NSString} field.
- (void)setString:(NSString *)value forKey:(NSString *)keyParameters
- value
The new value for the field.
- key
The key for the field.
Discussion
Stores a value in a string field. Asserts if the key refers to a predefined field which is not a {@code NSString} field.
Declared In
MSFKMediaMetadata.hstringForKey:
Reads the value of a string field. Asserts if the key refers to a predefined field which is not a {@code NSString} field.
- (NSString *)stringForKey:(NSString *)keyReturn Value
The value of the field, or {@code nil} if the field has not been set.
Discussion
Reads the value of a string field. Asserts if the key refers to a predefined field which is not a {@code NSString} field.
Declared In
MSFKMediaMetadata.h