MediaMetadata
instead together with MediaSession
.@Deprecated public abstract class MediaMetadataEditor extends Object
RemoteControlClient
. See the RemoteControlClient.editMetadata(boolean)
method to instantiate a RemoteControlClient.MetadataEditor
object.Modifier and Type | Field and Description |
---|---|
static int |
BITMAP_KEY_ARTWORK
Deprecated.
The metadata key for the content artwork / album art.
|
static int |
KEY_EDITABLE_MASK
Deprecated.
|
protected boolean |
mApplied
Deprecated.
|
protected boolean |
mArtworkChanged
Deprecated.
|
protected long |
mEditableKeys
Deprecated.
|
protected Bitmap |
mEditorArtwork
Deprecated.
|
protected Bundle |
mEditorMetadata
Deprecated.
|
protected static SparseIntArray |
METADATA_KEYS_TYPE
Deprecated.
|
protected static int |
METADATA_TYPE_BITMAP
Deprecated.
|
protected static int |
METADATA_TYPE_INVALID
Deprecated.
|
protected static int |
METADATA_TYPE_LONG
Deprecated.
|
protected static int |
METADATA_TYPE_RATING
Deprecated.
|
protected static int |
METADATA_TYPE_STRING
Deprecated.
|
protected MediaMetadata.Builder |
mMetadataBuilder
Deprecated.
|
protected boolean |
mMetadataChanged
Deprecated.
|
static int |
RATING_KEY_BY_OTHERS
Deprecated.
The metadata key for the content's average rating, not the user's rating.
|
static int |
RATING_KEY_BY_USER
Deprecated.
The metadata key for the content's user rating.
|
Modifier | Constructor and Description |
---|---|
protected |
MediaMetadataEditor()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addEditableKey(int key)
Deprecated.
Flags the given key as being editable.
|
abstract void |
apply()
Deprecated.
Applies all of the metadata changes that have been set since the MediaMetadataEditor instance
was created or since
clear() was called. |
void |
clear()
Deprecated.
Clears all the pending metadata changes set since the MediaMetadataEditor instance was
created or since this method was last called.
|
Bitmap |
getBitmap(int key,
Bitmap defaultValue)
Deprecated.
Returns the
Bitmap value for the key. |
int[] |
getEditableKeys()
Deprecated.
Retrieves the keys flagged as editable.
|
long |
getLong(int key,
long defaultValue)
Deprecated.
Returns the long value for the key.
|
Object |
getObject(int key,
Object defaultValue)
Deprecated.
Returns an object representation of the value for the key
|
String |
getString(int key,
String defaultValue)
Deprecated.
Returns the
String value for the key. |
MediaMetadataEditor |
putBitmap(int key,
Bitmap bitmap)
Deprecated.
Adds image.
|
MediaMetadataEditor |
putLong(int key,
long value)
Deprecated.
Adds numerical information.
|
MediaMetadataEditor |
putObject(int key,
Object value)
Deprecated.
Adds information stored as an instance.
|
MediaMetadataEditor |
putString(int key,
String value)
Deprecated.
Adds textual information.
|
void |
removeEditableKeys()
Deprecated.
Causes all metadata fields to be read-only.
|
public static final int BITMAP_KEY_ARTWORK
public static final int RATING_KEY_BY_OTHERS
Rating
instance.RATING_KEY_BY_USER
,
Constant Field Valuespublic static final int RATING_KEY_BY_USER
Rating
instance.
This key can be flagged as "editable" (with addEditableKey(int)
) to enable
receiving user rating values through the
RemoteControlClient.OnMetadataUpdateListener
interface.public static final int KEY_EDITABLE_MASK
protected long mEditableKeys
protected boolean mMetadataChanged
protected boolean mApplied
protected boolean mArtworkChanged
protected Bitmap mEditorArtwork
protected Bundle mEditorMetadata
protected MediaMetadata.Builder mMetadataBuilder
protected static final int METADATA_TYPE_INVALID
protected static final int METADATA_TYPE_LONG
protected static final int METADATA_TYPE_STRING
protected static final int METADATA_TYPE_BITMAP
protected static final int METADATA_TYPE_RATING
protected static final SparseIntArray METADATA_KEYS_TYPE
public abstract void apply()
clear()
was called. Subclasses should synchronize on
this
for thread safety.public void clear()
removeEditableKeys()
instead).public void addEditableKey(int key)
RemoteControlClient
,
which will declare the metadata field as eligible to be updated, with new values
received through the RemoteControlClient.OnMetadataUpdateListener
interface.key
- the type of metadata that can be edited. The supported key is
RATING_KEY_BY_USER
.public void removeEditableKeys()
public int[] getEditableKeys()
public MediaMetadataEditor putString(int key, String value) throws IllegalArgumentException
apply()
has been called,
will be available to consumers of metadata stored by the MediaMetadataEditor.key
- The identifier of a the metadata field to set. Valid values are
MediaMetadataRetriever.METADATA_KEY_ALBUM
,
MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST
,
MediaMetadataRetriever.METADATA_KEY_TITLE
,
MediaMetadataRetriever.METADATA_KEY_ARTIST
,
MediaMetadataRetriever.METADATA_KEY_AUTHOR
,
MediaMetadataRetriever.METADATA_KEY_COMPILATION
,
MediaMetadataRetriever.METADATA_KEY_COMPOSER
,
MediaMetadataRetriever.METADATA_KEY_DATE
,
MediaMetadataRetriever.METADATA_KEY_GENRE
,
MediaMetadataRetriever.METADATA_KEY_WRITER
.value
- The text for the given key, or null
to signify there is no valid
information for the field.IllegalArgumentException
public MediaMetadataEditor putLong(int key, long value) throws IllegalArgumentException
apply()
has been called
will be available to consumers of metadata stored by the MediaMetadataEditor.key
- the identifier of a the metadata field to set. Valid values are
MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER
,
MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER
,
MediaMetadataRetriever.METADATA_KEY_DURATION
(with a value
expressed in milliseconds),
MediaMetadataRetriever.METADATA_KEY_YEAR
.value
- The long value for the given keyIllegalArgumentException
public MediaMetadataEditor putBitmap(int key, Bitmap bitmap) throws IllegalArgumentException
key
- the identifier of the bitmap to set. The only valid value is
BITMAP_KEY_ARTWORK
bitmap
- The bitmap for the artwork, or null if there isn't any.IllegalArgumentException
Bitmap
public MediaMetadataEditor putObject(int key, Object value) throws IllegalArgumentException
apply()
has been called
will be available to consumers of metadata stored by the MediaMetadataEditor.key
- the identifier of a the metadata field to set. Valid keys for a:
Bitmap
object are BITMAP_KEY_ARTWORK
,String
object are the same as for putString(int, String)
Long
object are the same as for putLong(int, long)
Rating
object are RATING_KEY_BY_OTHERS
and RATING_KEY_BY_USER
.value
- the metadata to add.IllegalArgumentException
public long getLong(int key, long defaultValue) throws IllegalArgumentException
key
- one of the keys supported in putLong(int, long)
defaultValue
- the value returned if the key is not presentIllegalArgumentException
public String getString(int key, String defaultValue) throws IllegalArgumentException
String
value for the key.key
- one of the keys supported in putString(int, String)
defaultValue
- the value returned if the key is not presentString
value for the key, or the supplied default value if the key is
not presentIllegalArgumentException
public Bitmap getBitmap(int key, Bitmap defaultValue) throws IllegalArgumentException
Bitmap
value for the key.key
- the BITMAP_KEY_ARTWORK
keydefaultValue
- the value returned if the key is not presentBitmap
value for the key, or the supplied default value if the key is
not presentIllegalArgumentException
public Object getObject(int key, Object defaultValue) throws IllegalArgumentException
key
- one of the keys supported in putObject(int, Object)
defaultValue
- the value returned if the key is not presentLong
, Bitmap
, String
, or
Rating
depending on the key value, or the supplied default value if the key is
not presentIllegalArgumentException