Class ITunesPlayList

    • 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)
      • 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
      • setDistinguishedKind

        public void setDistinguishedKind​(PlayList.Kind distinguishedKind)
        Description copied from interface: PlayList
        Allows setting of a special song type, like PlayList.Kind.PODCASTS.
        Parameters:
        distinguishedKind - kind
      • setMovies

        public void setMovies​(boolean movies)
      • setChildPlayLists

        public void setChildPlayLists​(List<PlayList> childPlayLists)
      • 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 interface PlayList
        Overrides:
        setSongIds in class PlayListFacade
        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 end
        locations - 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 index
        songs - 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 index
        songIds - 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 from
        toIndex - 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 - ids
        completelyDeleteSongs - if set to true, the song object itself is deleted and removed from all other lists as well
        Returns:
        success
      • setFolder

        public void setFolder​(boolean folder)
      • setPurchasedMusic

        public void setPurchasedMusic​(boolean purchasedMusic)
      • invokeAndWaitInTunesUtilities

        protected void invokeAndWaitInTunesUtilities​(Runnable runnable)
      • isDifferent

        public static boolean isDifferent​(Object value1,
                                          Object value2)