Class PlayListFacade

    • Constructor Detail

    • Method Detail

      • getPlayList

        public PlayList getPlayList()
        Gets the PlayList this playlist is a facade for.
        Returns:
        wrapped playlist
      • getId

        public Long getId()
        Description copied from interface: PlayList
        This list's id.
        Specified by:
        getId in interface PlayList
        Returns:
        id
      • getParentId

        public Long getParentId()
        Description copied from interface: PlayList
        If this is a sub-folder/playlist, this returns the parent id.
        Specified by:
        getParentId in interface PlayList
        Returns:
        id
      • getPlayListPath

        public PlayList[] getPlayListPath()
        Description copied from interface: PlayList
        Returns path leading to this playlist and ending with it. I.e., the path has at least the length 1.
        Specified by:
        getPlayListPath in interface PlayList
        Returns:
        path of playlists
      • isMaster

        public boolean isMaster()
        Description copied from interface: PlayList
        Indicates whether this playlist is a master playlist. E.g. the (invisible list) Library is typically the master playlist.
        Specified by:
        isMaster in interface PlayList
        Returns:
        true or false
        See Also:
        PlayList.isLibrary()
      • isLibrary

        public boolean isLibrary()
        Description copied from interface: PlayList
        Indicates that this is a library playlist, meaning one of the top level library views (e.g. Music, AudioBooks, etc.).
        Specified by:
        isLibrary in interface PlayList
        Returns:
        true or false
        See Also:
        PlayList.isMaster()
      • isAllItems

        public boolean isAllItems()
        Specified by:
        isAllItems in interface PlayList
      • isVideos

        public boolean isVideos()
        Description copied from interface: PlayList
        iTunes 6 playlist attribute.
        Specified by:
        isVideos in interface PlayList
        Returns:
        true or false
      • getFilteredSongIds

        public List<Long> getFilteredSongIds()
        Description copied from interface: PlayList
        Returns song ids from this playlist, both sorted and filtered.
        Specified by:
        getFilteredSongIds in interface PlayList
        Returns:
        song ids
      • getIndexedSongIds

        public IndexedId[] getIndexedSongIds()
        Description copied from interface: PlayList
        A complete list of sorted ids along with their natural order indices (via IndexedId.getIndex()). Natural indices of filtered out objects are flipped: -(index+1)
        Specified by:
        getIndexedSongIds in interface PlayList
        Returns:
        a complete list of persistent ids along with their natural indices
      • getSongIds

        public List<Long> getSongIds()
        Description copied from interface: PlayList
        Returns song ids from this playlist, neither sorted not filtered.
        Specified by:
        getSongIds in interface PlayList
        Returns:
        song ids
      • getSongs

        public Iterable<AudioSong> getSongs()
        Description copied from interface: PlayList
        Returns songs from this playlist, neither sorted nor filtered.
        Specified by:
        getSongs in interface PlayList
        Returns:
        songs
      • getSongsOrderedBy

        public Iterable<AudioSong> getSongsOrderedBy​(String sortProperty,
                                                     PlayList.SortDirection direction,
                                                     int limit)
        Description copied from interface: PlayList
        Returns songs from this playlist, sorted by the given property.
        Specified by:
        getSongsOrderedBy in interface PlayList
        Parameters:
        sortProperty - property
        direction - direction
        limit - max number of songs to return
        Returns:
        songs
      • filteredListIterator

        public PlayListIterator<AudioSong> filteredListIterator​(int startIndex)
        Description copied from interface: PlayList
        Creates a dynamically updated iterator for this playlist. This iterator will adjust to sort/filter changes to the underlying playlist.
        The iterator does not support mutable operations.
        Specified by:
        filteredListIterator in interface PlayList
        Parameters:
        startIndex - index to start iterating from, first call to ListIterator.next() or ListIterator.previous() will produce the song at the given index
        Returns:
        read-only, dynamically adjusting list iterator
      • indexOf

        public int indexOf​(Long id)
        Description copied from interface: PlayList
        Returns the first index of the given song.
        Specified by:
        indexOf in interface PlayList
        Parameters:
        id - song id
        Returns:
        index or -1, if not found
      • 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 interface PlayList
        Parameters:
        songIds - song ids
      • removeAllSongs

        public void removeAllSongs()
        Description copied from interface: PlayList
        Removes all songs from this playlist.
        Specified by:
        removeAllSongs in interface PlayList
      • unfilteredIndices

        public int[] unfilteredIndices​(int... indices)
        Description copied from interface: PlayList
        Returns the unfiltered indices for the given filtered (string, order) indices.
        Specified by:
        unfilteredIndices in interface PlayList
        Parameters:
        indices - filtered indices
        Returns:
        unfiltered equivalents
      • filteredIndices

        public int[] filteredIndices​(int... unfilteredIndices)
        Description copied from interface: PlayList
        Returns the filtered indices (string, order) for the given unfiltered indices.
        Specified by:
        filteredIndices in interface PlayList
        Parameters:
        unfilteredIndices - unfiltered indices
        Returns:
        filtered equivalents or -1, if that does not exist, because the index was filtered out
      • getSong

        public AudioSong getSong​(int index)
        Description copied from interface: PlayList
        Returns song from the given index, taking sorting and filtering into account. This method may return null even if a corresponding song exists, because it is loaded asynchronously.
        Use PlayList.getIdAt(int), if you need a synchronous result.
        Specified by:
        getSong in interface PlayList
        Parameters:
        index - index
        Returns:
        song or null, if not in the cache or the index is bad
        See Also:
        PlayList.getIdAt(int)
      • getIdAt

        public Long getIdAt​(int index)
        Description copied from interface: PlayList
        Returns id of the song at the given index, taking sorting and filtering into account. Other than PlayList.getSong(int), this method always returns an id, if the index is valid.
        Specified by:
        getIdAt in interface PlayList
        Parameters:
        index - index
        Returns:
        id or null, if the index it not valid
        See Also:
        PlayList.getSong(int)
      • isFolder

        public boolean isFolder()
        Specified by:
        isFolder in interface PlayList
      • isUserPlaylist

        public boolean isUserPlaylist()
        Description copied from interface: PlayList
        Indicates that the playlist is just a regular user playlist. Note that Matchlists are not considered regular user playlists.
        Specified by:
        isUserPlaylist in interface PlayList
        Returns:
        true or false.
      • isItemsEditable

        public boolean isItemsEditable()
        Description copied from interface: PlayList
        Are the contained items editable? E.g., items are not editable, if they are only available online, as the metadata of some stream or online database cannot be changed locally.
        Specified by:
        isItemsEditable in interface PlayList
        Returns:
        true or false
      • canInsertItem

        public boolean canInsertItem()
        Description copied from interface: PlayList
        Indicates whether we can insert items into this playlist.
        Specified by:
        canInsertItem in interface PlayList
        Returns:
        true or false, typically false for generated lists like "Music"
      • canAddItem

        public boolean canAddItem()
        Description copied from interface: PlayList
        Indicates whether we can add items to this playlist.
        Specified by:
        canAddItem in interface PlayList
        Returns:
        true or false, typically false for generated lists like "Music"
      • isEditable

        public boolean isEditable()
        Description copied from interface: PlayList
        Is this playlist editable? Only playlists created by users are editable.
        Specified by:
        isEditable in interface PlayList
        Returns:
        true or false
      • getTotalTime

        public long getTotalTime()
        Description copied from interface: PlayList
        Get time with filters applied.
        Specified by:
        getTotalTime in interface PlayList
        Returns:
        time
      • getUnfilteredTime

        public long getUnfilteredTime()
        Description copied from interface: PlayList
        Get time without any filters applied.
        Specified by:
        getUnfilteredTime in interface PlayList
        Returns:
        time
      • getFileSize

        public long getFileSize()
        Description copied from interface: PlayList
        Get the sum of all file sizes (with filters applied).
        Specified by:
        getFileSize in interface PlayList
        Returns:
        sum of file sizes
      • isAggregateDataAvailable

        public boolean isAggregateDataAvailable()
        Description copied from interface: PlayList
        Indicates whether we currently have valid aggregate (total size, duration, etc.) data. If the data is not available, the asynchronous computation is triggered.
        Specified by:
        isAggregateDataAvailable in interface PlayList
        Returns:
        true or false
      • getSyncTempo

        public com.tagtraum.audiokern.bpm.Tempo getSyncTempo()
        Description copied from interface: PlayList
        When set to a non-null value, Key values are displayed as if the song was played back at the given tempo. This has consequences for the sort order.
        Specified by:
        getSyncTempo in interface PlayList
        Returns:
        sync tempo
        See Also:
        PlayList.setSortProperties(String...)
      • setSyncTempo

        public void setSyncTempo​(com.tagtraum.audiokern.bpm.Tempo syncTempo)
        Description copied from interface: PlayList
        When set to a non-null value, Key values are displayed as if the song was played back at the given tempo. This has consequences for the sort order.
        Specified by:
        setSyncTempo in interface PlayList
        Specified by:
        setSyncTempo in interface SyncTempoAware
        Parameters:
        syncTempo - sync tempo
      • getSortColumnProperty

        public String getSortColumnProperty()
        Description copied from interface: PlayList
        Returns the name of the single property the playlist is sorted by. Note that for special properties like 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.
        Specified by:
        getSortColumnProperty in interface PlayList
        Returns:
        column
      • getSortProperty

        public String getSortProperty​(int index)
        Description copied from interface: PlayList
        Actual sort property, used in ORDER BY SQL clauses.
        Specified by:
        getSortProperty in interface PlayList
        Parameters:
        index - index
        Returns:
        property or null
      • getSortProperties

        public String[] getSortProperties()
        Description copied from interface: PlayList
        Actual sort properties, used in ORDER BY HQL/SQL clauses.
        Specified by:
        getSortProperties in interface PlayList
        Returns:
        sort properties
      • getSubstringFilter

        public String getSubstringFilter()
        Description copied from interface: PlayList
        Current substring filter.
        Specified by:
        getSubstringFilter in interface PlayList
        Returns:
        filter string
      • setSortProperties

        public void setSortProperties​(String... properties)
        Description copied from interface: PlayList
        Sets sort properties.
        Specified by:
        setSortProperties in interface PlayList
        Parameters:
        properties - sort properties
      • setSubstringFilter

        public void setSubstringFilter​(String substring,
                                       PlayList.SubstringFilterProperty substringFilterProperty)
        Description copied from interface: PlayList
        Sets the filter and which property to filter in one swoop.
        Specified by:
        setSubstringFilter in interface PlayList
        Parameters:
        substring - filter string
        substringFilterProperty - property to filter
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object