Package com.tagtraum.beatunes.library
Class AudioSongFacade
- java.lang.Object
-
- com.tagtraum.beatunes.library.AudioSongFacade
-
- All Implemented Interfaces:
AudioSong
- Direct Known Subclasses:
FileSystemAudioSong,ITunesAudioSong
public abstract class AudioSongFacade extends Object implements AudioSong
Base class for other facades, which already implements all the simple getters.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tagtraum.audiokern.AudioSong
AudioSong.CloudStatus, AudioSong.Instrumentation, AudioSong.Liking, AudioSong.MediaKind, AudioSong.TrackType
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutorServiceaudioMetaDataExecutorprotected MediaLibrarymusicLibraryprotected Songsongprotected ExecutorServicetunesExecutor-
Fields inherited from interface com.tagtraum.audiokern.AudioSong
ACOUSTIC_NAMES, ELECTRONIC_NAMES
-
-
Constructor Summary
Constructors Constructor Description AudioSongFacade(Song song, MediaLibrary musicLibrary)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener propertyChangeListener)Lets you add a property change listener to this song.voidaddPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)Lets you add a property change listener to this song.booleancanWrite()Checks whether the file corresponding to this song can in principal be written to.protected static voidcopy(File[] from, File[] to)protected static voiddelete(File... files)protected voidfirePropertyChange(String propertyName, Object oldValue, Object value)StringgetAlbum()Get Album.StringgetAlbumArtist()Get album artist.AudioSong.LikinggetAlbumLiking()Is album liked.intgetAlbumRating()Get album rating.ReplayGaingetAlbumReplayGain()Replay gain for this album.StringgetArtist()Get artist.intgetArtworkCount()Get artwork count.BeatsgetBeats()The song's beats.StringgetBeatsAlgorithm()Method the beats were computed with.floatgetBeatsPerMinute()Beats per minute (BPM).StringgetBeatsPerMinuteAlgorithm()Returns the name of the algorithm used to determine the beats per minute (BPM).intgetBitRate()Bit rate.ColorgetColor()Returns the color.StringgetComments()Get comments.StringgetComposer()Get composer(s).StringgetContentRating()Returns the content rating.StringgetCustom1()Custom field.StringgetCustom2()Custom field.StringgetCustom3()Custom field.StringgetCustom4()Custom field.StringgetCustom5()Custom field.FloatgetDanceability()Danceability.StringgetDanceabilityAlgorithm()Returns the name of the danceability algorithm.DategetDateAdded()Get date the song was added to the library.DategetDateAnalyzed()Date the song was last analyzed.DategetDateModified()Get date of last modification.StringgetDescription()Description/subtitle of this song.intgetDiscCount()Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.intgetDiscNumber()Get the disc number.StringgetEpisode()Get episode name.intgetEpisodeOrder()Episode order.byte[]getFingerprint()Acoustic fingerprint.floatgetFinish()Stop time of the song in seconds.protected ImagegetFolderImage()Try to load image from the same folder the song is in.StringgetGenre()Get genre.StringgetGrouping()Get grouping.LonggetId()Persistent id.AudioSong.InstrumentationgetInstrumentation()Indicates whether this song qualifies as "electronic" or "acoustic".StringgetInstrumentationAlgorithm()Returns the name of the instrumentation algorithm.KeygetKey()Return the tonal key of this song.StringgetKeyAlgorithm()Returns the name of the key algorithm.StringgetKind()Kind of audio, e.g.StringgetLanguage()The language of the lyrics as ISO 639 three letter codes.AudioSong.LikinggetLiking()Liking.StringgetLocation(boolean refresh)Location of this track.LoudnessgetLoudness()The song's loudness curve.List<TermFrequency>getLyricsTermFrequencies()Terms in this song's lyrics along with their frequency.floatgetMeasuresPerMinute()Measures (bars) per minute.AudioSong.MediaKindgetMediaKind()Media kind of this object.MoodgetMood()The song's mood.StringgetMoodAlgorithm()The method the associated mood value was created with.Set<String>getMoodKeywords()Get raw mood keywords.StringgetMovement()Classical movement.intgetMovementCount()Classical movement count.intgetMovementNumber()Classical movement number.StringgetName()Name of this song.StringgetPath()Path.intgetPlayCount()Get the number of times the song was played.longgetPlayDate()Get time the song was last played.DategetPlayDateUTC()Get play date.doublegetPlayFrequency()Number of times played per 100 days.doublegetPlaySkipRatio()Play/Skip ratio.floatgetPopularity()Popularity as a value between 0 and 1.PropertyChangeListener[]getPropertyChangeListeners()PropertyChangeListener[]getPropertyChangeListeners(String property)intgetRating()Value ranging from 0-100, 100 being best.FloatgetRelativeSpectralEntropyMean()Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window.DategetReleaseDate()Release year (corresponds to id3 TDRL).floatgetRemoteDisliked()Indicates, what percentage of people "dislike" this song.floatgetRemoteLoved()Indicates, what percentage of people "love" this song.floatgetRemotePlayFrequency()Average of play frequencies as reported by users.floatgetRemotePlaySkipRatio()Play/skip ratio by all users with this song.intgetRemoteRating()Average of other people's ratings.DategetRemoteUpdateDate()Time the remote properties of this song were last updated.FloatgetRMSMean()Root mean square (RMS) of the signal's energy, averaged over windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz, i.e.FloatgetRMSStandardDeviation()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.intgetSampleRate()Get sample rate in Hz.intgetSeason()Get season number.SegmentsgetSegments()The song's segments.StringgetSegmentsAlgorithm()Method the segments were computed with.StringgetShow()Name of a show, suitable for TV shows.SimilaritiesgetSimilarities()The song's similarities.StringgetSimilaritiesAlgorithm()Method the similarities were computed with.longgetSize()File size.intgetSkipCount()Get skip count.DategetSkipDate()Get skip date.StringgetSortAlbum()Returns the "sort album".StringgetSortAlbumArtist()Returns the "sort album artist".StringgetSortArtist()Returns the "sort artist".StringgetSortComposer()Returns the sort composer.StringgetSortName()Returns the "sort name".StringgetSortShow()Returns the sort show.FloatgetSpectralCentroidMean()Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length.FloatgetSpectralFluctuationPeak()Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralFluxMean()Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralNoveltyMean()Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralSpreadMean()Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window.FloatgetSpectralVariabilityMean()Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window.com.tagtraum.audiokern.timbre.BarkSpectrumgetSpectrum()Returns the bark spectrum.floatgetStart()Start time of the song in seconds.intgetStartTime()Start time of the song in ms.intgetStopTime()Stop time of the song in ms.com.tagtraum.audiokern.bpm.TempogetTempo()Returns tempo.ColorgetTempoColor()Projection ofAudioSong.getTempoSpectrum()to a color.com.tagtraum.audiokern.bpm.TempoSpectrumgetTempoSpectrum()Returns the tempo spectrum.ColorgetTempoTimbreColor()Projection ofAudioSong.getTempoSpectrum()andAudioSong.getSpectrum()to a color.TimeSignaturegetTimeSignature()The song's time signature.StringgetTimeSignatureAlgorithm()Method the time signature was computed with.intgetTotalTime()Total length of the song in ms.intgetTrackCount()Number of tracks on album/release/recording.intgetTrackNumber()Get the number of the track on the release/album/recording.ReplayGaingetTrackReplayGain()Replay gain for this track (not taking other tracks in an album into account).AudioSong.TrackTypegetTrackType()Track type.IntegergetTuning()Tuning in cents.StringgetTuningAlgorithm()The method the current tuning was created with.intgetVolumeAdjustment()Value between -255 and 255.StringgetWork()Classical work.intgetYear()Release year - (corresponds to id3 TDRC, recording time).inthashCode()booleanhasProtectedFileExtension()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.booleanisAlbumRatingComputed()Indicates whether the value returned byAudioSong.getAlbumRating()was computed or set manually.booleanisClean()Indicates whether this song is "clean" - whatever that means.booleanisCompilation()Indicates whether this track is part of a compilation.protected booleanisDifferent(Object value1, Object value2)booleanisDisabled()Indicates whether this song is disabled or unchecked.booleanisEnabled()Indicates whether this song is enabled or checked.booleanisExplicit()Indicates whether this tracks is explicit or not.booleanisHasVideo()Indicates whether this track has a video.booleanisHD()Indicates whether this video content is in high definition (HD).booleanisPartOfGaplessAlbum()Indicates whether this songs is part of a gapless album.booleanisProtected()booleanisPurchased()Indicates whether this song was purchased (via the iTunes store).booleanisRatingComputed()Indicates whether the value returned byAudioSong.getRating()was computed or set manually.booleanisShared()Indicates whether this track is a shared track, i.e.booleanisUnplayed()Indicates whether this songs has been played at some point.voidremovePropertyChangeListener(PropertyChangeListener listener)Lets you remove a property change listener to this song.voidremovePropertyChangeListener(String property, PropertyChangeListener listener)Lets you remove a property change listener to this song.voidsetDisabled(boolean disabled)Enables/disables this song.protected voidupdateTempoTimbreColor(AudioMetaData audioMetaData)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.audiokern.AudioSong
addArtwork, addBackCoverArtwork, addFrontCoverArtwork, download, getAlbumIds, getArtistIds, getArtworks, getBackCoverImage, getCloudStatus, getFile, getFile, getFrontCoverImage, getImage, getImages, getImplementation, getImplementations, getInstrumentationBasedOnGenreAndTags, getLocation, getLyrics, getPurchaseURL, getSyncTempoKey, getSyncTempoTuning, getTags, getTrackIds, isAcousticBasedOnGenreTitleAndTags, isElectronicBasedOnGenreAndTags, refreshFromFile, setAlbum, setAlbumArtist, setAlbumLiking, setAlbumRating, setAlbumReplayGain, setArtist, setArtworks, setBackCoverArtwork, setBeats, setBeatsAlgorithm, setBeatsPerMinute, setBeatsPerMinuteAlgorithm, setClean, setColor, setComments, setCompilation, setComposer, setContentRating, setCustom1, setCustom2, setCustom3, setCustom4, setCustom5, setDanceability, setDanceabilityAlgorithm, setDateAnalyzed, setDescription, setDiscCount, setDiscNumber, setEnabled, setEpisode, setEpisodeOrder, setExplicit, setFingerprint, setFinish, setFrontCoverArtwork, setGenre, setGrouping, setHasVideo, setHD, setInstrumentation, setInstrumentationAlgorithm, setKey, setKeyAlgorithm, setKind, setLanguage, setLiking, setLocation, setLoudness, setLyrics, setMediaKind, setMood, setMoodAlgorithm, setMoodKeywords, setMovement, setMovementCount, setMovementNumber, setName, setPartOfGaplessAlbum, setPlayCount, setPlayDate, setPlayDateUTC, setPopularity, setRating, setRelativeSpectralEntropyMean, setReleaseDate, setRemoteDisliked, setRemoteLoved, setRemotePlayFrequency, setRemotePlaySkipRatio, setRemoteRating, setRemoteUpdateDate, setRMSMean, setRMSStandardDeviation, setSeason, setSegments, setSegmentsAlgorithm, setShow, setSimilarities, setSimilaritiesAlgorithm, setSkipCount, setSkipDate, setSortAlbum, setSortAlbumArtist, setSortArtist, setSortComposer, setSortName, setSortShow, setSpectralCentroidMean, setSpectralFluctuationPeak, setSpectralFluxMean, setSpectralNoveltyMean, setSpectralSpreadMean, setSpectralVariabilityMean, setSpectrum, setStart, setStartTime, setStopTime, setTags, setTempo, setTempoColor, setTempoSpectrum, setTempoTimbreColor, setTimeSignature, setTimeSignatureAlgorithm, setTrackCount, setTrackNumber, setTrackReplayGain, setTrackType, setTuning, setTuningAlgorithm, setUnplayed, setVolumeAdjustment, setWork, setYear
-
-
-
-
Field Detail
-
song
protected Song song
-
musicLibrary
protected MediaLibrary musicLibrary
-
tunesExecutor
protected final ExecutorService tunesExecutor
-
audioMetaDataExecutor
protected final ExecutorService audioMetaDataExecutor
-
-
Constructor Detail
-
AudioSongFacade
public AudioSongFacade(Song song, MediaLibrary musicLibrary)
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Description copied from interface:AudioSongLets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListenerin interfaceAudioSong- Parameters:
propertyChangeListener- property change listener- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
addPropertyChangeListener
public void addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
Description copied from interface:AudioSongLets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListenerin interfaceAudioSong- Parameters:
property- property namepropertyChangeListener- property change listener- See Also:
PropertyChangeSupport.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
Description copied from interface:AudioSongLets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListenerin interfaceAudioSong- Parameters:
property- property namelistener- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface:AudioSongLets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListenerin interfaceAudioSong- Parameters:
listener- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String property)
- Specified by:
getPropertyChangeListenersin interfaceAudioSong- See Also:
PropertyChangeSupport.getPropertyChangeListeners(String)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()
- Specified by:
getPropertyChangeListenersin interfaceAudioSong- See Also:
PropertyChangeSupport.getPropertyChangeListeners()
-
isShared
public boolean isShared()
Description copied from interface:AudioSongIndicates 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.
-
firePropertyChange
protected void firePropertyChange(String propertyName, Object oldValue, Object value)
-
getDescription
public String getDescription()
Description copied from interface:AudioSongDescription/subtitle of this song.- Specified by:
getDescriptionin interfaceAudioSong- Returns:
- description
-
getMovement
public String getMovement()
Description copied from interface:AudioSongClassical movement.- Specified by:
getMovementin interfaceAudioSong- Returns:
- movement
-
getMovementNumber
public int getMovementNumber()
Description copied from interface:AudioSongClassical movement number.- Specified by:
getMovementNumberin interfaceAudioSong- Returns:
- movement number
-
getMovementCount
public int getMovementCount()
Description copied from interface:AudioSongClassical movement count.- Specified by:
getMovementCountin interfaceAudioSong- Returns:
- count
-
getAlbumArtist
public String getAlbumArtist()
Description copied from interface:AudioSongGet album artist.- Specified by:
getAlbumArtistin interfaceAudioSong- Returns:
- album artist
-
getComposer
public String getComposer()
Description copied from interface:AudioSongGet composer(s).- Specified by:
getComposerin interfaceAudioSong- Returns:
- composer(s)
-
getGrouping
public String getGrouping()
Description copied from interface:AudioSongGet grouping.- Specified by:
getGroupingin interfaceAudioSong- Returns:
- grouping
-
getKind
public String getKind()
Description copied from interface:AudioSongKind of audio, e.g. "WAV audio file", "AAC audio file" or "MPEG audio file" (or localized versions thereof). This value is typically extracted fromiTunes Music Library.xmland may simply benullfor non-iTunes libraries.
-
getSize
public long getSize()
Description copied from interface:AudioSongFile size.
-
getTotalTime
public int getTotalTime()
Description copied from interface:AudioSongTotal length of the song in ms.- Specified by:
getTotalTimein interfaceAudioSong- Returns:
- length in ms.
-
getTrackCount
public int getTrackCount()
Description copied from interface:AudioSongNumber of tracks on album/release/recording.- Specified by:
getTrackCountin interfaceAudioSong- Returns:
- track count
- See Also:
AudioSong.getTrackNumber()
-
getStartTime
public int getStartTime()
Description copied from interface:AudioSongStart time of the song in ms.- Specified by:
getStartTimein interfaceAudioSong- Returns:
- start time in ms.
-
getStopTime
public int getStopTime()
Description copied from interface:AudioSongStop time of the song in ms.- Specified by:
getStopTimein interfaceAudioSong- Returns:
- stop time in ms.
-
getStart
public float getStart()
Description copied from interface:AudioSongStart time of the song in seconds.- Specified by:
getStartin interfaceAudioSong- Returns:
- start time in seconds.
- See Also:
AudioSong.getStartTime()
-
getFinish
public float getFinish()
Description copied from interface:AudioSongStop time of the song in seconds.- Specified by:
getFinishin interfaceAudioSong- Returns:
- stop time in seconds.
- See Also:
AudioSong.getStopTime()
-
getTrackNumber
public int getTrackNumber()
Description copied from interface:AudioSongGet the number of the track on the release/album/recording.- Specified by:
getTrackNumberin interfaceAudioSong- Returns:
- track number
-
getDiscNumber
public int getDiscNumber()
Description copied from interface:AudioSongGet the disc number.- Specified by:
getDiscNumberin interfaceAudioSong- Returns:
- disc number
-
getDiscCount
public int getDiscCount()
Description copied from interface:AudioSongAssuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.- Specified by:
getDiscCountin interfaceAudioSong- Returns:
- disc count
-
getYear
public int getYear()
Description copied from interface:AudioSongRelease year - (corresponds to id3 TDRC, recording time).- Specified by:
getYearin interfaceAudioSong- Returns:
- four digit recording year, if available
- See Also:
AudioSong.getReleaseDate()
-
getDateModified
public Date getDateModified()
Description copied from interface:AudioSongGet date of last modification.- Specified by:
getDateModifiedin interfaceAudioSong- Returns:
- date
-
getDateAnalyzed
public Date getDateAnalyzed()
Description copied from interface:AudioSongDate the song was last analyzed.- Specified by:
getDateAnalyzedin interfaceAudioSong- Returns:
- date analyzed
-
getDateAdded
public Date getDateAdded()
Description copied from interface:AudioSongGet date the song was added to the library.- Specified by:
getDateAddedin interfaceAudioSong- Returns:
- date added
-
getBitRate
public int getBitRate()
Description copied from interface:AudioSongBit rate.- Specified by:
getBitRatein interfaceAudioSong- Returns:
- bit rate
-
getSampleRate
public int getSampleRate()
Description copied from interface:AudioSongGet sample rate in Hz.- Specified by:
getSampleRatein interfaceAudioSong- Returns:
- sample rate in Hz
-
getVolumeAdjustment
public int getVolumeAdjustment()
Description copied from interface:AudioSongValue between -255 and 255.- Specified by:
getVolumeAdjustmentin interfaceAudioSong- Returns:
- volume adjustment
-
getComments
public String getComments()
Description copied from interface:AudioSongGet comments.- Specified by:
getCommentsin interfaceAudioSong- Returns:
- comments
-
getPlayCount
public int getPlayCount()
Description copied from interface:AudioSongGet the number of times the song was played.- Specified by:
getPlayCountin interfaceAudioSong- Returns:
- play count
-
getPlayDate
public long getPlayDate()
Description copied from interface:AudioSongGet time the song was last played. Returns0, if it has never been played.- Specified by:
getPlayDatein interfaceAudioSong- 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:AudioSongGet play date.- Specified by:
getPlayDateUTCin interfaceAudioSong- Returns:
- play date
-
getSkipCount
public int getSkipCount()
Description copied from interface:AudioSongGet skip count.- Specified by:
getSkipCountin interfaceAudioSong- Returns:
- skip count
-
getSkipDate
public Date getSkipDate()
Description copied from interface:AudioSongGet skip date.- Specified by:
getSkipDatein interfaceAudioSong- Returns:
- skip date
-
getReleaseDate
public Date getReleaseDate()
Description copied from interface:AudioSongRelease year (corresponds to id3 TDRL).- Specified by:
getReleaseDatein interfaceAudioSong- Returns:
- release time
-
getArtworkCount
public int getArtworkCount()
Description copied from interface:AudioSongGet artwork count.- Specified by:
getArtworkCountin interfaceAudioSong- Returns:
- artwork count
-
getRating
public int getRating()
Description copied from interface:AudioSongValue ranging from 0-100, 100 being best.- Specified by:
getRatingin interfaceAudioSong- Returns:
- rating
- See Also:
AudioSong.isRatingComputed(),AudioSong.getAlbumRating()
-
getAlbumRating
public int getAlbumRating()
Description copied from interface:AudioSongGet album rating.- Specified by:
getAlbumRatingin interfaceAudioSong- Returns:
- album rating
- See Also:
AudioSong.isAlbumRatingComputed()
-
isRatingComputed
public boolean isRatingComputed()
Description copied from interface:AudioSongIndicates whether the value returned byAudioSong.getRating()was computed or set manually.- Specified by:
isRatingComputedin interfaceAudioSong- Returns:
trueorfalse
-
isAlbumRatingComputed
public boolean isAlbumRatingComputed()
Description copied from interface:AudioSongIndicates whether the value returned byAudioSong.getAlbumRating()was computed or set manually.- Specified by:
isAlbumRatingComputedin interfaceAudioSong- Returns:
trueorfalse
-
getLiking
public AudioSong.Liking getLiking()
Description copied from interface:AudioSongLiking. This is an expression of iTunes' loved and disliked fields.
-
getAlbumLiking
public AudioSong.Liking getAlbumLiking()
Description copied from interface:AudioSongIs album liked. This is an expression of iTunes' album loved and album disliked fields.- Specified by:
getAlbumLikingin interfaceAudioSong- Returns:
- liking
-
getInstrumentation
public AudioSong.Instrumentation getInstrumentation()
Description copied from interface:AudioSongIndicates whether this song qualifies as "electronic" or "acoustic".- Specified by:
getInstrumentationin interfaceAudioSong- Returns:
- instrumentation
-
getInstrumentationAlgorithm
public String getInstrumentationAlgorithm()
Description copied from interface:AudioSongReturns the name of the instrumentation algorithm. May beEntered, if the value was entered.- Specified by:
getInstrumentationAlgorithmin interfaceAudioSong- Returns:
- instrumentation algorithm
-
getDanceability
public Float getDanceability()
Description copied from interface:AudioSongDanceability.- Specified by:
getDanceabilityin interfaceAudioSong- Returns:
- normalized positive value (0-1)
-
getDanceabilityAlgorithm
public String getDanceabilityAlgorithm()
Description copied from interface:AudioSongReturns the name of the danceability algorithm. May beEntered, if the value was entered.- Specified by:
getDanceabilityAlgorithmin interfaceAudioSong- Returns:
- danceability algorithm
-
getShow
public String getShow()
Description copied from interface:AudioSongName of a show, suitable for TV shows.
-
getSeason
public int getSeason()
Description copied from interface:AudioSongGet season number. Suitable for TV-shows.
-
getEpisode
public String getEpisode()
Description copied from interface:AudioSongGet episode name.- Specified by:
getEpisodein interfaceAudioSong- Returns:
- episode name
-
getEpisodeOrder
public int getEpisodeOrder()
Description copied from interface:AudioSongEpisode order.- Specified by:
getEpisodeOrderin interfaceAudioSong- Returns:
- episode order
-
isCompilation
public boolean isCompilation()
Description copied from interface:AudioSongIndicates 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:
isCompilationin interfaceAudioSong- Returns:
trueorfalse
-
getId
public Long getId()
Description copied from interface:AudioSongPersistent id. Survives application shutdown.
-
isEnabled
public boolean isEnabled()
Description copied from interface:AudioSongIndicates whether this song is enabled or checked.
-
isDisabled
public boolean isDisabled()
Description copied from interface:AudioSongIndicates whether this song is disabled or unchecked.- Specified by:
isDisabledin interfaceAudioSong- Returns:
- !
AudioSong.isEnabled()
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from interface:AudioSongEnables/disables this song.- Specified by:
setDisabledin interfaceAudioSong- Parameters:
disabled-trueorfalse
-
getTrackType
public AudioSong.TrackType getTrackType()
Description copied from interface:AudioSongTrack type. E.g.AudioSong.TrackType.FILE.- Specified by:
getTrackTypein interfaceAudioSong- Returns:
- track type
- See Also:
AudioSong.setTrackType(TrackType)
-
getMediaKind
public AudioSong.MediaKind getMediaKind()
Description copied from interface:AudioSongMedia kind of this object.- Specified by:
getMediaKindin interfaceAudioSong- Returns:
- kind of media
-
isUnplayed
public boolean isUnplayed()
Description copied from interface:AudioSongIndicates whether this songs has been played at some point.- Specified by:
isUnplayedin interfaceAudioSong- Returns:
trueorfalse
-
isClean
public boolean isClean()
Description copied from interface:AudioSongIndicates whether this song is "clean" - whatever that means. "Clean" and "explicit" are mutually exclusive.- Specified by:
isCleanin interfaceAudioSong- Returns:
trueorfalse- See Also:
AudioSong.isExplicit()
-
isHasVideo
public boolean isHasVideo()
Description copied from interface:AudioSongIndicates whether this track has a video.- Specified by:
isHasVideoin interfaceAudioSong- Returns:
trueorfalse
-
isProtected
public boolean isProtected()
Description copied from interface:AudioSong- Specified by:
isProtectedin interfaceAudioSong- Returns:
trueorfalse
-
getLocation
public String getLocation(boolean refresh)
Description copied from interface:AudioSongLocation of this track. Ifrefreshis 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:
getLocationin interfaceAudioSong- Parameters:
refresh- refresh from backend- Returns:
- location
- See Also:
AudioSong.getLocation(),AudioSong.getFile(boolean)
-
isPartOfGaplessAlbum
public boolean isPartOfGaplessAlbum()
Description copied from interface:AudioSongIndicates whether this songs is part of a gapless album.- Specified by:
isPartOfGaplessAlbumin interfaceAudioSong- Returns:
trueorfalse
-
isExplicit
public boolean isExplicit()
Description copied from interface:AudioSongIndicates whether this tracks is explicit or not. "Clean" and "explicit" are mutually exclusive.- Specified by:
isExplicitin interfaceAudioSong- Returns:
trueorfalse- See Also:
AudioSong.isClean()
-
isHD
public boolean isHD()
Description copied from interface:AudioSongIndicates whether this video content is in high definition (HD).
-
getSortArtist
public String getSortArtist()
Description copied from interface:AudioSongReturns the "sort artist". E.g., for "The Beatles" the sort artist is "Beatles".- Specified by:
getSortArtistin interfaceAudioSong- Returns:
- sort artist
-
getSortAlbum
public String getSortAlbum()
Description copied from interface:AudioSongReturns the "sort album". E.g., for "A Hard Day's Night" the sort album is "Hard Day's Night".- Specified by:
getSortAlbumin interfaceAudioSong- Returns:
- sort album
-
getSortName
public String getSortName()
Description copied from interface:AudioSongReturns the "sort name". E.g., for "A Taste of Honey" the sort name is "Taste of Honey".- Specified by:
getSortNamein interfaceAudioSong- Returns:
- sort name
-
getSortAlbumArtist
public String getSortAlbumArtist()
Description copied from interface:AudioSongReturns the "sort album artist". E.g., for "The Beatles" the sort album artist is "Beatles".- Specified by:
getSortAlbumArtistin interfaceAudioSong- Returns:
- sort album artist
-
getSortComposer
public String getSortComposer()
Description copied from interface:AudioSongReturns the sort composer.- Specified by:
getSortComposerin interfaceAudioSong- Returns:
- sort composer
-
getSortShow
public String getSortShow()
Description copied from interface:AudioSongReturns the sort show.- Specified by:
getSortShowin interfaceAudioSong- Returns:
- sort show
-
getContentRating
public String getContentRating()
Description copied from interface:AudioSongReturns the content rating. E.g., "us-tv|TV-PG|400|" or "us-tv|TV-MA|600|dialogue and sexual content"- Specified by:
getContentRatingin interfaceAudioSong- Returns:
- content rating
-
isPurchased
public boolean isPurchased()
Description copied from interface:AudioSongIndicates whether this song was purchased (via the iTunes store).- Specified by:
isPurchasedin interfaceAudioSong- Returns:
trueorfalse
-
getPlayFrequency
public double getPlayFrequency()
Description copied from interface:AudioSongNumber of times played per 100 days.- Specified by:
getPlayFrequencyin interfaceAudioSong- Returns:
- played per 100 days
- See Also:
AudioSong.getRemotePlayFrequency()
-
getPlaySkipRatio
public double getPlaySkipRatio()
Description copied from interface:AudioSongPlay/Skip ratio. Defined asplayCount/(skipCount+1).- Specified by:
getPlaySkipRatioin interfaceAudioSong- Returns:
- playSkip ratio as defined above
- See Also:
AudioSong.getRemotePlaySkipRatio(),AudioSong.getPopularity()
-
getPath
public String getPath()
Description copied from interface:AudioSongPath.- Specified by:
getPathin interfaceAudioSong- Returns:
- path object for
AudioSong.getLocation()or null, if a proper file object cannot be formed
-
canWrite
public boolean canWrite()
Description copied from interface:AudioSongChecks whether the file corresponding to this song can in principal be written to.
-
hasProtectedFileExtension
public boolean hasProtectedFileExtension()
Description copied from interface:AudioSongChecks 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:
hasProtectedFileExtensionin interfaceAudioSong- Returns:
- true, if we know that the file-format is usually protected.
-
getBeatsPerMinute
public float getBeatsPerMinute()
Description copied from interface:AudioSongBeats per minute (BPM).- Specified by:
getBeatsPerMinutein interfaceAudioSong- Returns:
- beats per minute
- See Also:
AudioSong.getTempo()
-
getTempo
public com.tagtraum.audiokern.bpm.Tempo getTempo()
Description copied from interface:AudioSongReturns tempo.
-
getKey
public Key getKey()
Description copied from interface:AudioSongReturn the tonal key of this song. E.g.,MajorKey.C_MAJOR.
-
getKeyAlgorithm
public String getKeyAlgorithm()
Description copied from interface:AudioSongReturns the name of the key algorithm. May beEntered, if the key value was entered.- Specified by:
getKeyAlgorithmin interfaceAudioSong- Returns:
- key algorithm
-
getSpectrum
public com.tagtraum.audiokern.timbre.BarkSpectrum getSpectrum()
Description copied from interface:AudioSongReturns the bark spectrum.- Specified by:
getSpectrumin interfaceAudioSong- Returns:
- bark spectrum
- See Also:
AudioSong.getTempoTimbreColor()
-
getTempoColor
public Color getTempoColor()
Description copied from interface:AudioSongProjection ofAudioSong.getTempoSpectrum()to a color.- Specified by:
getTempoColorin interfaceAudioSong- Returns:
- color or null
-
getTempoTimbreColor
public Color getTempoTimbreColor()
Description copied from interface:AudioSongProjection ofAudioSong.getTempoSpectrum()andAudioSong.getSpectrum()to a color.- Specified by:
getTempoTimbreColorin interfaceAudioSong- Returns:
- color or null
-
getTempoSpectrum
public com.tagtraum.audiokern.bpm.TempoSpectrum getTempoSpectrum()
Description copied from interface:AudioSongReturns the tempo spectrum.- Specified by:
getTempoSpectrumin interfaceAudioSong- Returns:
- tempo spectrum
- See Also:
AudioSong.getTempoColor(),AudioSong.getTempoTimbreColor()
-
getBeatsPerMinuteAlgorithm
public String getBeatsPerMinuteAlgorithm()
Description copied from interface:AudioSongReturns the name of the algorithm used to determine the beats per minute (BPM).- Specified by:
getBeatsPerMinuteAlgorithmin interfaceAudioSong- Returns:
- algorithm name
-
getLanguage
public String getLanguage()
Description copied from interface:AudioSongThe language of the lyrics as ISO 639 three letter codes.- Specified by:
getLanguagein interfaceAudioSong- Returns:
- ISO 639 three letter language code
-
getFingerprint
public byte[] getFingerprint()
Description copied from interface:AudioSongAcoustic fingerprint.- Specified by:
getFingerprintin interfaceAudioSong- Returns:
- acoustic fingerprint
-
getTimeSignature
public TimeSignature getTimeSignature()
Description copied from interface:AudioSongThe song's time signature.- Specified by:
getTimeSignaturein interfaceAudioSong- Returns:
- time signature
-
getMoodKeywords
public Set<String> getMoodKeywords()
Description copied from interface:AudioSongGet raw mood keywords.- Specified by:
getMoodKeywordsin interfaceAudioSong- Returns:
- mood keywords
-
getBeatsAlgorithm
public String getBeatsAlgorithm()
Description copied from interface:AudioSongMethod the beats were computed with.- Specified by:
getBeatsAlgorithmin interfaceAudioSong- Returns:
- algorithm the beats were computed with
-
getSegments
public Segments getSegments()
Description copied from interface:AudioSongThe song's segments.- Specified by:
getSegmentsin interfaceAudioSong- Returns:
- segments
-
getSegmentsAlgorithm
public String getSegmentsAlgorithm()
Description copied from interface:AudioSongMethod the segments were computed with.- Specified by:
getSegmentsAlgorithmin interfaceAudioSong- Returns:
- algorithm the segments were computed with
-
getSimilarities
public Similarities getSimilarities()
Description copied from interface:AudioSongThe song's similarities.- Specified by:
getSimilaritiesin interfaceAudioSong- Returns:
- similarities
-
getSimilaritiesAlgorithm
public String getSimilaritiesAlgorithm()
Description copied from interface:AudioSongMethod the similarities were computed with.- Specified by:
getSimilaritiesAlgorithmin interfaceAudioSong- Returns:
- algorithm the similarities were computed with
-
getLoudness
public Loudness getLoudness()
Description copied from interface:AudioSongThe song's loudness curve.- Specified by:
getLoudnessin interfaceAudioSong- Returns:
- loudness
-
getMeasuresPerMinute
public float getMeasuresPerMinute()
Description copied from interface:AudioSongMeasures (bars) per minute. This value is computed fromAudioSong.getBeatsPerMinute()andAudioSong.getTimeSignature(). In essence BPM is divided by meter (time signature) numerator.- Specified by:
getMeasuresPerMinutein interfaceAudioSong- Returns:
- measures/bars per minute or zero, if either the time signature or the BPM is not known
-
getTuningAlgorithm
public String getTuningAlgorithm()
Description copied from interface:AudioSongThe method the current tuning was created with.- Specified by:
getTuningAlgorithmin interfaceAudioSong- Returns:
- tuning algorithm
-
getMoodAlgorithm
public String getMoodAlgorithm()
Description copied from interface:AudioSongThe method the associated mood value was created with.- Specified by:
getMoodAlgorithmin interfaceAudioSong- Returns:
- mood algorithm
-
getTimeSignatureAlgorithm
public String getTimeSignatureAlgorithm()
Description copied from interface:AudioSongMethod the time signature was computed with.- Specified by:
getTimeSignatureAlgorithmin interfaceAudioSong- Returns:
- algorithm the time signature was computed with
-
getCustom1
public String getCustom1()
Description copied from interface:AudioSongCustom field.- Specified by:
getCustom1in interfaceAudioSong- Returns:
- custom field
-
getCustom2
public String getCustom2()
Description copied from interface:AudioSongCustom field.- Specified by:
getCustom2in interfaceAudioSong- Returns:
- custom field
-
getCustom3
public String getCustom3()
Description copied from interface:AudioSongCustom field.- Specified by:
getCustom3in interfaceAudioSong- Returns:
- custom field
-
getCustom4
public String getCustom4()
Description copied from interface:AudioSongCustom field.- Specified by:
getCustom4in interfaceAudioSong- Returns:
- custom field
-
getCustom5
public String getCustom5()
Description copied from interface:AudioSongCustom field.- Specified by:
getCustom5in interfaceAudioSong- Returns:
- custom field
-
getRemoteUpdateDate
public Date getRemoteUpdateDate()
Description copied from interface:AudioSongTime the remote properties of this song were last updated. Remote are e.g.AudioSong.getRemotePlayFrequency()orAudioSong.getPopularity().- Specified by:
getRemoteUpdateDatein interfaceAudioSong- Returns:
- date or
null, if never
-
getRemoteRating
public int getRemoteRating()
Description copied from interface:AudioSongAverage of other people's ratings.- Specified by:
getRemoteRatingin interfaceAudioSong- Returns:
- mean of ratings
-
getPopularity
public float getPopularity()
Description copied from interface:AudioSongPopularity as a value between 0 and 1.- Specified by:
getPopularityin interfaceAudioSong- Returns:
- popularity among all users
-
getRemotePlayFrequency
public float getRemotePlayFrequency()
Description copied from interface:AudioSongAverage of play frequencies as reported by users.- Specified by:
getRemotePlayFrequencyin interfaceAudioSong- Returns:
- play frequency
- See Also:
AudioSong.getPlayFrequency()
-
getRemotePlaySkipRatio
public float getRemotePlaySkipRatio()
Description copied from interface:AudioSongPlay/skip ratio by all users with this song.- Specified by:
getRemotePlaySkipRatioin interfaceAudioSong- Returns:
- play/skip ratio
- See Also:
AudioSong.getPlaySkipRatio()
-
getRemoteLoved
public float getRemoteLoved()
Description copied from interface:AudioSongIndicates, what percentage of people "love" this song. May be much lower than expected.- Specified by:
getRemoteLovedin interfaceAudioSong- Returns:
- value between 0 and 1.
- See Also:
AudioSong.getRemoteDisliked(),AudioSong.getLiking()
-
getRemoteDisliked
public float getRemoteDisliked()
Description copied from interface:AudioSongIndicates, what percentage of people "dislike" this song. May be much lower than expected.- Specified by:
getRemoteDislikedin interfaceAudioSong- Returns:
- value between 0 and 1.
- See Also:
AudioSong.getRemoteLoved(),AudioSong.getLiking()
-
getRMSMean
public Float getRMSMean()
Description copied from interface:AudioSongRoot mean square (RMS) of the signal's energy, averaged over windows of length ~23ms (actually 1024/44100 frames for a signal with sample rate 44.1kHz, i.e. 23.22ms) with a hopsize of half a window. Only the first 120 seconds of the audio are considered, the rest is discarded.- Specified by:
getRMSMeanin interfaceAudioSong- Returns:
- average RMS for the first 120 seconds
- See Also:
TemporalFeaturePipelines.createAverageRootMeanSquarePipeline(String, int, int),Floats.rootMeanSquare(float[]),AudioSong.getRMSStandardDeviation()
-
getRMSStandardDeviation
public Float getRMSStandardDeviation()
Description copied from interface:AudioSongStandard 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:
getRMSStandardDeviationin interfaceAudioSong- Returns:
- standard deviation of the RMS for the first 120 seconds
- See Also:
Floats.rootMeanSquare(float[]),AudioSong.getRMSMean()
-
getSpectralCentroidMean
public Float getSpectralCentroidMean()
Description copied from interface:AudioSongAverage of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length. Only the first 120 seconds of the signal are considered, the rest is discarded.- Specified by:
getSpectralCentroidMeanin interfaceAudioSong- Returns:
- averaged spectral centroid
- See Also:
SpectralFeaturePipelines.createAverageSpectralCentroidPipeline(String, int, int, int)
-
getSpectralSpreadMean
public Float getSpectralSpreadMean()
Description copied from interface:AudioSongAverage of the spectral spread 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:
getSpectralSpreadMeanin interfaceAudioSong- Returns:
- average spectral spread
- See Also:
SpectralFeaturePipelines.createAverageSpectralSpreadPipeline(String, int, int, int)
-
getRelativeSpectralEntropyMean
public Float getRelativeSpectralEntropyMean()
Description copied from interface:AudioSongAverage of relative entropy values computed for windows of length 1.486s with a hopsize of half a window. Only the first 120 seconds of the signal are considered, the rest is discarded.- Specified by:
getRelativeSpectralEntropyMeanin interfaceAudioSong- Returns:
- average relative entropy
- See Also:
AggregateFunctions.RELATIVE_ENTROPY,SpectralFeaturePipelines.createAverageRelativeSpectralEntropyPipeline(String, int, int, int)
-
getSpectralFluctuationPeak
public Float getSpectralFluctuationPeak()
Description copied from interface:AudioSongPeak of the averaged 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.- Specified by:
getSpectralFluctuationPeakin interfaceAudioSong- Returns:
- peak of an averaged fluctuation spectrum
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluctuationPipeline(String, int)
-
getSpectralVariabilityMean
public Float getSpectralVariabilityMean()
Description copied from interface:AudioSongAverage of the spectral variability 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:
getSpectralVariabilityMeanin interfaceAudioSong- Returns:
- average spectral variability
- See Also:
SpectralFeaturePipelines.createAverageSpectralVariabilityPipeline(String, int, int, int)
-
getSpectralFluxMean
public Float getSpectralFluxMean()
Description copied from interface:AudioSongAverage of the spectral flux 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:
getSpectralFluxMeanin interfaceAudioSong- Returns:
- average spectral flux
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluxPipeline(String, int, int, int)
-
getSpectralNoveltyMean
public Float getSpectralNoveltyMean()
Description copied from interface:AudioSongAverage 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:
getSpectralNoveltyMeanin interfaceAudioSong- Returns:
- average spectral novelty
-
getLyricsTermFrequencies
public List<TermFrequency> getLyricsTermFrequencies()
Description copied from interface:AudioSongTerms in this song's lyrics along with their frequency. All terms are lowercase, regular ASCII punctuation has been removed.- Specified by:
getLyricsTermFrequenciesin interfaceAudioSong- Returns:
- term frequencies
-
getTrackReplayGain
public ReplayGain getTrackReplayGain()
Description copied from interface:AudioSongReplay gain for this track (not taking other tracks in an album into account).- Specified by:
getTrackReplayGainin interfaceAudioSong- Returns:
- replay gain
- See Also:
- "Radio" replay gain
-
getAlbumReplayGain
public ReplayGain getAlbumReplayGain()
Description copied from interface:AudioSongReplay gain for this album.- Specified by:
getAlbumReplayGainin interfaceAudioSong- Returns:
- replay gain
- See Also:
- "Audiophile" replay gain,
AudioSong.getTrackReplayGain()
-
delete
protected static void delete(File... files)
-
copy
protected static void copy(File[] from, File[] to) throws IOException
- Throws:
IOException
-
getFolderImage
protected Image getFolderImage()
Try to load image from the same folder the song is in. The image must be stored in a file calledfolder.jpg,folder.jpeg,folder.png,cover.jpg, orcover.png(each with lowercase or uppercase first char).- Returns:
- image or
null
-
updateTempoTimbreColor
protected void updateTempoTimbreColor(AudioMetaData audioMetaData)
-
-