|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Database
The Database manages the Tracks and Playlists. How it works is down to the implementation but in general the rules are it must handle locking, as it will be read/ written to by multiple threads.
Method Summary | |
---|---|
void |
commit()
Commit any pending database changes (new or modified tracks) to the database. |
Track |
create(FieldMap map)
Create a new Track entry. |
ManualPlaylist |
createManualPlaylist()
Create a new ManualPlaylist |
SmartPlaylist |
createSmartPlaylist(java.lang.String filter)
Create a new ManualPlaylist |
Playlist |
getPlaylist(java.lang.String name)
Get the Playlist with the specified name. |
java.util.Collection<java.lang.String> |
getPlaylists()
Get the list of Playlist names |
int |
getRevision()
Return the revision number of the Database |
Track |
getTrack(int tracknumber)
Get the track with the specified track index |
java.util.Collection<Track> |
getTracks()
Return a read-only Collection with all the Tracks in the Database in arbirary order. |
java.util.List<Track> |
getTracks(java.lang.String sort,
java.lang.String filter)
Return a List of the tracks in the database with the specified sort order and filter. |
void |
lock(boolean hold)
Lock or unlock the database for edits. |
void |
putPlaylist(java.lang.String name,
Playlist playlist)
Store (possibly overwriting) the playlist with the specified name.\ If the value is null the playlist will be removed. |
int |
size()
Return the number of tracks in this Database |
void |
updateTrack(int tracknumber,
FieldMap changes)
Update the fields on the specified Track. |
Methods inherited from interface org.qtunes.core.Service |
---|
getContext, reportState, startService, stopService |
Method Detail |
---|
Track create(FieldMap map)
Matcher
, which will try to match the fields in the FieldMap
against the existing tracks. This may be done by Filename, by Inode or by
checksum of the audio data (for example). The fields are then stored
and the Track returned.
java.util.Collection<Track> getTracks()
java.util.List<Track> getTracks(java.lang.String sort, java.lang.String filter)
int getRevision()
int size()
Track getTrack(int tracknumber)
void commit()
Playlist getPlaylist(java.lang.String name)
java.util.Collection<java.lang.String> getPlaylists()
void putPlaylist(java.lang.String name, Playlist playlist)
void updateTrack(int tracknumber, FieldMap changes) throws java.io.IOException
java.io.IOException
ManualPlaylist createManualPlaylist()
SmartPlaylist createSmartPlaylist(java.lang.String filter)
void lock(boolean hold)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |