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


Java AudioColumns.IS_MUSIC属性代码示例

本文整理汇总了Java中android.provider.MediaStore.Audio.AudioColumns.IS_MUSIC属性的典型用法代码示例。如果您正苦于以下问题:Java AudioColumns.IS_MUSIC属性的具体用法?Java AudioColumns.IS_MUSIC怎么用?Java AudioColumns.IS_MUSIC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.MediaStore.Audio.AudioColumns的用法示例。


在下文中一共展示了AudioColumns.IS_MUSIC属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSongListForArtist

/**
 * @param context The {@link Context} to use.
 * @param id      The ID of the artist.
 * @return The song list for an artist.
 */
public static final long[] getSongListForArtist(final Context context, final long id) {
    final String[] projection = new String[]{
            BaseColumns._ID
    };
    final String selection = AudioColumns.ARTIST_ID + "=" + id + " AND "
            + AudioColumns.IS_MUSIC + "=1";
    Cursor cursor = context.getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection, null,
            AudioColumns.ALBUM_KEY + "," + AudioColumns.TRACK);
    if (cursor != null) {
        final long[] mList = getSongListForCursor(cursor);
        cursor.close();
        cursor = null;
        return mList;
    }
    return sEmptyList;
}
 
开发者ID:komamj,项目名称:KomaMusic,代码行数:22,代码来源:MusicUtils.java

示例2: getSongListForAlbum

/**
 * @param context The {@link Context} to use.
 * @param id      The ID of the album.
 * @return The song list for an album.
 */
public static final long[] getSongListForAlbum(final Context context, final long id) {
    final String[] projection = new String[]{
            BaseColumns._ID
    };
    final String selection = AudioColumns.ALBUM_ID + "=" + id + " AND " + AudioColumns.IS_MUSIC
            + "=1";
    Cursor cursor = context.getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection, null,
            AudioColumns.TRACK + ", " + MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
    if (cursor != null) {
        final long[] mList = getSongListForCursor(cursor);
        cursor.close();
        cursor = null;
        return mList;
    }
    return sEmptyList;
}
 
开发者ID:komamj,项目名称:KomaMusic,代码行数:22,代码来源:MusicUtils.java

示例3: getSongListForGenre

/**
 * @param context The {@link Context} to use.
 * @param id      The ID of the genre.
 * @return The song list for an genre.
 */
public static final long[] getSongListForGenre(final Context context, final long id) {
    final String[] projection = new String[]{
            BaseColumns._ID
    };
    String selection = (AudioColumns.IS_MUSIC + "=1") +
            " AND " + MediaColumns.TITLE + "!=''";
    final Uri uri = MediaStore.Audio.Genres.Members.getContentUri("external", Long.valueOf(id));
    Cursor cursor = context.getContentResolver().query(uri, projection, selection,
            null, null);
    if (cursor != null) {
        final long[] mList = getSongListForCursor(cursor);
        cursor.close();
        cursor = null;
        return mList;
    }
    return sEmptyList;
}
 
开发者ID:komamj,项目名称:KomaMusic,代码行数:22,代码来源:MusicUtils.java

示例4: getSongListForArtist

/**
 * @param context
 * @param id
 * @return
 */
public static long[] getSongListForArtist(Context context, long id) {
    final String[] projection = new String[] {
        BaseColumns._ID
    };
    String selection = AudioColumns.ARTIST_ID + "=" + id + " AND " + AudioColumns.IS_MUSIC
            + "=1";
    String sortOrder = AudioColumns.ALBUM_KEY + "," + AudioColumns.TRACK;
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    Cursor cursor = query(context, uri, projection, selection, null, sortOrder);
    if (cursor != null) {
        long[] list = getSongListForCursor(cursor);
        cursor.close();
        return list;
    }
    return sEmptyList;
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:21,代码来源:MusicUtils.java

示例5: getSongListForAlbum

/**
 * @param context
 * @param id
 * @return
 */
public static long[] getSongListForAlbum(Context context, long id) {
    final String[] projection = new String[] {
        BaseColumns._ID
    };
    String selection = AudioColumns.ALBUM_ID + "=" + id + " AND " + AudioColumns.IS_MUSIC
            + "=1";
    String sortOrder = AudioColumns.TRACK;
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    Cursor cursor = query(context, uri, projection, selection, null, sortOrder);
    if (cursor != null) {
        long[] list = getSongListForCursor(cursor);
        cursor.close();
        return list;
    }
    return sEmptyList;
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:21,代码来源:MusicUtils.java

示例6: getSongListForArtist

/**
 * @param context The {@link Context} to use.
 * @param id The ID of the artist.
 * @return The song list for an artist.
 */
public static final long[] getSongListForArtist(final Context context, final String id) {
    final String[] projection = new String[] {
        BaseColumns._ID
    };
    final String selection = AudioColumns.ARTIST_ID + "=" + id + " AND "
            + AudioColumns.IS_MUSIC + "=1";
    Cursor cursor = context.getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection, null,
            AudioColumns.ALBUM_KEY + "," + AudioColumns.TRACK);
    if (cursor != null) {
        final long[] mList = getSongListForCursor(cursor);
        cursor.close();
        cursor = null;
        return mList;
    }
    return sEmptyList;
}
 
开发者ID:micromacer,项目名称:Player-by-TweekProject,代码行数:22,代码来源:MusicUtils.java

示例7: getSongListForAlbum

/**
 * @param context The {@link Context} to use.
 * @param id The ID of the album.
 * @return The song list for an album.
 */
public static final long[] getSongListForAlbum(final Context context, final String id) {
    final String[] projection = new String[] {
        BaseColumns._ID
    };
    final String selection = AudioColumns.ALBUM_ID + "=" + id + " AND " + AudioColumns.IS_MUSIC
            + "=1";
    Cursor cursor = context.getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection, null,
            AudioColumns.TRACK + ", " + MediaStore.Audio.Media.DEFAULT_SORT_ORDER);
    if (cursor != null) {
        final long[] mList = getSongListForCursor(cursor);
        cursor.close();
        cursor = null;
        return mList;
    }
    return sEmptyList;
}
 
开发者ID:micromacer,项目名称:Player-by-TweekProject,代码行数:22,代码来源:MusicUtils.java

示例8: shuffleAll

/**
 * Shuffle all the tracks
 */
public void shuffleAll() {
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    String[] projection = new String[] {
        BaseColumns._ID
    };
    String selection = AudioColumns.IS_MUSIC + "=1";
    String sortOrder = "RANDOM()";
    Cursor cursor = MusicUtils.query(this, uri, projection, selection, null, sortOrder);
    if (cursor != null) {
        MusicUtils.shuffleAll(this, cursor);
        cursor.close();
        cursor = null;
    }
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:17,代码来源:MusicLibrary.java

示例9: suffle

public static void suffle(Context context) {
	Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
       String[] projection = new String[] {
           BaseColumns._ID
       };
       String selection = AudioColumns.IS_MUSIC + "=1";
       String sortOrder = "RANDOM()";
       Cursor cursor = MusicUtils.query(context, uri, projection, selection, null, sortOrder);
       if (cursor != null) {
           MusicUtils.shuffleAll(context, cursor);
           cursor.close();
           cursor = null;
       }
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:14,代码来源:MusicUtils.java

示例10: shuffleAll

/**
 * Shuffle all the tracks
 */
public void shuffleAll() {
    Uri uri = Audio.Media.EXTERNAL_CONTENT_URI;
    String[] projection = new String[] {
        BaseColumns._ID
    };
    String selection = AudioColumns.IS_MUSIC + "=1";
    String sortOrder = Audio.Media.DEFAULT_SORT_ORDER;
    Cursor cursor = MusicUtils.query(this, uri, projection, selection, null, sortOrder);
    if (cursor != null) {
        MusicUtils.shuffleAll(this, cursor);
        cursor.close();
        cursor = null;
    }
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:17,代码来源:MusicLibrary.java


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