当前位置: 首页>>代码示例>>Java>>正文


Java MediaWrapper.getAlbum方法代码示例

本文整理汇总了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;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:25,代码来源:AudioUtil.java

示例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;
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:25,代码来源:AudioUtil.java

示例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;
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:19,代码来源:AudioUtil.java

示例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;
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:8,代码来源:AudioUtil.java

示例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);

}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:6,代码来源:Util.java


注:本文中的org.videolan.vlc.MediaWrapper.getAlbum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。