Class ITunesAudioSong

    • Constructor Detail

      • ITunesAudioSong

        public ITunesAudioSong​(Song song,
                               MediaLibrary musicLibrary)
    • Method Detail

      • getImplementation

        public <T> T getImplementation​(Class<T> klass)
        Description copied from interface: AudioSong

        AudioSong objects are sometimes implemented by an object that acts as a facade to other AudioSong objects. This could be a proxy for an AppleScript iTunes object, a a persistent object that is stored in a local database via Hibernate, or perhaps an Object that is capable of writing id3 tags directly (e.g. AudioMetaData). While normal calls on 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 AudioSong
        Returns:
        object of the desired type or null, if such an object is not available
        See Also:
        PlayList.getImplementation(Class)
      • getCloudStatus

        public AudioSong.CloudStatus getCloudStatus()
        Description copied from interface: AudioSong
        Returns the cloud status, if available. Note that this call may be expensive, as it requires calling the iTunes API.
        Returns:
        the status if available, null, if the feature is not supported (Windows, non-iTunes libraries, ...)
      • setName

        public void setName​(String value)
        Description copied from interface: AudioSong
        Sets name.
        Parameters:
        value - name
      • setDescription

        public void setDescription​(String value)
        Description copied from interface: AudioSong
        Sets description/subtitle.
        Parameters:
        value - description
      • setWork

        public void setWork​(String value)
        Description copied from interface: AudioSong
        Classical work.
        Parameters:
        value - work
      • setMovement

        public void setMovement​(String value)
        Description copied from interface: AudioSong
        Classical movement.
        Parameters:
        value - movement
      • setMovementNumber

        public void setMovementNumber​(int value)
        Description copied from interface: AudioSong
        Classical movement number.
        Parameters:
        value - number
      • setMovementCount

        public void setMovementCount​(int value)
        Description copied from interface: AudioSong
        Classical movement count.
        Parameters:
        value - count
      • setArtist

        public void setArtist​(String value)
        Description copied from interface: AudioSong
        Sets artist.
        Parameters:
        value - artist
      • setAlbumArtist

        public void setAlbumArtist​(String value)
        Description copied from interface: AudioSong
        Sets the album artist.
        Parameters:
        value - album artist
      • getLyrics

        public String getLyrics()
        Description copied from interface: AudioSong
        Returns the lyrics.
        Returns:
        lyrics
      • setLyrics

        public void setLyrics​(String value)
        Description copied from interface: AudioSong
        Sets lyrics.
        Parameters:
        value - lyrics
      • setComposer

        public void setComposer​(String value)
        Description copied from interface: AudioSong
        Sets composer.
        Parameters:
        value - composer
      • setAlbum

        public void setAlbum​(String value)
        Description copied from interface: AudioSong
        Sets album name.
        Parameters:
        value - album
      • setGrouping

        public void setGrouping​(String value)
        Description copied from interface: AudioSong
        Sets the grouping.
        Parameters:
        value - grouping
      • setGenre

        public void setGenre​(String value)
        Description copied from interface: AudioSong
        Sets genre.
        Parameters:
        value - genre
      • setKind

        public void setKind​(String value)
        Description copied from interface: AudioSong
        Allows you to store a String descriptor of the kind of audio object this is. Typically this value is read-only (with AudioSong.getKind()) and set by the music player, e.g. iTunes.
        Parameters:
        value - kind
        See Also:
        AudioSong.getKind()
      • setStartTime

        public void setStartTime​(int value)
        Description copied from interface: AudioSong
        Set start time in ms.
        Parameters:
        value - start time in ms
      • setStopTime

        public void setStopTime​(int value)
        Description copied from interface: AudioSong
        Sets stop time.
        Parameters:
        value - stop time in ms
      • setStart

        public void setStart​(float value)
        Description copied from interface: AudioSong
        Sets the start time in seconds.
        Parameters:
        value - start time in seconds
        See Also:
        AudioSong.setStartTime(int)
      • setFinish

        public void setFinish​(float value)
        Description copied from interface: AudioSong
        Sets the stop time in seconds.
        Parameters:
        value - stop time in seconds
        See Also:
        AudioSong.setStopTime(int)
      • setTrackCount

        public void setTrackCount​(int value)
        Description copied from interface: AudioSong
        Set track count
        Parameters:
        value - track count
        See Also:
        AudioSong.setTrackNumber(int)
      • setTrackNumber

        public void setTrackNumber​(int value)
        Description copied from interface: AudioSong
        Set the number of this track.
        Parameters:
        value - track number
      • setDiscNumber

        public void setDiscNumber​(int value)
        Description copied from interface: AudioSong
        Sets the disc number.
        Parameters:
        value - disc number
      • setDiscCount

        public void setDiscCount​(int value)
        Description copied from interface: AudioSong
        Set disc count.
        Parameters:
        value - disc count
      • setVolumeAdjustment

        public void setVolumeAdjustment​(int value)
        Description copied from interface: AudioSong
        Sets the volume adjustment
        Parameters:
        value - value between -255 and 255.
      • setComments

        public void setComments​(String value)
        Description copied from interface: AudioSong
        Set comments.
        Parameters:
        value - comments
      • setPlayCount

        public void setPlayCount​(int value)
        Description copied from interface: AudioSong
        Set play count.
        Parameters:
        value - play count
      • setPlayDate

        public void setPlayDate​(long value)
        Description copied from interface: AudioSong
        Set play date in milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!).
        Parameters:
        value - play date
      • setPlayDateUTC

        public void setPlayDateUTC​(Date value)
        Description copied from interface: AudioSong
        Set play time.
        Parameters:
        value - play time
      • setSkipCount

        public void setSkipCount​(int value)
        Description copied from interface: AudioSong
        Set skip count.
        Parameters:
        value - skip count
      • setSkipDate

        public void setSkipDate​(Date value)
        Description copied from interface: AudioSong
        Set skip date.
        Parameters:
        value - skip date
      • setReleaseDate

        public void setReleaseDate​(Date value)
        Description copied from interface: AudioSong
        Set release date.
        Parameters:
        value - release date
      • setDateAnalyzed

        public void setDateAnalyzed​(Date value)
        Description copied from interface: AudioSong
        Sets the date this song was last analyzed.
        Parameters:
        value - date of last analysis
      • getFrontCoverImage

        public Image getFrontCoverImage()
        Description copied from interface: AudioSong
        Returns the first front cover image.
        Returns:
        image or null
      • getBackCoverImage

        public Image getBackCoverImage()
        Description copied from interface: AudioSong
        Returns the first front cover image.
        Returns:
        image or null
      • getImages

        public Image[] getImages()
        Description copied from interface: AudioSong
        All images.
        Returns:
        images or empty array, never returns null
      • getArtworks

        public AudioArtwork[] getArtworks()
        Description copied from interface: AudioSong
        Artwork belonging to this song.
        Returns:
        array of artworks
      • addArtwork

        public void addArtwork​(AudioArtwork audioArtwork)
        Description copied from interface: AudioSong
        Adds an artwork/image to the audio song.
        Parameters:
        audioArtwork - artwork
      • setArtworks

        public void setArtworks​(AudioArtwork... audioArtworks)
        Description copied from interface: AudioSong
        Set artworks belonging to this track.
        Parameters:
        audioArtworks - artworks
      • setRating

        public void setRating​(int value)
        Description copied from interface: AudioSong
        Sets the rating
        Parameters:
        value - rating between from 0 to 100
        See Also:
        AudioSong.getRating()
      • setAlbumRating

        public void setAlbumRating​(int value)
        Description copied from interface: AudioSong
        Sets album rating.
        Parameters:
        value - album rating
      • setInstrumentation

        public void setInstrumentation​(AudioSong.Instrumentation instrumentation)
        Description copied from interface: AudioSong
        Sets the instrumentation property.
        Parameters:
        instrumentation - instrumentation
      • setInstrumentationAlgorithm

        public void setInstrumentationAlgorithm​(String instrumentationAlgorithm)
        Description copied from interface: AudioSong
        Set the instrumentation algorithm. Should be Entered, if the value was entered manually.
        Parameters:
        instrumentationAlgorithm - instrumentation algorithm
      • setDanceability

        public void setDanceability​(Float value)
        Description copied from interface: AudioSong
        Danceability.
        Parameters:
        value - normalized positive value (0-1)
      • setDanceabilityAlgorithm

        public void setDanceabilityAlgorithm​(String value)
        Description copied from interface: AudioSong
        Set the danceability algorithm. Should be Entered, if the value was entered manually.
        Parameters:
        value - danceability algorithm
      • setLiking

        public void setLiking​(AudioSong.Liking value)
        Description copied from interface: AudioSong
        Set liking.
        Parameters:
        value - liking
      • setAlbumLiking

        public void setAlbumLiking​(AudioSong.Liking value)
        Description copied from interface: AudioSong
        Set album liking.
        Parameters:
        value - liking
      • setShow

        public void setShow​(String value)
        Description copied from interface: AudioSong
        Set show name.
        Parameters:
        value - show
      • setSeason

        public void setSeason​(int value)
        Description copied from interface: AudioSong
        Set season.
        Parameters:
        value - season
      • setEpisode

        public void setEpisode​(String value)
        Description copied from interface: AudioSong
        Set episode name.
        Parameters:
        value - episode name
      • setEpisodeOrder

        public void setEpisodeOrder​(int value)
        Description copied from interface: AudioSong
        Set episode order.
        Parameters:
        value - episode order
      • setCompilation

        public void setCompilation​(boolean value)
        Description copied from interface: AudioSong
        Marks this song as part of a compilation (or not).
        Parameters:
        value - true or false
      • setEnabled

        public void setEnabled​(boolean value)
        Description copied from interface: AudioSong
        Enables/disables this song.
        Parameters:
        value - true or false
      • setUnplayed

        public void setUnplayed​(boolean value)
        Description copied from interface: AudioSong
        Sets unplayed.
        Parameters:
        value - unplayed
      • setClean

        public void setClean​(boolean value)
        Description copied from interface: AudioSong
        Sets the "clean" flag. "Clean" and "explicit" are mutually exclusive.
        Parameters:
        value - true or false
        See Also:
        AudioSong.setExplicit(boolean)
      • setHasVideo

        public void setHasVideo​(boolean value)
        Description copied from interface: AudioSong
        Sets the "video" flag.
        Parameters:
        value - true or false
      • setLocation

        public void setLocation​(String value)
        Description copied from interface: AudioSong
        Sets the location.
        Parameters:
        value - location
      • getLocation

        public String getLocation​(boolean refresh)
        Description copied from interface: AudioSong
        Location of this track. If refresh is true and no location is available or the resource does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct path. Because of the backend call, this method may block and therefore should be called from the EDT.
        Specified by:
        getLocation in interface AudioSong
        Overrides:
        getLocation in class AudioSongFacade
        Parameters:
        refresh - refresh from backend
        Returns:
        location
        See Also:
        AudioSong.getLocation(), AudioSong.getFile(boolean)
      • getFile

        public Path getFile​(boolean refresh)
        Description copied from interface: AudioSong
        File of this track. If refresh is true and the file does not exist anymore, ask the backend app (iTunes, Music.app, ...) for the correct file name. Because of the backend call, this method may block and therefore should be called from the EDT.
        Parameters:
        refresh - refresh from backend
        Returns:
        file object for AudioSong.getLocation() or null, if a proper file object cannot be formed
        See Also:
        AudioSong.getLocation(), AudioSong.getLocation(boolean)
      • setPartOfGaplessAlbum

        public void setPartOfGaplessAlbum​(boolean value)
        Description copied from interface: AudioSong
        Sets the "gapless album" flag.
        Parameters:
        value - true or false
      • setExplicit

        public void setExplicit​(boolean value)
        Description copied from interface: AudioSong
        Sets the "explicit" flag. "Clean" and "explicit" are mutually exclusive.
        Parameters:
        value - true or false
        See Also:
        AudioSong.setClean(boolean)
      • setHD

        public void setHD​(boolean value)
        Description copied from interface: AudioSong
        Sets the HD flag.
        Parameters:
        value - true or false
      • setSortArtist

        public void setSortArtist​(String value)
        Description copied from interface: AudioSong
        Sets the sort artist.
        Parameters:
        value - sort artist
      • setSortAlbum

        public void setSortAlbum​(String value)
        Description copied from interface: AudioSong
        Sets the sort album.
        Parameters:
        value - sort album
      • setSortName

        public void setSortName​(String value)
        Description copied from interface: AudioSong
        Sets the sort name.
        Parameters:
        value - sort name
      • setSortAlbumArtist

        public void setSortAlbumArtist​(String value)
        Description copied from interface: AudioSong
        Sets the sort album artist.
        Parameters:
        value - sort album artist
      • setSortComposer

        public void setSortComposer​(String value)
        Description copied from interface: AudioSong
        Sets the sort composer.
        Parameters:
        value - sort composer
      • setSortShow

        public void setSortShow​(String value)
        Description copied from interface: AudioSong
        Sets the sort show.
        Parameters:
        value - sort show
      • setContentRating

        public void setContentRating​(String value)
        Description copied from interface: AudioSong
        Sets the content rating.
        Parameters:
        value - content rating
      • setTempo

        public void setTempo​(com.tagtraum.audiokern.bpm.Tempo value)
        Description copied from interface: AudioSong
        Sets the tempo.
        Parameters:
        value - tempo
      • setTags

        public void setTags​(Set<String> value)
        Description copied from interface: AudioSong
        Sets a new set of tags.
        Parameters:
        value - set of strings
      • getTags

        public Set<String> getTags()
        Description copied from interface: AudioSong
        Returns a set of tags associated with this song. To manipulate this song's tag, please use AudioSong.setTags(java.util.Set) and don't manipulate the returned set.
        Returns:
        set of tags
      • setKeyAlgorithm

        public void setKeyAlgorithm​(String value)
        Description copied from interface: AudioSong
        Set the key algorithm. Should be Entered, if the value was entered manually.
        Parameters:
        value - key algorithm
      • setSpectrum

        public void setSpectrum​(com.tagtraum.audiokern.timbre.BarkSpectrum value)
        Description copied from interface: AudioSong
        Sets the bark spectrum.
        Parameters:
        value - bark spectrum
      • setColor

        public void setColor​(Color value)
        Description copied from interface: AudioSong
        Sets the color.
        Parameters:
        value - color
      • setTempoColor

        public void setTempoColor​(Color value)
        Description copied from interface: AudioSong
        Sets this song's tempo color.
        Parameters:
        value - color
      • setTempoTimbreColor

        public void setTempoTimbreColor​(Color value)
        Description copied from interface: AudioSong
        Sets this song's tempo-timbre color.
        Parameters:
        value - color
      • setTempoSpectrum

        public void setTempoSpectrum​(com.tagtraum.audiokern.bpm.TempoSpectrum value)
        Description copied from interface: AudioSong
        Sets the tempo spectrum.
        Parameters:
        value - tempo spectrum
      • setBeatsPerMinuteAlgorithm

        public void setBeatsPerMinuteAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the BPM algorithm.
        Parameters:
        value - bpm algorithm name
      • setTuningAlgorithm

        public void setTuningAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the tuning algorithm the current tuning value was computed with.
        Parameters:
        value - tuning algorithm
      • setMoodAlgorithm

        public void setMoodAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the method the current mood value was created with.
        Parameters:
        value - mood algorithm
      • setBeatsAlgorithm

        public void setBeatsAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the algorithm the beats were computed with.
        Parameters:
        value - beats algorithm
      • setSegmentsAlgorithm

        public void setSegmentsAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the algorithm the segments were computed with.
        Parameters:
        value - segments algorithm
      • setSimilaritiesAlgorithm

        public void setSimilaritiesAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the algorithm the similarities were computed with.
        Parameters:
        value - similarities algorithm
      • setTimeSignatureAlgorithm

        public void setTimeSignatureAlgorithm​(String value)
        Description copied from interface: AudioSong
        Sets the algorithm the time signature was computed with.
        Parameters:
        value - time signature algorithm
      • setLanguage

        public void setLanguage​(String value)
        Description copied from interface: AudioSong
        Sets the language as ISO 639 three letter code.
        Parameters:
        value - ISO 639 three letter code
      • setFingerprint

        public void setFingerprint​(byte[] value)
        Description copied from interface: AudioSong
        Sets the acoustic fingerprint.
        Parameters:
        value - fingerprint
      • setTuning

        public void setTuning​(Integer value)
        Description copied from interface: AudioSong
        Sets tuning in cents (+-50).
        Parameters:
        value - in cents
      • setMood

        public void setMood​(Mood value)
        Description copied from interface: AudioSong
        Sets this song's mood.
        Parameters:
        value - mood
      • setMoodKeywords

        public void setMoodKeywords​(Set<String> value)
        Description copied from interface: AudioSong
        Attempt to store the raw mood keywords
        Parameters:
        value - mood keywords
      • setBeats

        public void setBeats​(Beats value)
        Description copied from interface: AudioSong
        Sets this song's beats.
        Parameters:
        value - beats
      • setSegments

        public void setSegments​(Segments value)
        Description copied from interface: AudioSong
        Sets this song's segments.
        Parameters:
        value - segments
      • setSimilarities

        public void setSimilarities​(Similarities value)
        Description copied from interface: AudioSong
        Sets this song's similarities.
        Parameters:
        value - similarities
      • setLoudness

        public void setLoudness​(Loudness value)
        Description copied from interface: AudioSong
        Sets this song's loudness curve.
      • setTrackReplayGain

        public void setTrackReplayGain​(ReplayGain value,
                                       boolean updateITunNorm)
        Description copied from interface: AudioSong
        Sets the replay gain for this track, not taking other tracks of the album into account.
        Parameters:
        value - replay gain
        updateITunNorm - update the iTunNorm field with the given value
        See Also:
        AudioSong.getTrackReplayGain(), AudioSong.getAlbumReplayGain()
      • setAlbumReplayGain

        public void setAlbumReplayGain​(ReplayGain value,
                                       boolean updateITunNorm)
        Description copied from interface: AudioSong
        Sets the replay gain for this album.
        Parameters:
        value - replay gain
        updateITunNorm - update the iTunNorm field with the given value
        See Also:
        AudioSong.getAlbumReplayGain()
      • setTimeSignature

        public void setTimeSignature​(TimeSignature value)
        Description copied from interface: AudioSong
        Sets this song's time signature.
        Parameters:
        value - time signature
      • setCustom1

        public void setCustom1​(String value)
        Description copied from interface: AudioSong
        Custom field.
        Parameters:
        value - custom field value
      • setCustom2

        public void setCustom2​(String value)
        Description copied from interface: AudioSong
        Custom field.
        Parameters:
        value - custom field value
      • setCustom3

        public void setCustom3​(String value)
        Description copied from interface: AudioSong
        Custom field.
        Parameters:
        value - custom field value
      • setCustom4

        public void setCustom4​(String value)
        Description copied from interface: AudioSong
        Custom field.
        Parameters:
        value - custom field value
      • setCustom5

        public void setCustom5​(String value)
        Description copied from interface: AudioSong
        Custom field.
        Parameters:
        value - custom field value
      • setPopularity

        public void setPopularity​(float value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRemoteUpdateDate

        public void setRemoteUpdateDate​(Date value)
        Description copied from interface: AudioSong
        Sets the date that marks the last update of remote properties. This method is usually called by the app, not the user or any user/plugin code.
        Parameters:
        value - date
        See Also:
        AudioSong.getRemoteUpdateDate()
      • setRemoteRating

        public void setRemoteRating​(int value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRemotePlayFrequency

        public void setRemotePlayFrequency​(float value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRemotePlaySkipRatio

        public void setRemotePlaySkipRatio​(float value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRemoteLoved

        public void setRemoteLoved​(float value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRemoteDisliked

        public void setRemoteDisliked​(float value)
        Description copied from interface: AudioSong
        Sets the value locally. In other words, the value is not propagated to the central database.
        Parameters:
        value - value
      • setRMSMean

        public void setRMSMean​(Float value)
        Description copied from interface: AudioSong
        Sets the average RMS for the first 120 seconds of this song.
        Parameters:
        value - averaged RMS
        See Also:
        AudioSong.getRMSMean()
      • setRMSStandardDeviation

        public void setRMSStandardDeviation​(Float value)
        Description copied from interface: AudioSong
        Sets the standard deviation of the root mean square (RMS).
        Parameters:
        value - standard deviation of the RMS/window
      • setSpectralCentroidMean

        public void setSpectralCentroidMean​(Float value)
        Description copied from interface: AudioSong
        Sets the mean of the spectral centroids.
        Parameters:
        value - averaged spectral centroids
        See Also:
        AudioSong.getSpectralCentroidMean()
      • setSpectralSpreadMean

        public void setSpectralSpreadMean​(Float value)
        Description copied from interface: AudioSong
        Sets the average spectral spread.
        Parameters:
        value - average spectral spread
        See Also:
        AudioSong.getSpectralSpreadMean()
      • setSpectralFluctuationPeak

        public void setSpectralFluctuationPeak​(Float value)
        Description copied from interface: AudioSong
        Peak of the spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.
        Parameters:
        value - peak in an averaged fluctuation spectrum
        See Also:
        AudioSong.getSpectralFluctuationPeak()
      • setSpectralFluxMean

        public void setSpectralFluxMean​(Float value)
        Description copied from interface: AudioSong
        Sets the mean spectral flux.
        Parameters:
        value - average spectral flux
        See Also:
        AudioSong.getSpectralFluxMean()
      • setSpectralVariabilityMean

        public void setSpectralVariabilityMean​(Float value)
        Description copied from interface: AudioSong
        Sets the mean spectral variability.
        Parameters:
        value - average spectral variability
        See Also:
        AudioSong.getSpectralVariabilityMean()
      • getTrackIds

        public Set<AudioId> getTrackIds()
        Description copied from interface: AudioSong
        Returns track ids.
        Returns:
        track ids
      • getAlbumIds

        public Set<AudioId> getAlbumIds()
        Description copied from interface: AudioSong
        Get album ids.
        Returns:
        album ids
      • getArtistIds

        public Set<AudioId> getArtistIds()
        Description copied from interface: AudioSong
        Get artists ids.
        Returns:
        artist ids