public interface PlayList extends Serializable, ListModel
In prior versions, this interface returned Song
s instead of AudioSong
s.
Since beaTunes 3, this has been changed. This allows you to simply call setters and not worry about calling
ITunesMusicLibrary.store(com.tagtraum.audiokern.AudioSong, String)
- changes are
persisted automatically in the internal database, iTunes (or whatever other audioplayer) as well as the file.
ITunesMusicLibrary
Modifier and Type | Interface and Description |
---|---|
static class |
PlayList.Kind
Kinds of playlists.
|
static class |
PlayList.SortDirection |
static class |
PlayList.SubstringFilterProperty
SubstringFilterProperty.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener propertyChangeListener) |
void |
addPropertyChangeListener(String property,
PropertyChangeListener propertyChangeListener) |
void |
addSongIds(int filteredIndex,
List<Long> songIds)
Adds the given songs at the given (filtered) index.
|
void |
addSongIds(List<Long> songIds) |
void |
addSongs(int filteredIndex,
List<AudioSong> songs)
Adds the given songs at the given (filtered) index.
|
void |
addSongs(int filteredIndex,
String... locations)
Adds songs to the playlist using only their locations.
Depending on the library implementation, the insert index may be ignored. |
boolean |
canAddItem()
Indicates whether we can add items to this playlist.
|
boolean |
canInsertItem()
Indicates whether we can insert items into this playlist.
|
default boolean |
contains(AudioSong song) |
boolean |
contains(Long id) |
int |
countSongs(Collection<? extends SongFilter> filters) |
int |
countSongs(SongFilter filter) |
int[] |
filteredIndices(int... unfilteredIndices)
Returns the filtered indices (string, order) for the given unfiltered indices.
|
PlayListIterator<AudioSong> |
filteredListIterator(int startIndex)
Creates a dynamically updated iterator for this playlist.
|
List<PlayList> |
getChildPlayLists() |
PlayList.Kind |
getDistinguishedKind() |
long |
getFileSize()
Get the sum of all file sizes (with filters applied).
|
List<Long> |
getFilteredSongIds()
Returns song ids from this playlist, both sorted and filtered.
|
Iterable<AudioSong> |
getFilteredSongs()
Returns songs from this playlist, both sorted and filtered.
|
int |
getGeniusTrackID() |
Long |
getId() |
Long |
getIdAt(int index)
Returns id of the song at the given index, taking sorting and filtering into account.
|
<T> T |
getImplementation(Class<T> klass) |
IndexedId[] |
getIndexedSongIds()
A complete list of sorted ids along with their natural order indices (via
IndexedId.getIndex() ). |
MatchListInfo |
getMatchListInfo() |
Long |
getMatchListInfoId() |
String |
getName() |
Long |
getParentId() |
PlayList |
getParentPlayList() |
PlayList[] |
getPlayListPath()
Returns path leading to this playlist and ending with it.
|
String |
getSmartCriteria() |
String |
getSmartInfo() |
AudioSong |
getSong(int index)
Returns song from the given index, taking sorting and filtering into account.
|
List<Long> |
getSongIds()
Returns song ids from this playlist, neither sorted not filtered.
|
List<Long> |
getSongIds(Set<? extends SongFilter> filters)
Returns song ids from this playlist, filtered with the given filters.
|
Iterable<AudioSong> |
getSongs()
Returns songs from this playlist, neither sorted not filtered.
|
List<AudioSong> |
getSongs(Collection<? extends SongFilter> filters,
int limit)
Returns songs from this playlist, filtered with the given filters.
|
Iterable<AudioSong> |
getSongs(String sortProperty)
Returns songs from this playlist, sorted by the given property.
|
String |
getSortColumnProperty()
Returns the name of the single property the playlist is sorted by.
|
PlayList.SortDirection |
getSortDirection()
Return sort direction.
|
String[] |
getSortProperties()
Actual sort properties, used in
ORDER BY SQL clauses. |
String |
getSortProperty(int index)
Actual sort property, used in
ORDER BY SQL clauses. |
String |
getSubstringFilter() |
PlayList.SubstringFilterProperty |
getSubstringFilterProperty() |
long |
getTotalTime()
Get time with filters applied.
|
int |
getUnfilteredSize()
Unfiltered number of songs in playlist.
|
long |
getUnfilteredTime()
Get time without any filters applied.
|
default int |
indexOf(AudioSong song)
Returns the first index of the given song.
|
int |
indexOf(Long id)
Returns the first index of the given song.
|
boolean |
isAggregateDataAvailable()
Indicates whether this we currently have valid aggregate (total size, duration, etc.) data.
|
boolean |
isAllItems() |
boolean |
isAudiobooks() |
boolean |
isEditable()
Is this playlist editable? Only playlists created by users are editable.
|
boolean |
isFolder() |
boolean |
isGeniusPlaylist() |
boolean |
isLibrary()
Indicates that this is a library playlist, meaning one of the top level library
views (e.g.
|
boolean |
isMaster()
Indicates whether this playlist is a master playlist.
|
boolean |
isMatchList() |
boolean |
isMovies() |
boolean |
isMusic() |
boolean |
isParentAFolder() |
boolean |
isPartyShuffle()
Deprecated.
|
boolean |
isPodcasts() |
boolean |
isPurchasedMusic() |
boolean |
isSmartPlaylist() |
boolean |
isTvShows() |
boolean |
isUserPlaylist()
Indicates that the playlist is just a regular user playlist.
|
boolean |
isVideos()
Deprecated.
|
int |
moveSongs(int[] fromIndices,
int toIndex)
Moves songs.
|
void |
removePropertyChangeListener(PropertyChangeListener propertyChangeListener) |
boolean |
removeSongs(Collection<Long> ids)
Removes the songs with the given ids from the list.
|
boolean |
removeSongs(int... filteredIndex)
Removes the song with the given (filtered) index from the playlist.
|
void |
setAllItems(boolean allItems) |
void |
setAudiobooks(boolean audiobooks) |
void |
setChildPlayLists(List<PlayList> childPlayLists) |
void |
setDistinguishedKind(PlayList.Kind distinguishedKind) |
void |
setFolder(boolean folder) |
void |
setGeniusTrackID(int geniusTrackID) |
void |
setId(Long id) |
void |
setMaster(boolean master) |
void |
setMatchListInfo(MatchListInfo matchListInfo) |
void |
setMovies(boolean movies) |
void |
setMusic(boolean music) |
void |
setName(String name) |
void |
setParentId(Long parentId) |
void |
setParentPlayList(PlayList parentPlayList) |
void |
setPartyShuffle(boolean partyShuffle)
Deprecated.
|
void |
setPodcasts(boolean podcasts) |
void |
setPurchasedMusic(boolean purchasedMusic) |
void |
setSmartCriteria(String smartCriteria) |
void |
setSmartInfo(String smartInfo) |
void |
setSongs(List<AudioSong> songs) |
void |
setSortColumnProperty(String property)
Sets "visual/semantic" sort property.
|
void |
setSortDirection(PlayList.SortDirection sortDirection)
Sort direction.
|
void |
setSortProperties(String... properties)
Sets sort properties.
|
void |
setSubstringFilter(String substring,
PlayList.SubstringFilterProperty substringFilterProperty) |
void |
setTvShows(boolean tvShows) |
void |
setVideos(boolean videos)
Deprecated.
|
int[] |
unfilteredIndices(int... filteredIndices)
Returns the unfiltered indices for the given filtered (string, order) indices.
|
addListDataListener, getElementAt, getSize, removeListDataListener
<T> T getImplementation(Class<T> klass)
void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
Long getId()
void setId(Long id)
Long getParentId()
void setParentId(Long parentId)
MatchListInfo getMatchListInfo()
Long getMatchListInfoId()
void setMatchListInfo(MatchListInfo matchListInfo)
boolean isMatchList()
PlayList.Kind getDistinguishedKind()
void setDistinguishedKind(PlayList.Kind distinguishedKind)
boolean isAudiobooks()
void setAudiobooks(boolean audiobooks)
boolean isMovies()
void setMovies(boolean movies)
boolean isMusic()
void setMusic(boolean music)
boolean isTvShows()
void setTvShows(boolean tvShows)
@Deprecated boolean isPartyShuffle()
@Deprecated void setPartyShuffle(boolean partyShuffle)
boolean isPodcasts()
void setPodcasts(boolean podcasts)
PlayList getParentPlayList()
void setParentPlayList(PlayList parentPlayList)
PlayList[] getPlayListPath()
String getName()
void setName(String name)
boolean isMaster()
isLibrary()
void setMaster(boolean master)
boolean isLibrary()
isMaster()
int getGeniusTrackID()
void setGeniusTrackID(int geniusTrackID)
boolean isGeniusPlaylist()
boolean isAllItems()
void setAllItems(boolean allItems)
String getSmartInfo()
void setSmartInfo(String smartInfo)
boolean isSmartPlaylist()
String getSmartCriteria()
void setSmartCriteria(String smartCriteria)
@Deprecated boolean isVideos()
@Deprecated void setVideos(boolean videos)
List<Long> getFilteredSongIds()
List<Long> getSongIds()
IndexedId[] getIndexedSongIds()
IndexedId.getIndex()
).
Natural indices of filtered out objects are flipped: -(index+1)
List<Long> getSongIds(Set<? extends SongFilter> filters)
Iterable<AudioSong> getSongs()
Iterable<AudioSong> getSongs(String sortProperty)
sortProperty
- propertyList<AudioSong> getSongs(Collection<? extends SongFilter> filters, int limit)
filters
- filterslimit
- limit, -1 for no limitIterable<AudioSong> getFilteredSongs()
PlayListIterator<AudioSong> filteredListIterator(int startIndex)
startIndex
- index to start iterating from, first call to ListIterator.next()
or ListIterator.previous()
will produce the song at the given indexint countSongs(SongFilter filter)
int countSongs(Collection<? extends SongFilter> filters)
void addSongs(int filteredIndex, String... locations)
filteredIndex
- filtered index, set this to -1
, if you just want to add the song to the endlocations
- file or URLAudioSongLocation.getLocation()
void addSongs(int filteredIndex, List<AudioSong> songs)
filteredIndex
- filtered indexsongs
- songsvoid addSongIds(int filteredIndex, List<Long> songIds)
filteredIndex
- filtered indexsongIds
- songsint moveSongs(int[] fromIndices, int toIndex)
fromIndices
- indices to move songs fromtoIndex
- index to move the songs toint getUnfilteredSize()
-1
, if the number is unknownsetSubstringFilter(String, com.tagtraum.beatunes.library.PlayList.SubstringFilterProperty)
int[] unfilteredIndices(int... filteredIndices)
filteredIndices
- filtered indicesint[] filteredIndices(int... unfilteredIndices)
unfilteredIndices
- unfiltered indices-1
, if that does not exist, because the index was filtered outint indexOf(Long id)
id
- song id-1
, if not founddefault int indexOf(AudioSong song)
song
- song-1
, if not foundboolean removeSongs(int... filteredIndex)
filteredIndex
- filtered indicesboolean removeSongs(Collection<Long> ids)
ids
- idsAudioSong getSong(int index)
null
even if a corresponding song, because it is
loaded asynchronously.
getIdAt(int)
, if you need a synchronous result.index
- indexnull
, if not in the cache or the index is badgetIdAt(int)
Long getIdAt(int index)
getSong(int)
, this method always returns an id, if the index is valid.index
- indexgetSong(int)
boolean contains(Long id)
default boolean contains(AudioSong song)
boolean isFolder()
boolean isParentAFolder()
void setFolder(boolean folder)
boolean isUserPlaylist()
boolean isPurchasedMusic()
void setPurchasedMusic(boolean purchasedMusic)
boolean canInsertItem()
boolean canAddItem()
boolean isEditable()
long getTotalTime()
long getUnfilteredTime()
long getFileSize()
boolean isAggregateDataAvailable()
String getSortColumnProperty()
name
this may not be
the same properties as the ones we use for ORDER BY
SQL
clauses. But, it's the property that should be highlighted in a
UI.void setSortColumnProperty(String property)
property
- name of the property that is marked as sorted-by in the UIgetSortColumnProperty()
String getSortProperty(int index)
ORDER BY
SQL clauses.index
- indexnull
String[] getSortProperties()
ORDER BY
SQL clauses.void setSortProperties(String... properties)
properties
- sort propertiesvoid setSortDirection(PlayList.SortDirection sortDirection)
sortDirection
- sort directionPlayList.SortDirection getSortDirection()
String getSubstringFilter()
void setSubstringFilter(String substring, PlayList.SubstringFilterProperty substringFilterProperty)
PlayList.SubstringFilterProperty getSubstringFilterProperty()
Copyright © 2006–2017 tagtraum industries incorporated. All rights reserved.