OSDN Git Service

3c9fe83be9c90cd52529b43e979d1c4fe040d95d
[android-x86/packages-apps-Eleven.git] / src / com / cyanogenmod / eleven / utils / SortOrder.java
1 /*
2  * Copyright (C) 2012 Andrew Neal
3  * Copyright (C) 2014 The CyanogenMod Project
4  * Licensed under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8  * or agreed to in writing, software distributed under the License is
9  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10  * KIND, either express or implied. See the License for the specific language
11  * governing permissions and limitations under the License.
12  */
13
14 package com.cyanogenmod.eleven.utils;
15
16 import android.provider.MediaStore;
17
18 /**
19  * Holds all of the sort orders for each list type.
20  * 
21  * @author Andrew Neal (andrewdneal@gmail.com)
22  */
23 public final class SortOrder {
24
25     /** This class is never instantiated */
26     public SortOrder() {
27     }
28
29     /**
30      * Artist sort order entries.
31      */
32     public static interface ArtistSortOrder {
33         /* Artist sort order A-Z */
34         public final static String ARTIST_A_Z = MediaStore.Audio.Artists.DEFAULT_SORT_ORDER;
35
36         /* Artist sort order Z-A */
37         public final static String ARTIST_Z_A = ARTIST_A_Z + " DESC";
38
39         /* Artist sort order number of songs */
40         public final static String ARTIST_NUMBER_OF_SONGS = MediaStore.Audio.Artists.NUMBER_OF_TRACKS
41                 + " DESC";
42
43         /* Artist sort order number of albums */
44         public final static String ARTIST_NUMBER_OF_ALBUMS = MediaStore.Audio.Artists.NUMBER_OF_ALBUMS
45                 + " DESC";
46     }
47
48     /**
49      * Album sort order entries.
50      */
51     public static interface AlbumSortOrder {
52         /* Album sort order A-Z */
53         public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
54
55         /* Album sort order Z-A */
56         public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
57
58         /* Album sort order songs */
59         public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Albums.NUMBER_OF_SONGS
60                 + " DESC";
61
62         /* Album sort order artist */
63         public final static String ALBUM_ARTIST = MediaStore.Audio.Albums.ARTIST;
64
65         /* Album sort order year */
66         public final static String ALBUM_YEAR = MediaStore.Audio.Albums.FIRST_YEAR + " DESC";
67
68     }
69
70     /**
71      * Song sort order entries.
72      */
73     public static interface SongSortOrder {
74         /* Song sort order A-Z */
75         public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
76
77         /* Song sort order Z-A */
78         public final static String SONG_Z_A = SONG_A_Z + " DESC";
79
80         /* Song sort order artist */
81         public final static String SONG_ARTIST = MediaStore.Audio.Media.ARTIST;
82
83         /* Song sort order album */
84         public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
85
86         /* Song sort order year */
87         public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
88
89         /* Song sort order duration */
90         public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
91
92         /* Song sort order date */
93         public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
94
95         /* Song sort order filename */
96         public final static String SONG_FILENAME = MediaStore.Audio.Media.DATA;
97     }
98
99     /**
100      * Album song sort order entries.
101      */
102     public static interface AlbumSongSortOrder {
103         /* Album song sort order A-Z */
104         public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
105
106         /* Album song sort order Z-A */
107         public final static String SONG_Z_A = SONG_A_Z + " DESC";
108
109         /* Album song sort order track list */
110         public final static String SONG_TRACK_LIST = MediaStore.Audio.Media.TRACK + ", "
111                 + MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
112
113         /* Album song sort order duration */
114         public final static String SONG_DURATION = SongSortOrder.SONG_DURATION;
115
116         /* Album song sort order filename */
117         public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
118     }
119
120     /**
121      * Artist song sort order entries.
122      */
123     public static interface ArtistSongSortOrder {
124         /* Artist song sort order A-Z */
125         public final static String SONG_A_Z = MediaStore.Audio.Media.DEFAULT_SORT_ORDER;
126
127         /* Artist song sort order Z-A */
128         public final static String SONG_Z_A = SONG_A_Z + " DESC";
129
130         /* Artist song sort order album */
131         public final static String SONG_ALBUM = MediaStore.Audio.Media.ALBUM;
132
133         /* Artist song sort order year */
134         public final static String SONG_YEAR = MediaStore.Audio.Media.YEAR + " DESC";
135
136         /* Artist song sort order duration */
137         public final static String SONG_DURATION = MediaStore.Audio.Media.DURATION + " DESC";
138
139         /* Artist song sort order date */
140         public final static String SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC";
141
142         /* Artist song sort order filename */
143         public final static String SONG_FILENAME = SongSortOrder.SONG_FILENAME;
144     }
145
146     /**
147      * Artist album sort order entries.
148      */
149     public static interface ArtistAlbumSortOrder {
150         /* Artist album sort order A-Z */
151         public final static String ALBUM_A_Z = MediaStore.Audio.Albums.DEFAULT_SORT_ORDER;
152
153         /* Artist album sort order Z-A */
154         public final static String ALBUM_Z_A = ALBUM_A_Z + " DESC";
155
156         /* Artist album sort order songs */
157         public final static String ALBUM_NUMBER_OF_SONGS = MediaStore.Audio.Artists.Albums.NUMBER_OF_SONGS
158                 + " DESC";
159
160         /* Artist album sort order year */
161         public final static String ALBUM_YEAR = MediaStore.Audio.Artists.Albums.FIRST_YEAR
162                 + " DESC";
163     }
164
165 }