Class BeatportTrack

    • Constructor Detail

      • BeatportTrack

        public BeatportTrack​(org.json.simple.JSONObject json)
    • Method Detail

      • isShared

        public boolean isShared()
        Description copied from interface: AudioSong
        Indicates whether this track is a shared track, i.e. either from another iTunes library or an iTunes Match song that hasn't been downloaded yet.
        Specified by:
        isShared in interface AudioSong
        Returns:
        true or false
      • 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.
        Specified by:
        getCloudStatus in interface AudioSong
        Returns:
        the status if available, null, if the feature is not supported (Windows, non-iTunes libraries, ...)
      • getName

        public String getName()
        Description copied from interface: AudioSong
        Name of this song.
        Specified by:
        getName in interface AudioSong
        Returns:
        name
      • getDescription

        public String getDescription()
        Description copied from interface: AudioSong
        Description/subtitle of this song.
        Specified by:
        getDescription in interface AudioSong
        Returns:
        description
      • getWork

        public String getWork()
        Description copied from interface: AudioSong
        Classical work.
        Specified by:
        getWork in interface AudioSong
        Returns:
        work
      • getMovement

        public String getMovement()
        Description copied from interface: AudioSong
        Classical movement.
        Specified by:
        getMovement in interface AudioSong
        Returns:
        movement
      • getMovementNumber

        public int getMovementNumber()
        Description copied from interface: AudioSong
        Classical movement number.
        Specified by:
        getMovementNumber in interface AudioSong
        Returns:
        movement number
      • getMovementCount

        public int getMovementCount()
        Description copied from interface: AudioSong
        Classical movement count.
        Specified by:
        getMovementCount in interface AudioSong
        Returns:
        count
      • getComposer

        public String getComposer()
        Description copied from interface: AudioSong
        Get composer(s).
        Specified by:
        getComposer in interface AudioSong
        Returns:
        composer(s)
      • getKind

        public String getKind()
        Description copied from interface: AudioSong
        Kind of audio, e.g. "WAV audio file", "AAC audio file" or "MPEG audio file" (or localized versions thereof). This value is typically extracted from iTunes Music Library.xml and may simply be null for non-iTunes libraries.
        Specified by:
        getKind in interface AudioSong
        Returns:
        String describing this audio object or null if unavailable.
      • getSize

        public long getSize()
        Description copied from interface: AudioSong
        File size.
        Specified by:
        getSize in interface AudioSong
        Returns:
        size
      • getTotalTime

        public int getTotalTime()
        Description copied from interface: AudioSong
        Total length of the song in ms.
        Specified by:
        getTotalTime in interface AudioSong
        Returns:
        length in ms.
      • getStartTime

        public int getStartTime()
        Description copied from interface: AudioSong
        Start time of the song in ms.
        Specified by:
        getStartTime in interface AudioSong
        Returns:
        start time in ms.
      • getStopTime

        public int getStopTime()
        Description copied from interface: AudioSong
        Stop time of the song in ms.
        Specified by:
        getStopTime in interface AudioSong
        Returns:
        stop time in ms.
      • getPosition

        public int getPosition()
      • setPosition

        public void setPosition​(int position)
      • getTrackNumber

        public int getTrackNumber()
        Description copied from interface: AudioSong
        Get the number of the track on the release/album/recording.
        Specified by:
        getTrackNumber in interface AudioSong
        Returns:
        track number
      • getDiscNumber

        public int getDiscNumber()
        Description copied from interface: AudioSong
        Get the disc number.
        Specified by:
        getDiscNumber in interface AudioSong
        Returns:
        disc number
      • getDiscCount

        public int getDiscCount()
        Description copied from interface: AudioSong
        Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.
        Specified by:
        getDiscCount in interface AudioSong
        Returns:
        disc count
      • getYear

        public int getYear()
        Description copied from interface: AudioSong
        Release year - (corresponds to id3 TDRC, recording time).
        Specified by:
        getYear in interface AudioSong
        Returns:
        four digit recording year, if available
        See Also:
        AudioSong.getReleaseDate()
      • getDateModified

        public Date getDateModified()
        Description copied from interface: AudioSong
        Get date of last modification.
        Specified by:
        getDateModified in interface AudioSong
        Returns:
        date
      • getDateAdded

        public Date getDateAdded()
        Description copied from interface: AudioSong
        Get date the song was added to the library.
        Specified by:
        getDateAdded in interface AudioSong
        Returns:
        date added
      • getDateAnalyzed

        public Date getDateAnalyzed()
        Description copied from interface: AudioSong
        Date the song was last analyzed.
        Specified by:
        getDateAnalyzed in interface AudioSong
        Returns:
        date analyzed
      • getBitRate

        public int getBitRate()
        Description copied from interface: AudioSong
        Bit rate.
        Specified by:
        getBitRate in interface AudioSong
        Returns:
        bit rate
      • getSampleRate

        public int getSampleRate()
        Description copied from interface: AudioSong
        Get sample rate in Hz.
        Specified by:
        getSampleRate in interface AudioSong
        Returns:
        sample rate in Hz
      • getVolumeAdjustment

        public int getVolumeAdjustment()
        Description copied from interface: AudioSong
        Value between -255 and 255.
        Specified by:
        getVolumeAdjustment in interface AudioSong
        Returns:
        volume adjustment
      • getPlayCount

        public int getPlayCount()
        Description copied from interface: AudioSong
        Get the number of times the song was played.
        Specified by:
        getPlayCount in interface AudioSong
        Returns:
        play count
      • getPlayDate

        public long getPlayDate()
        Description copied from interface: AudioSong
        Get time the song was last played. Returns 0, if it has never been played.
        Specified by:
        getPlayDate in interface AudioSong
        Returns:
        play date, milliseconds since January 1, 1970, 00:00:00 GMT (NOT related to the iTunes value!)
      • getPlayDateUTC

        public Date getPlayDateUTC()
        Description copied from interface: AudioSong
        Get play date.
        Specified by:
        getPlayDateUTC in interface AudioSong
        Returns:
        play date
      • getSkipCount

        public int getSkipCount()
        Description copied from interface: AudioSong
        Get skip count.
        Specified by:
        getSkipCount in interface AudioSong
        Returns:
        skip count
      • getSkipDate

        public Date getSkipDate()
        Description copied from interface: AudioSong
        Get skip date.
        Specified by:
        getSkipDate in interface AudioSong
        Returns:
        skip date
      • getReleaseDate

        public Date getReleaseDate()
        Description copied from interface: AudioSong
        Release year (corresponds to id3 TDRL).
        Specified by:
        getReleaseDate in interface AudioSong
        Returns:
        release time
      • getCustom1

        public String getCustom1()
        Description copied from interface: AudioSong
        Custom field.
        Specified by:
        getCustom1 in interface AudioSong
        Returns:
        custom field
      • getCustom2

        public String getCustom2()
        Description copied from interface: AudioSong
        Custom field.
        Specified by:
        getCustom2 in interface AudioSong
        Returns:
        custom field
      • getCustom3

        public String getCustom3()
        Description copied from interface: AudioSong
        Custom field.
        Specified by:
        getCustom3 in interface AudioSong
        Returns:
        custom field
      • getCustom4

        public String getCustom4()
        Description copied from interface: AudioSong
        Custom field.
        Specified by:
        getCustom4 in interface AudioSong
        Returns:
        custom field
      • getCustom5

        public String getCustom5()
        Description copied from interface: AudioSong
        Custom field.
        Specified by:
        getCustom5 in interface AudioSong
        Returns:
        custom field
      • getArtworkCount

        public int getArtworkCount()
        Description copied from interface: AudioSong
        Get artwork count.
        Specified by:
        getArtworkCount in interface AudioSong
        Returns:
        artwork count
      • getImages

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

        public String getShow()
        Description copied from interface: AudioSong
        Name of a show, suitable for TV shows.
        Specified by:
        getShow in interface AudioSong
        Returns:
        show name
      • getSeason

        public int getSeason()
        Description copied from interface: AudioSong
        Get season number. Suitable for TV-shows.
        Specified by:
        getSeason in interface AudioSong
        Returns:
        season.
      • getEpisode

        public String getEpisode()
        Description copied from interface: AudioSong
        Get episode name.
        Specified by:
        getEpisode in interface AudioSong
        Returns:
        episode name
      • getEpisodeOrder

        public int getEpisodeOrder()
        Description copied from interface: AudioSong
        Episode order.
        Specified by:
        getEpisodeOrder in interface AudioSong
        Returns:
        episode order
      • isCompilation

        public boolean isCompilation()
        Description copied from interface: AudioSong

        Indicates whether this track is part of a compilation.

        "A compilation album is an album (music or spoken-word) featuring tracks from one or more performers, often culled from a variety of sources (such as studio albums, live albums, singles, demos and outtakes.)"

        -- Wikipedia Album Compliation
        Specified by:
        isCompilation in interface AudioSong
        Returns:
        true or false
      • getId

        public Long getId()
        Description copied from interface: AudioSong
        Persistent id. Survives application shutdown.
        Specified by:
        getId in interface AudioSong
        Returns:
        persistent id
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: AudioSong
        Indicates whether this song is enabled or checked.
        Specified by:
        isEnabled in interface AudioSong
        Returns:
        true or false
      • isUnplayed

        public boolean isUnplayed()
        Description copied from interface: AudioSong
        Indicates whether this songs has been played at some point.
        Specified by:
        isUnplayed in interface AudioSong
        Returns:
        true or false
      • isClean

        public boolean isClean()
        Description copied from interface: AudioSong
        Indicates whether this song is "clean" - whatever that means. "Clean" and "explicit" are mutually exclusive.
        Specified by:
        isClean in interface AudioSong
        Returns:
        true or false
        See Also:
        AudioSong.isExplicit()
      • isHasVideo

        public boolean isHasVideo()
        Description copied from interface: AudioSong
        Indicates whether this track has a video.
        Specified by:
        isHasVideo in interface AudioSong
        Returns:
        true or false
      • isProtected

        public boolean isProtected()
        Description copied from interface: AudioSong
        Indicates whether this track is protected by some DRM scheme like Apple's FairPlay.
        Specified by:
        isProtected in interface AudioSong
        Returns:
        true or false
      • 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
        Parameters:
        refresh - refresh from backend
        Returns:
        location
        See Also:
        AudioSong.getLocation(), AudioSong.getFile(boolean)
      • getPurchaseURL

        public URL getPurchaseURL()
        Description copied from interface: AudioSong
        URL for a website/service that allows users to purchase this song.
        Specified by:
        getPurchaseURL in interface AudioSong
        Returns:
        store URL or null, if none is known
      • isPartOfGaplessAlbum

        public boolean isPartOfGaplessAlbum()
        Description copied from interface: AudioSong
        Indicates whether this songs is part of a gapless album.
        Specified by:
        isPartOfGaplessAlbum in interface AudioSong
        Returns:
        true or false
      • isExplicit

        public boolean isExplicit()
        Description copied from interface: AudioSong
        Indicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.
        Specified by:
        isExplicit in interface AudioSong
        Returns:
        true or false
        See Also:
        AudioSong.isClean()
      • isHD

        public boolean isHD()
        Description copied from interface: AudioSong
        Indicates whether this video content is in high definition (HD).
        Specified by:
        isHD in interface AudioSong
        Returns:
        true or false
      • getSortArtist

        public String getSortArtist()
        Description copied from interface: AudioSong
        Returns the "sort artist". E.g., for "The Beatles" the sort artist is "Beatles".
        Specified by:
        getSortArtist in interface AudioSong
        Returns:
        sort artist
      • getSortAlbum

        public String getSortAlbum()
        Description copied from interface: AudioSong
        Returns the "sort album". E.g., for "A Hard Day's Night" the sort album is "Hard Day's Night".
        Specified by:
        getSortAlbum in interface AudioSong
        Returns:
        sort album
      • getSortName

        public String getSortName()
        Description copied from interface: AudioSong
        Returns the "sort name". E.g., for "A Taste of Honey" the sort name is "Taste of Honey".
        Specified by:
        getSortName in interface AudioSong
        Returns:
        sort name
      • getSortAlbumArtist

        public String getSortAlbumArtist()
        Description copied from interface: AudioSong
        Returns the "sort album artist". E.g., for "The Beatles" the sort album artist is "Beatles".
        Specified by:
        getSortAlbumArtist in interface AudioSong
        Returns:
        sort album artist
      • getSortComposer

        public String getSortComposer()
        Description copied from interface: AudioSong
        Returns the sort composer.
        Specified by:
        getSortComposer in interface AudioSong
        Returns:
        sort composer
      • getSortShow

        public String getSortShow()
        Description copied from interface: AudioSong
        Returns the sort show.
        Specified by:
        getSortShow in interface AudioSong
        Returns:
        sort show
      • getContentRating

        public String getContentRating()
        Description copied from interface: AudioSong
        Returns the content rating. E.g., "us-tv|TV-PG|400|" or "us-tv|TV-MA|600|dialogue and sexual content"
        Specified by:
        getContentRating in interface AudioSong
        Returns:
        content rating
      • isPurchased

        public boolean isPurchased()
        Description copied from interface: AudioSong
        Indicates whether this song was purchased (via the iTunes store).
        Specified by:
        isPurchased in interface AudioSong
        Returns:
        true or false
      • 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.
        Specified by:
        getFile in interface AudioSong
        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)
      • canWrite

        public boolean canWrite()
        Description copied from interface: AudioSong
        Checks whether the file corresponding to this song can in principal be written to.
        Specified by:
        canWrite in interface AudioSong
        Returns:
        true or false
      • hasProtectedFileExtension

        public boolean hasProtectedFileExtension()
        Description copied from interface: AudioSong
        Checks file endings instead of the protected flag in the iTunes Music Library.xml, since iTunes marks non-protected versions of files that used to be protected still as protected.
        Specified by:
        hasProtectedFileExtension in interface AudioSong
        Returns:
        true, if we know that the file-format is usually protected.
      • getTempo

        public com.tagtraum.audiokern.bpm.Tempo getTempo()
        Description copied from interface: AudioSong
        Returns tempo.
        Specified by:
        getTempo in interface AudioSong
        Returns:
        tempo
      • getKeyAlgorithm

        public String getKeyAlgorithm()
        Description copied from interface: AudioSong
        Returns the name of the key algorithm. May be Entered, if the key value was entered.
        Specified by:
        getKeyAlgorithm in interface AudioSong
        Returns:
        key algorithm
      • getColor

        public Color getColor()
        Description copied from interface: AudioSong
        Returns the color.
        Specified by:
        getColor in interface AudioSong
        Returns:
        color
      • getBeatsPerMinuteAlgorithm

        public String getBeatsPerMinuteAlgorithm()
        Description copied from interface: AudioSong
        Returns the name of the algorithm used to determine the beats per minute (BPM).
        Specified by:
        getBeatsPerMinuteAlgorithm in interface AudioSong
        Returns:
        algorithm name
      • getLanguage

        public String getLanguage()
        Description copied from interface: AudioSong
        The language of the lyrics as ISO 639 three letter codes.
        Specified by:
        getLanguage in interface AudioSong
        Returns:
        ISO 639 three letter language code
      • getFingerprint

        public byte[] getFingerprint()
        Description copied from interface: AudioSong
        Acoustic fingerprint.
        Specified by:
        getFingerprint in interface AudioSong
        Returns:
        acoustic fingerprint
      • getLyrics

        public String getLyrics()
        Description copied from interface: AudioSong
        Returns the lyrics.
        Specified by:
        getLyrics in interface AudioSong
        Returns:
        lyrics
      • getLyricsTermFrequencies

        public List<TermFrequency> getLyricsTermFrequencies()
        Description copied from interface: AudioSong
        Terms in this song's lyrics along with their frequency. All terms are lowercase, regular ASCII punctuation has been removed.
        Specified by:
        getLyricsTermFrequencies in interface AudioSong
        Returns:
        term frequencies
      • getTuningAlgorithm

        public String getTuningAlgorithm()
        Description copied from interface: AudioSong
        The method the current tuning was created with.
        Specified by:
        getTuningAlgorithm in interface AudioSong
        Returns:
        tuning algorithm
      • getDanceability

        public Float getDanceability()
        Description copied from interface: AudioSong
        Danceability.
        Specified by:
        getDanceability in interface AudioSong
        Returns:
        normalized positive value (0-1)
      • getDanceabilityAlgorithm

        public String getDanceabilityAlgorithm()
        Description copied from interface: AudioSong
        Returns the name of the danceability algorithm. May be Entered, if the value was entered.
        Specified by:
        getDanceabilityAlgorithm in interface AudioSong
        Returns:
        danceability algorithm
      • getInstrumentationAlgorithm

        public String getInstrumentationAlgorithm()
        Description copied from interface: AudioSong
        Returns the name of the instrumentation algorithm. May be Entered, if the value was entered.
        Specified by:
        getInstrumentationAlgorithm in interface AudioSong
        Returns:
        instrumentation algorithm
      • getMood

        public Mood getMood()
        Description copied from interface: AudioSong
        The song's mood.
        Specified by:
        getMood in interface AudioSong
        Returns:
        mood
      • getMoodAlgorithm

        public String getMoodAlgorithm()
        Description copied from interface: AudioSong
        The method the associated mood value was created with.
        Specified by:
        getMoodAlgorithm in interface AudioSong
        Returns:
        mood algorithm
      • getTimeSignatureAlgorithm

        public String getTimeSignatureAlgorithm()
        Description copied from interface: AudioSong
        Method the time signature was computed with.
        Specified by:
        getTimeSignatureAlgorithm in interface AudioSong
        Returns:
        algorithm the time signature was computed with
      • getBeats

        public Beats getBeats()
        Description copied from interface: AudioSong
        The song's beats.
        Specified by:
        getBeats in interface AudioSong
        Returns:
        beats
      • getBeatsAlgorithm

        public String getBeatsAlgorithm()
        Description copied from interface: AudioSong
        Method the beats were computed with.
        Specified by:
        getBeatsAlgorithm in interface AudioSong
        Returns:
        algorithm the beats were computed with
      • getSegmentsAlgorithm

        public String getSegmentsAlgorithm()
        Description copied from interface: AudioSong
        Method the segments were computed with.
        Specified by:
        getSegmentsAlgorithm in interface AudioSong
        Returns:
        algorithm the segments were computed with
      • getSimilaritiesAlgorithm

        public String getSimilaritiesAlgorithm()
        Description copied from interface: AudioSong
        Method the similarities were computed with.
        Specified by:
        getSimilaritiesAlgorithm in interface AudioSong
        Returns:
        algorithm the similarities were computed with
      • getLoudness

        public Loudness getLoudness()
        Description copied from interface: AudioSong
        The song's loudness curve.
        Specified by:
        getLoudness in interface AudioSong
        Returns:
        loudness
      • getRMSStandardDeviation

        public Float getRMSStandardDeviation()
        Description copied from interface: AudioSong
        Standard deviation of the root mean square energy values for windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz) with a hopsize of half a window. Only the first 120 seconds of the audio are considered, the rest is discarded.
        Specified by:
        getRMSStandardDeviation in interface AudioSong
        Returns:
        standard deviation of the RMS for the first 120 seconds
        See Also:
        Floats.rootMeanSquare(float[]), AudioSong.getRMSMean()
      • getSpectralNoveltyMean

        public Float getSpectralNoveltyMean()
        Description copied from interface: AudioSong
        Average of the spectral novelty 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.
        Specified by:
        getSpectralNoveltyMean in interface AudioSong
        Returns:
        average spectral novelty
      • getFrontCoverImage

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

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

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