MediaSessionCompatApi14public class MediaSessionCompatApi14 extends Object
Fields Summary |
---|
static final int | RCC_PLAYSTATE_NONERemoteControlClient States, we only need none as the others were public | static final int | STATE_NONEMediaSession States | static final int | STATE_STOPPED | static final int | STATE_PAUSED | static final int | STATE_PLAYING | static final int | STATE_FAST_FORWARDING | static final int | STATE_REWINDING | static final int | STATE_BUFFERING | static final int | STATE_ERROR | static final int | STATE_CONNECTING | static final int | STATE_SKIPPING_TO_PREVIOUS | static final int | STATE_SKIPPING_TO_NEXT | private static final String | METADATA_KEY_TITLEMediaMetadata keys | private static final String | METADATA_KEY_ARTIST | private static final String | METADATA_KEY_DURATION | private static final String | METADATA_KEY_ALBUM | private static final String | METADATA_KEY_AUTHOR | private static final String | METADATA_KEY_WRITER | private static final String | METADATA_KEY_COMPOSER | private static final String | METADATA_KEY_COMPILATION | private static final String | METADATA_KEY_DATE | private static final String | METADATA_KEY_YEAR | private static final String | METADATA_KEY_GENRE | private static final String | METADATA_KEY_TRACK_NUMBER | private static final String | METADATA_KEY_NUM_TRACKS | private static final String | METADATA_KEY_DISC_NUMBER | private static final String | METADATA_KEY_ALBUM_ARTIST |
Methods Summary |
---|
static void | buildOldMetadata(android.os.Bundle metadata, RemoteControlClient.MetadataEditor editor)
if (metadata.containsKey(METADATA_KEY_ALBUM)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM,
metadata.getString(METADATA_KEY_ALBUM));
}
if (metadata.containsKey(METADATA_KEY_ALBUM_ARTIST)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST,
metadata.getString(METADATA_KEY_ALBUM_ARTIST));
}
if (metadata.containsKey(METADATA_KEY_ARTIST)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST,
metadata.getString(METADATA_KEY_ARTIST));
}
if (metadata.containsKey(METADATA_KEY_AUTHOR)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_AUTHOR,
metadata.getString(METADATA_KEY_AUTHOR));
}
if (metadata.containsKey(METADATA_KEY_COMPILATION)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_COMPILATION,
metadata.getString(METADATA_KEY_COMPILATION));
}
if (metadata.containsKey(METADATA_KEY_COMPOSER)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_COMPOSER,
metadata.getString(METADATA_KEY_COMPOSER));
}
if (metadata.containsKey(METADATA_KEY_DATE)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_DATE,
metadata.getString(METADATA_KEY_DATE));
}
if (metadata.containsKey(METADATA_KEY_DISC_NUMBER)) {
editor.putLong(MediaMetadataRetriever.METADATA_KEY_DISC_NUMBER,
metadata.getLong(METADATA_KEY_DISC_NUMBER));
}
if (metadata.containsKey(METADATA_KEY_DURATION)) {
editor.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION,
metadata.getLong(METADATA_KEY_DURATION));
}
if (metadata.containsKey(METADATA_KEY_GENRE)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_GENRE,
metadata.getString(METADATA_KEY_GENRE));
}
if (metadata.containsKey(METADATA_KEY_NUM_TRACKS)) {
editor.putLong(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS,
metadata.getLong(METADATA_KEY_NUM_TRACKS));
}
if (metadata.containsKey(METADATA_KEY_TITLE)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_TITLE,
metadata.getString(METADATA_KEY_TITLE));
}
if (metadata.containsKey(METADATA_KEY_TRACK_NUMBER)) {
editor.putLong(MediaMetadataRetriever.METADATA_KEY_CD_TRACK_NUMBER,
metadata.getLong(METADATA_KEY_TRACK_NUMBER));
}
if (metadata.containsKey(METADATA_KEY_WRITER)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_WRITER,
metadata.getString(METADATA_KEY_WRITER));
}
if (metadata.containsKey(METADATA_KEY_YEAR)) {
editor.putString(MediaMetadataRetriever.METADATA_KEY_YEAR,
metadata.getString(METADATA_KEY_YEAR));
}
| public static java.lang.Object | createRemoteControlClient(android.app.PendingIntent mbIntent)
return new RemoteControlClient(mbIntent);
| static int | getRccStateFromState(int state)
switch (state) {
case STATE_CONNECTING:
case STATE_BUFFERING:
return RemoteControlClient.PLAYSTATE_BUFFERING;
case STATE_ERROR:
return RemoteControlClient.PLAYSTATE_ERROR;
case STATE_FAST_FORWARDING:
return RemoteControlClient.PLAYSTATE_FAST_FORWARDING;
case STATE_NONE:
return RCC_PLAYSTATE_NONE;
case STATE_PAUSED:
return RemoteControlClient.PLAYSTATE_PAUSED;
case STATE_PLAYING:
return RemoteControlClient.PLAYSTATE_PLAYING;
case STATE_REWINDING:
return RemoteControlClient.PLAYSTATE_REWINDING;
case STATE_SKIPPING_TO_PREVIOUS:
return RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS;
case STATE_SKIPPING_TO_NEXT:
return RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS;
case STATE_STOPPED:
return RemoteControlClient.PLAYSTATE_STOPPED;
default:
return -1;
}
| public static void | registerRemoteControlClient(android.content.Context context, java.lang.Object rccObj)
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.registerRemoteControlClient((RemoteControlClient) rccObj);
| public static void | setMetadata(java.lang.Object rccObj, android.os.Bundle metadata)
RemoteControlClient.MetadataEditor editor = ((RemoteControlClient) rccObj).editMetadata(
true);
buildOldMetadata(metadata, editor);
editor.apply();
| public static void | setState(java.lang.Object rccObj, int state)
((RemoteControlClient) rccObj).setPlaybackState(getRccStateFromState(state));
| public static void | unregisterRemoteControlClient(android.content.Context context, java.lang.Object rccObj)
AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
am.unregisterRemoteControlClient((RemoteControlClient) rccObj);
|
|