Class FileSystemPlayList
- java.lang.Object
-
- com.tagtraum.beatunes.library.PlayListFacade
-
- com.tagtraum.beatunes.library.filesystem.FileSystemPlayList
-
- All Implemented Interfaces:
PlayList
,SyncTempoAware
,ListModel
public class FileSystemPlayList extends PlayListFacade
File system based playlist.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tagtraum.audiokern.PlayList
PlayList.Kind, PlayList.SortDirection, PlayList.SubstringFilterProperty
-
-
Field Summary
-
Fields inherited from class com.tagtraum.beatunes.library.PlayListFacade
executor, musicLibrary, playList
-
-
Constructor Summary
Constructors Constructor Description FileSystemPlayList(PlayList playList, MediaLibrary mediaLibrary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListDataListener(ListDataListener listener)
void
addSongIds(int filteredIndex, List<Long> songIds)
Adds the given songs at the given (filtered) index.void
addSongIds(List<Long> songIds)
Adds the songs referenced by the given ids to this playlist.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.void
addSongs(int filteredIndex, List<AudioSong> songs)
Adds the given songs at the given (filtered) index.<T> T
getImplementation(Class<T> klass)
PlayList
objects are sometimes implemented by an object that acts as a facade to other objects.int
moveSongs(int[] fromIndices, int toIndex)
Moves songs.void
removeListDataListener(ListDataListener listener)
boolean
removeSongs(int... filteredIndex)
Removes the song with the given (filtered) index from the playlist.boolean
removeSongs(Collection<Long> ids, boolean completelyDeleteSong)
Removes the songs with the given ids from the list.void
setAllItems(boolean value)
void
setAudiobooks(boolean value)
void
setChildPlayLists(List<PlayList> value)
void
setDescription(String value)
void
setDistinguishedKind(PlayList.Kind value)
Allows setting of a special song type, likePlayList.Kind.PODCASTS
.void
setFolder(boolean value)
void
setGeniusTrackID(int value)
void
setId(Long value)
Sets this list's id.void
setLiking(AudioSong.Liking value)
void
setMaster(boolean value)
void
setMovies(boolean value)
void
setMusic(boolean value)
void
setName(String value)
void
setParentId(Long value)
Sets the parent id.void
setParentPlayList(PlayList value)
void
setPodcasts(boolean value)
void
setPurchasedMusic(boolean value)
void
setSmartCriteria(String value)
void
setSmartInfo(String value)
void
setSongs(List<AudioSong> value)
Removes all songs from this playlist and replaces them with the given songs.void
setSpecialPlayListInfo(SpecialPlayListInfo value)
void
setTvShows(boolean value)
void
setVideos(boolean value)
-
Methods inherited from class com.tagtraum.beatunes.library.PlayListFacade
addPropertyChangeListener, addPropertyChangeListener, canAddItem, canInsertItem, contains, countSongs, equals, filteredIndices, filteredListIterator, getChildPlayLists, getDescription, getDistinguishedKind, getElementAt, getFileSize, getFilteredSongIds, getFilteredSongs, getGeniusTrackID, getId, getIdAt, getIndexedSongIds, getLiking, getName, getParentId, getParentPlayList, getPlayList, getPlayListPath, getSize, getSmartCriteria, getSmartInfo, getSong, getSongIds, getSongIds, getSongs, getSongs, getSongsOrderedBy, getSongsOrderedBy, getSortColumnProperty, getSortDirection, getSortProperties, getSortProperty, getSpecialPlayListInfo, getSpecialPlayListInfoId, getSubstringFilter, getSubstringFilterProperty, getSyncTempo, getTotalTime, getUnfilteredSize, getUnfilteredTime, hashCode, indexOf, isAggregateDataAvailable, isAllItems, isAudiobooks, isEditable, isFolder, isGeniusPlaylist, isItemsEditable, isLibrary, isMaster, isMovies, isMusic, isParentAFolder, isPodcasts, isPurchasedMusic, isSmartPlaylist, isSpecialPlayList, isTvShows, isUserPlaylist, isVideos, removeAllSongs, removePropertyChangeListener, setSongIds, setSortColumnProperty, setSortDirection, setSortProperties, setSubstringFilter, setSyncTempo, toString, unfilteredIndices
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tagtraum.audiokern.PlayList
contains, getSongsOrderedBy, indexOf, removeSongs
-
-
-
-
Constructor Detail
-
FileSystemPlayList
public FileSystemPlayList(PlayList playList, MediaLibrary mediaLibrary)
-
-
Method Detail
-
getImplementation
public <T> T getImplementation(Class<T> klass)
Description copied from interface:PlayList
PlayList
objects are sometimes implemented by an object that acts as a facade to other objects. For example, this could be a proxy for an AppleScript iTunes object or a persistent object that is stored in a local database via Hibernate. While normal calls to an object implementing this interface are routed according to some internal logic, using one of the actual implementation classes allows you precise control over what your call does.Note to plugin developers: It is hardly ever a good idea to exercise this control, unless you know exactly what you are doing. :-)
- Type Parameters:
T
- implementation class- Parameters:
klass
- class implementing PlayList- Returns:
- object of the desired type or
null
, if such an object is not available - See Also:
AudioSong.getImplementation(Class)
-
addListDataListener
public void addListDataListener(ListDataListener listener)
- Specified by:
addListDataListener
in interfaceListModel
- Overrides:
addListDataListener
in classPlayListFacade
-
removeListDataListener
public void removeListDataListener(ListDataListener listener)
- Specified by:
removeListDataListener
in interfaceListModel
- Overrides:
removeListDataListener
in classPlayListFacade
-
setName
public void setName(String value)
-
setDescription
public void setDescription(String value)
-
setLiking
public void setLiking(AudioSong.Liking value)
-
setId
public void setId(Long value)
Description copied from interface:PlayList
Sets this list's id.- Parameters:
value
- id
-
setParentId
public void setParentId(Long value)
Description copied from interface:PlayList
Sets the parent id.- Parameters:
value
- id
-
setSpecialPlayListInfo
public void setSpecialPlayListInfo(SpecialPlayListInfo value)
-
setDistinguishedKind
public void setDistinguishedKind(PlayList.Kind value)
Description copied from interface:PlayList
Allows setting of a special song type, likePlayList.Kind.PODCASTS
.- Parameters:
value
- kind
-
setAudiobooks
public void setAudiobooks(boolean value)
Description copied from interface:PlayList
-
setMovies
public void setMovies(boolean value)
-
setMusic
public void setMusic(boolean value)
Description copied from interface:PlayList
-
setTvShows
public void setTvShows(boolean value)
Description copied from interface:PlayList
-
setPodcasts
public void setPodcasts(boolean value)
Description copied from interface:PlayList
-
setParentPlayList
public void setParentPlayList(PlayList value)
-
setMaster
public void setMaster(boolean value)
-
setGeniusTrackID
public void setGeniusTrackID(int value)
-
setAllItems
public void setAllItems(boolean value)
-
setSmartInfo
public void setSmartInfo(String value)
-
setSmartCriteria
public void setSmartCriteria(String value)
-
setVideos
public void setVideos(boolean value)
-
setSongs
public void setSongs(List<AudioSong> value)
Description copied from interface:PlayList
Removes all songs from this playlist and replaces them with the given songs. If the songs are not in your library yet, corresponding entries in the database are created.- Parameters:
value
- songs
-
addSongs
public void addSongs(int filteredIndex, String... locations)
Description copied from interface:PlayList
Adds songs to the playlist using only their locations.
Depending on the library implementation, the insert index may be ignored. If it is ignored, the songs will be appended at the end (this is the case for iTunes libraries).- Parameters:
filteredIndex
- filtered index, set this to-1
, if you just want to add the song to the endlocations
- file or URL- See Also:
AudioSongLocation.getLocation()
-
addSongIds
public void addSongIds(List<Long> songIds)
Description copied from interface:PlayList
Adds the songs referenced by the given ids to this playlist.- Parameters:
songIds
- song ids
-
addSongIds
public void addSongIds(int filteredIndex, List<Long> songIds)
Description copied from interface:PlayList
Adds the given songs at the given (filtered) index.- Parameters:
filteredIndex
- filtered indexsongIds
- songs
-
addSongs
public void addSongs(int filteredIndex, List<AudioSong> songs)
Description copied from interface:PlayList
Adds the given songs at the given (filtered) index.- Parameters:
filteredIndex
- filtered indexsongs
- songs
-
moveSongs
public int moveSongs(int[] fromIndices, int toIndex)
Description copied from interface:PlayList
Moves songs. All indices have to be filtered.- Parameters:
fromIndices
- indices to move songs fromtoIndex
- index to move the songs to- Returns:
- new lead index of the moved songs
-
removeSongs
public boolean removeSongs(int... filteredIndex)
Description copied from interface:PlayList
Removes the song with the given (filtered) index from the playlist. If this is a library, the file is also deleted.- Parameters:
filteredIndex
- filtered indices- Returns:
- true, if the system was able to find and remove the given song
-
removeSongs
public boolean removeSongs(Collection<Long> ids, boolean completelyDeleteSong)
Description copied from interface:PlayList
Removes the songs with the given ids from the list.- Parameters:
ids
- idscompletelyDeleteSong
- if set totrue
, the song object itself is deleted and removed from all other lists as well- Returns:
- success
-
setFolder
public void setFolder(boolean value)
-
setPurchasedMusic
public void setPurchasedMusic(boolean value)
-
-