Class ITunesPlayList
- java.lang.Object
-
- com.tagtraum.beatunes.library.PlayListFacade
-
- com.tagtraum.beatunes.library.itunes.ITunesPlayList
-
- All Implemented Interfaces:
PlayList
,SyncTempoAware
,ListModel
public class ITunesPlayList extends PlayListFacade
ITunesPlayList.- 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 ITunesPlayList(PlayList playList, MediaLibrary musicLibrary)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 ignored, 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.AudioSong.Liking
getLiking()
protected void
invokeAndWaitInTunesUtilities(Runnable runnable)
static boolean
isDifferent(Object value1, Object value2)
int
moveSongs(int[] fromIndices, int toIndex)
Moves songs.void
removeAllSongs()
Removes all songs from this playlist.boolean
removeSongs(int... filteredIndex)
Removes the song with the given (filtered) index from the playlist.boolean
removeSongs(Collection<Long> ids, boolean completelyDeleteSongs)
Removes the songs with the given ids from the list.void
setAllItems(boolean allItems)
void
setAudiobooks(boolean audiobooks)
void
setChildPlayLists(List<PlayList> childPlayLists)
void
setDescription(String value)
void
setDistinguishedKind(PlayList.Kind distinguishedKind)
Allows setting of a special song type, likePlayList.Kind.PODCASTS
.void
setFolder(boolean folder)
void
setGeniusTrackID(int geniusTrackID)
void
setId(Long id)
Sets this list's id.void
setLiking(AudioSong.Liking value)
void
setMaster(boolean master)
void
setMovies(boolean movies)
void
setMusic(boolean music)
void
setName(String value)
void
setParentId(Long parentId)
Sets the parent id.void
setParentPlayList(PlayList value)
void
setPodcasts(boolean podcasts)
void
setPurchasedMusic(boolean purchasedMusic)
void
setSmartCriteria(String smartCriteria)
void
setSmartInfo(String smartInfo)
void
setSongIds(List<Long> songIds)
Removes all songs from this playlist and replaces them with song connected to the given ids.void
setSongs(List<AudioSong> songs)
Removes all songs from this playlist and replaces them with the given songs.void
setSpecialPlayListInfo(SpecialPlayListInfo value)
void
setTvShows(boolean tvShows)
void
setVideos(boolean videos)
-
Methods inherited from class com.tagtraum.beatunes.library.PlayListFacade
addListDataListener, addPropertyChangeListener, addPropertyChangeListener, canAddItem, canInsertItem, contains, countSongs, equals, filteredIndices, filteredListIterator, getChildPlayLists, getDescription, getDistinguishedKind, getElementAt, getFileSize, getFilteredSongIds, getFilteredSongs, getGeniusTrackID, getId, getIdAt, getIndexedSongIds, 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, removeListDataListener, removePropertyChangeListener, 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
-
ITunesPlayList
public ITunesPlayList(PlayList playList, MediaLibrary musicLibrary)
-
-
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)
-
getLiking
public AudioSong.Liking getLiking()
- Specified by:
getLiking
in interfacePlayList
- Overrides:
getLiking
in classPlayListFacade
-
setLiking
public void setLiking(AudioSong.Liking value)
-
setDescription
public void setDescription(String value)
-
setName
public void setName(String value)
-
setId
public void setId(Long id)
Description copied from interface:PlayList
Sets this list's id.- Parameters:
id
- id
-
setParentId
public void setParentId(Long parentId)
Description copied from interface:PlayList
Sets the parent id.- Parameters:
parentId
- id
-
setSpecialPlayListInfo
public void setSpecialPlayListInfo(SpecialPlayListInfo value)
-
setDistinguishedKind
public void setDistinguishedKind(PlayList.Kind distinguishedKind)
Description copied from interface:PlayList
Allows setting of a special song type, likePlayList.Kind.PODCASTS
.- Parameters:
distinguishedKind
- kind
-
setAudiobooks
public void setAudiobooks(boolean audiobooks)
Description copied from interface:PlayList
-
setMovies
public void setMovies(boolean movies)
-
setMusic
public void setMusic(boolean music)
Description copied from interface:PlayList
-
setTvShows
public void setTvShows(boolean tvShows)
Description copied from interface:PlayList
-
setPodcasts
public void setPodcasts(boolean podcasts)
Description copied from interface:PlayList
-
setParentPlayList
public void setParentPlayList(PlayList value)
-
setMaster
public void setMaster(boolean master)
-
setGeniusTrackID
public void setGeniusTrackID(int geniusTrackID)
-
setAllItems
public void setAllItems(boolean allItems)
-
setSmartInfo
public void setSmartInfo(String smartInfo)
-
setSmartCriteria
public void setSmartCriteria(String smartCriteria)
-
setVideos
public void setVideos(boolean videos)
-
setSongs
public void setSongs(List<AudioSong> songs)
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:
songs
- songs
-
setSongIds
public void setSongIds(List<Long> songIds)
Description copied from interface:PlayList
Removes all songs from this playlist and replaces them with song connected to the given ids.- Specified by:
setSongIds
in interfacePlayList
- Overrides:
setSongIds
in classPlayListFacade
- Parameters:
songIds
- song ids
-
addSongs
public void addSongs(int ignored, 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:
ignored
- 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
-
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
-
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
-
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 completelyDeleteSongs)
Description copied from interface:PlayList
Removes the songs with the given ids from the list.- Parameters:
ids
- idscompletelyDeleteSongs
- if set totrue
, the song object itself is deleted and removed from all other lists as well- Returns:
- success
-
removeAllSongs
public void removeAllSongs()
Description copied from interface:PlayList
Removes all songs from this playlist.- Specified by:
removeAllSongs
in interfacePlayList
- Overrides:
removeAllSongs
in classPlayListFacade
-
setFolder
public void setFolder(boolean folder)
-
setPurchasedMusic
public void setPurchasedMusic(boolean purchasedMusic)
-
invokeAndWaitInTunesUtilities
protected void invokeAndWaitInTunesUtilities(Runnable runnable)
-
-