本文整理汇总了Java中org.videolan.vlc.MediaWrapper.getAlbum方法的典型用法代码示例。如果您正苦于以下问题:Java MediaWrapper.getAlbum方法的具体用法?Java MediaWrapper.getAlbum怎么用?Java MediaWrapper.getAlbum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.vlc.MediaWrapper
的用法示例。
在下文中一共展示了MediaWrapper.getAlbum方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCoverFromMediaStore
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
private static String getCoverFromMediaStore(Context context, MediaWrapper media) {
final String album = media.getAlbum();
if (album == null)
return null;
ContentResolver contentResolver = context.getContentResolver();
Uri uri = android.provider.MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Cursor cursor = contentResolver.query(uri, new String[] {
MediaStore.Audio.Albums.ALBUM,
MediaStore.Audio.Albums.ALBUM_ART },
MediaStore.Audio.Albums.ALBUM + " LIKE ?",
new String[] { album }, null);
if (cursor == null) {
// do nothing
} else if (!cursor.moveToFirst()) {
// do nothing
cursor.close();
} else {
int titleColumn = cursor.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART);
String albumArt = cursor.getString(titleColumn);
cursor.close();
return albumArt;
}
return null;
}
示例2: getCoverFromMediaStore
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
private static String getCoverFromMediaStore(Context context, MediaWrapper media) {
final String album = media.getAlbum();
if (album == null)
return null;
ContentResolver contentResolver = context.getContentResolver();
Uri uri = android.provider.MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Cursor cursor = contentResolver.query(uri, new String[]{
MediaStore.Audio.Albums.ALBUM,
MediaStore.Audio.Albums.ALBUM_ART},
MediaStore.Audio.Albums.ALBUM + " LIKE ?",
new String[]{album}, null);
if (cursor == null) {
// do nothing
} else if (!cursor.moveToFirst()) {
// do nothing
cursor.close();
} else {
int titleColumn = cursor.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART);
String albumArt = cursor.getString(titleColumn);
cursor.close();
return albumArt;
}
return null;
}
示例3: getCover
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
public static Bitmap getCover(Context context, ArrayList<MediaWrapper> list, int width, boolean fromMemCache) {
Bitmap cover = null;
LinkedList<String> testedAlbums = new LinkedList<String>();
for (MediaWrapper media : list) {
/* No list cover is artist or album are null */
if (media.getAlbum() == null || media.getArtist() == null)
continue;
if (testedAlbums.contains(media.getAlbum()))
continue;
cover = fromMemCache ? AudioUtil.getCoverFromMemCache(context, media, width) : AudioUtil.getCover(context, media, width);
if (cover != null)
break;
else if (media.getAlbum() != null)
testedAlbums.add(media.getAlbum());
}
return cover;
}
示例4: getCoverFromMemCache
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
public static Bitmap getCoverFromMemCache(Context context, MediaWrapper media, int width) {
if (media != null && media.getArtist() != null && media.getAlbum() != null) {
final BitmapCache cache = BitmapCache.getInstance();
return cache.getBitmapFromMemCache(getCoverCachePath(context, media, width));
} else
return null;
}
示例5: getMediaAlbum
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
public static String getMediaAlbum(Context ctx, MediaWrapper media) {
final String album = media.getAlbum();
return album != null ? album : getMediaString(ctx, R.string.unknown_album);
}