|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.ambient.library.LibraryUtils
public final class LibraryUtils
Library utility methods.
| Field Summary | |
|---|---|
static String[] |
COLUMN_NAMES
All column names in the tracks table. |
static String |
COLUMNS
All columns separated by commas. |
static FileFilter |
MUSIC_FILTER
Filters out all files except directories, playlist and track files. |
static FilenameFilter |
MUSIC_NAME_FILTER
Filters out all files except playlist and track files. |
static List<String> |
musicExtensions
Set of supported extensions of music (track and playlist) files, lower-case. |
static FileFilter |
PLAYLIST_FILTER
Filters out all files except directories and playlist files. |
static FilenameFilter |
PLAYLIST_NAME_FILTER
Filters out all files except playlist files. |
static List<String> |
playlistExtensions
Set of supported extensions of playlist files, lower-case. |
static FileFilter |
TRACK_FILTER
Filters out all files except directories and track files. |
static FilenameFilter |
TRACK_META_NAME_FILTER
Filters out all files except track files which the Entagged library supports. |
static FilenameFilter |
TRACK_NAME_FILTER
Filters out all files except track files. |
static List<String> |
trackExtensions
Set of supported extensions of track files, lower-case. |
static List<String> |
trackMetaExtensions
Set of supported extensions of track files, lower-case, which is the Entagged library able to process. |
static List<String> |
trackMime
MIME types for trackExtensions. |
| Method Summary | |
|---|---|
static TrackMetadataBean |
cursorToTrackBean(Cursor cursor)
Converts the sqlite3 ContentValues to the tag bean. |
static String |
fixId3Genre(String genre)
If the genre is in the form of (number), the string is
replaced by appropriate genre name. |
static String |
getMime(String fileName)
Returns MIME type for given file. |
static TrackMetadataBean |
getTag(String filename)
Retrieves a music file tag from given file name. |
static List<String> |
pollStrings(Cursor c,
char separator,
int column,
List<String> columnValues,
String... useAsNull)
Polls all tracks from given cursor. |
static List<TrackMetadataBean> |
pollTracks(Cursor c)
Polls all tracks from given cursor. |
static List<TrackMetadataBean> |
toTrackBean(List<SkreemRSong> songs)
Converts a list of SkreemRSong to a list of tag bean. |
static TrackMetadataBean |
toTrackBean(SkreemRSong song)
Converts the SkreemRSong to the tag bean. |
static ContentValues |
trackBeanToValues(TrackMetadataBean track)
Converts the track to ContentValues suitable for database insert. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] COLUMN_NAMES
tracks table.
public static final String COLUMNS
columns separated by commas.
public static final List<String> trackExtensions
public static final List<String> trackMime
trackExtensions.
public static final List<String> trackMetaExtensions
public static final List<String> playlistExtensions
public static final List<String> musicExtensions
public static final FilenameFilter TRACK_NAME_FILTER
public static final FilenameFilter TRACK_META_NAME_FILTER
public static final FileFilter TRACK_FILTER
public static final FilenameFilter PLAYLIST_NAME_FILTER
public static final FileFilter PLAYLIST_FILTER
public static final FilenameFilter MUSIC_NAME_FILTER
public static final FileFilter MUSIC_FILTER
| Method Detail |
|---|
public static TrackMetadataBean cursorToTrackBean(Cursor cursor)
ContentValues to the tag bean.
cursor - the content values object, must not be null.
Expects columns in COLUMN_NAMES ordering.
nullpublic static TrackMetadataBean toTrackBean(SkreemRSong song)
SkreemRSong to the tag bean.
song - the song.
nullpublic static List<TrackMetadataBean> toTrackBean(List<SkreemRSong> songs)
SkreemRSong to a list of tag bean.
songs - the song list.
nullpublic static ContentValues trackBeanToValues(TrackMetadataBean track)
ContentValues suitable for database insert.
track - the track to convert.
public static TrackMetadataBean getTag(String filename)
filename - the file to retrieve tags from.
null.public static String fixId3Genre(String genre)
(number), the string is
replaced by appropriate genre name.
genre - the genre to check
public static List<TrackMetadataBean> pollTracks(Cursor c)
DBStrategy.findByCriteria(java.util.Map, boolean, String)
method output.
c - the cursor
null, may be empty.
public static List<String> pollStrings(Cursor c,
char separator,
int column,
List<String> columnValues,
String... useAsNull)
DBStrategy.getCriteriaList(sk.baka.ambient.collection.CategoryEnum[], java.util.EnumMap)
method result.
c - the cursorseparator - if multiple columns are required, this character separates
them. In case of a single column, this parameter is ignored.column - put values of this column into the columnValues
list. Ignored when columnValues is
null.columnValues - put values from column here.useAsNull - if not null then this value is used instead of
null value.
null, may be
empty.public static String getMime(String fileName)
fileName - the file name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||