Java Code Examples for android.media.RemoteController#MetadataEditor
The following examples show how to use
android.media.RemoteController#MetadataEditor .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MusicTile.java From GravityBox with Apache License 2.0 | 6 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor data) { mMetadata.trackTitle = data.getString(MediaMetadataRetriever.METADATA_KEY_TITLE, mMetadata.trackTitle); mMetadata.bitmap = data.getBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK, mMetadata.bitmap); mClientIdLost = false; if ((mMetadata.trackTitle != null && !mMetadata.trackTitle.equals(mCurrentTrack)) || (mMetadata.bitmap != null && !mMetadata.bitmap.sameAs(mCurrentBitmap))) { mCurrentTrack = mMetadata.trackTitle; mCurrentBitmap = mMetadata.bitmap; refreshState(); if (DEBUG) log(getKey() + ": onClientMetadataUpdate"); } }
Example 2
Source File: MediaController2KitKat.java From AcDisplay with GNU General Public License v2.0 | 6 votes |
/** * Updates {@link #mMetadata metadata} from given remote metadata class. * This also updates play state. * * @param data Object of metadata to update from, or {@code null} to clear local metadata. * @see #clearMetadata() */ private void updateMetadata(@Nullable RemoteController.MetadataEditor data) { if (data == null) { if (mMetadata.isEmpty()) return; mMetadata.clear(); } else { mMetadata.title = data.getString(MediaMetadataRetriever.METADATA_KEY_TITLE, null); mMetadata.artist = data.getString(MediaMetadataRetriever.METADATA_KEY_ARTIST, null); mMetadata.album = data.getString(MediaMetadataRetriever.METADATA_KEY_ALBUM, null); mMetadata.duration = data.getLong(MediaMetadataRetriever.METADATA_KEY_DURATION, -1); mMetadata.bitmap = data.getBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK, null); mMetadata.generateSubtitle(); } notifyOnMetadataChanged(); }
Example 3
Source File: RemoteControllerActivity.java From Android-RemoteController with Apache License 2.0 | 5 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { String artist = metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_ARTIST, "null"); String album = metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_ALBUM, "null"); String title = metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_TITLE, "null"); Long duration = metadataEditor.getLong(MediaMetadataRetriever.METADATA_KEY_DURATION, -1); Bitmap defaultCover = BitmapFactory.decodeResource(getResources(), android.R.drawable.ic_menu_compass); Bitmap bitmap = metadataEditor.getBitmap(RemoteController.MetadataEditor.BITMAP_KEY_ARTWORK, defaultCover); Log.e(TAG, "artist:" + artist + "album:" + album + "title:" + title + "duration:" + duration); Music music = new Music(); music.setCover(bitmap); music.setTitle(title); music.setArtist(artist); mMusicControlView.onClientMetadataUpdate(music); }
Example 4
Source File: NotificationListenerService.java From QuickLyric with GNU General Public License v3.0 | 5 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { // isRemoteControllerPlaying = true; durationObject = metadataEditor.getObject(MediaMetadataRetriever.METADATA_KEY_DURATION, 1200); //allow it to pass if not present artist = metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_ARTIST, metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, "")); track = metadataEditor.getString(MediaMetadataRetriever.METADATA_KEY_TITLE, ""); Bitmap artwork = metadataEditor.getBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK, null); mediaControllerCallback.saveArtwork(this, artwork, artist, track); }
Example 5
Source File: MusicNotificationListenerService.java From Android-RemoteController with Apache License 2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { if (mExternalClientUpdateListener != null) mExternalClientUpdateListener.onClientMetadataUpdate(metadataEditor); }
Example 6
Source File: MediaControllerService.java From Noyze with Apache License 2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { ((RemoteController.OnClientUpdateListener) mController).onClientMetadataUpdate(metadataEditor); }
Example 7
Source File: RemoteControlKitKat.java From Noyze with Apache License 2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { if (null == metadataEditor) return; metadataChanged(mediaMetadata(metadataEditor)); }
Example 8
Source File: MediaService.java From AcDisplay with GNU General Public License v2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { if (mExternalListener != null) { mExternalListener.onClientMetadataUpdate(metadataEditor); } }
Example 9
Source File: MediaController2KitKat.java From AcDisplay with GNU General Public License v2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { updateMetadata(metadataEditor); }
Example 10
Source File: MediaControllerService.java From Noyze with Apache License 2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { ((RemoteController.OnClientUpdateListener) mController).onClientMetadataUpdate(metadataEditor); }
Example 11
Source File: RemoteControlKitKat.java From Noyze with Apache License 2.0 | 4 votes |
@Override public void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor) { if (null == metadataEditor) return; metadataChanged(mediaMetadata(metadataEditor)); }