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 ExecutorService
audioMetaDataExecutor
protected MediaLibrary
musicLibrary
protected Song
song
protected ExecutorService
tunesExecutor
-
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 void
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.void
addPropertyChangeListener(String property, PropertyChangeListener propertyChangeListener)
Lets you add a property change listener to this song.boolean
canWrite()
Checks whether the file corresponding to this song can in principal be written to.protected static void
copy(File[] from, File[] to)
protected static void
delete(File... files)
protected void
firePropertyChange(String propertyName, Object oldValue, Object value)
String
getAlbum()
Get Album.String
getAlbumArtist()
Get album artist.AudioSong.Liking
getAlbumLiking()
Is album liked.int
getAlbumRating()
Get album rating.ReplayGain
getAlbumReplayGain()
Replay gain for this album.String
getArtist()
Get artist.int
getArtworkCount()
Get artwork count.Beats
getBeats()
The song's beats.String
getBeatsAlgorithm()
Method the beats were computed with.float
getBeatsPerMinute()
Beats per minute (BPM).String
getBeatsPerMinuteAlgorithm()
Returns the name of the algorithm used to determine the beats per minute (BPM).int
getBitRate()
Bit rate.Color
getColor()
Returns the color.String
getComments()
Get comments.String
getComposer()
Get composer(s).String
getContentRating()
Returns the content rating.String
getCustom1()
Custom field.String
getCustom2()
Custom field.String
getCustom3()
Custom field.String
getCustom4()
Custom field.String
getCustom5()
Custom field.Float
getDanceability()
Danceability.String
getDanceabilityAlgorithm()
Returns the name of the danceability algorithm.Date
getDateAdded()
Get date the song was added to the library.Date
getDateAnalyzed()
Date the song was last analyzed.Date
getDateModified()
Get date of last modification.String
getDescription()
Description/subtitle of this song.int
getDiscCount()
Assuming that this song is on a disc that is part of a disc collection, return the number of discs in this collection.int
getDiscNumber()
Get the disc number.String
getEpisode()
Get episode name.int
getEpisodeOrder()
Episode order.byte[]
getFingerprint()
Acoustic fingerprint.float
getFinish()
Stop time of the song in seconds.protected Image
getFolderImage()
Try to load image from the same folder the song is in.String
getGenre()
Get genre.String
getGrouping()
Get grouping.Long
getId()
Persistent id.AudioSong.Instrumentation
getInstrumentation()
Indicates whether this song qualifies as "electronic" or "acoustic".String
getInstrumentationAlgorithm()
Returns the name of the instrumentation algorithm.Key
getKey()
Return the tonal key of this song.String
getKeyAlgorithm()
Returns the name of the key algorithm.String
getKind()
Kind of audio, e.g.String
getLanguage()
The language of the lyrics as ISO 639 three letter codes.AudioSong.Liking
getLiking()
Liking.String
getLocation(boolean refresh)
Location of this track.Loudness
getLoudness()
The song's loudness curve.List<TermFrequency>
getLyricsTermFrequencies()
Terms in this song's lyrics along with their frequency.float
getMeasuresPerMinute()
Measures (bars) per minute.AudioSong.MediaKind
getMediaKind()
Media kind of this object.Mood
getMood()
The song's mood.String
getMoodAlgorithm()
The method the associated mood value was created with.Set<String>
getMoodKeywords()
Get raw mood keywords.String
getMovement()
Classical movement.int
getMovementCount()
Classical movement count.int
getMovementNumber()
Classical movement number.String
getName()
Name of this song.String
getPath()
Path.int
getPlayCount()
Get the number of times the song was played.long
getPlayDate()
Get time the song was last played.Date
getPlayDateUTC()
Get play date.double
getPlayFrequency()
Number of times played per 100 days.double
getPlaySkipRatio()
Play/Skip ratio.float
getPopularity()
Popularity as a value between 0 and 1.PropertyChangeListener[]
getPropertyChangeListeners()
PropertyChangeListener[]
getPropertyChangeListeners(String property)
int
getRating()
Value ranging from 0-100, 100 being best.Float
getRelativeSpectralEntropyMean()
Average of relative entropy values computed for windows of length 1.486s with a hopsize of half a window.Date
getReleaseDate()
Release year (corresponds to id3 TDRL).float
getRemoteDisliked()
Indicates, what percentage of people "dislike" this song.float
getRemoteLoved()
Indicates, what percentage of people "love" this song.float
getRemotePlayFrequency()
Average of play frequencies as reported by users.float
getRemotePlaySkipRatio()
Play/skip ratio by all users with this song.int
getRemoteRating()
Average of other people's ratings.Date
getRemoteUpdateDate()
Time the remote properties of this song were last updated.Float
getRMSMean()
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.Float
getRMSStandardDeviation()
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.int
getSampleRate()
Get sample rate in Hz.int
getSeason()
Get season number.Segments
getSegments()
The song's segments.String
getSegmentsAlgorithm()
Method the segments were computed with.String
getShow()
Name of a show, suitable for TV shows.Similarities
getSimilarities()
The song's similarities.String
getSimilaritiesAlgorithm()
Method the similarities were computed with.long
getSize()
File size.int
getSkipCount()
Get skip count.Date
getSkipDate()
Get skip date.String
getSortAlbum()
Returns the "sort album".String
getSortAlbumArtist()
Returns the "sort album artist".String
getSortArtist()
Returns the "sort artist".String
getSortComposer()
Returns the sort composer.String
getSortName()
Returns the "sort name".String
getSortShow()
Returns the sort show.Float
getSpectralCentroidMean()
Average of the spectral centroids computed for individual windows of length ~23.22ms with a hopsize of half a window length.Float
getSpectralFluctuationPeak()
Peak of the averaged spectral fluctuation values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralFluxMean()
Average of the spectral flux values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralNoveltyMean()
Average of the spectral novelty values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralSpreadMean()
Average of the spectral spread values computed for windows of length 23.22ms, with a hopsize of half a window.Float
getSpectralVariabilityMean()
Average of the spectral variability values computed for windows of length 23.22ms, with a hopsize of half a window.com.tagtraum.audiokern.timbre.BarkSpectrum
getSpectrum()
Returns the bark spectrum.float
getStart()
Start time of the song in seconds.int
getStartTime()
Start time of the song in ms.int
getStopTime()
Stop time of the song in ms.com.tagtraum.audiokern.bpm.Tempo
getTempo()
Returns tempo.Color
getTempoColor()
Projection ofAudioSong.getTempoSpectrum()
to a color.com.tagtraum.audiokern.bpm.TempoSpectrum
getTempoSpectrum()
Returns the tempo spectrum.Color
getTempoTimbreColor()
Projection ofAudioSong.getTempoSpectrum()
andAudioSong.getSpectrum()
to a color.TimeSignature
getTimeSignature()
The song's time signature.String
getTimeSignatureAlgorithm()
Method the time signature was computed with.int
getTotalTime()
Total length of the song in ms.int
getTrackCount()
Number of tracks on album/release/recording.int
getTrackNumber()
Get the number of the track on the release/album/recording.ReplayGain
getTrackReplayGain()
Replay gain for this track (not taking other tracks in an album into account).AudioSong.TrackType
getTrackType()
Track type.Integer
getTuning()
Tuning in cents.String
getTuningAlgorithm()
The method the current tuning was created with.int
getVolumeAdjustment()
Value between -255 and 255.String
getWork()
Classical work.int
getYear()
Release year - (corresponds to id3 TDRC, recording time).int
hashCode()
boolean
hasProtectedFileExtension()
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.boolean
isAlbumRatingComputed()
Indicates whether the value returned byAudioSong.getAlbumRating()
was computed or set manually.boolean
isClean()
Indicates whether this song is "clean" - whatever that means.boolean
isCompilation()
Indicates whether this track is part of a compilation.protected boolean
isDifferent(Object value1, Object value2)
boolean
isDisabled()
Indicates whether this song is disabled or unchecked.boolean
isEnabled()
Indicates whether this song is enabled or checked.boolean
isExplicit()
Indicates whether this tracks is explicit or not.boolean
isHasVideo()
Indicates whether this track has a video.boolean
isHD()
Indicates whether this video content is in high definition (HD).boolean
isPartOfGaplessAlbum()
Indicates whether this songs is part of a gapless album.boolean
isProtected()
boolean
isPurchased()
Indicates whether this song was purchased (via the iTunes store).boolean
isRatingComputed()
Indicates whether the value returned byAudioSong.getRating()
was computed or set manually.boolean
isShared()
Indicates whether this track is a shared track, i.e.boolean
isUnplayed()
Indicates whether this songs has been played at some point.void
removePropertyChangeListener(PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
removePropertyChangeListener(String property, PropertyChangeListener listener)
Lets you remove a property change listener to this song.void
setDisabled(boolean disabled)
Enables/disables this song.protected void
updateTempoTimbreColor(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:AudioSong
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListener
in 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:AudioSong
Lets you add a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
addPropertyChangeListener
in 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:AudioSong
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListener
in interfaceAudioSong
- Parameters:
property
- property namelistener
- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface:AudioSong
Lets you remove a property change listener to this song. This is an optional feature and may lead to exceptions.- Specified by:
removePropertyChangeListener
in interfaceAudioSong
- Parameters:
listener
- property change listener- See Also:
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String property)
- Specified by:
getPropertyChangeListeners
in interfaceAudioSong
- See Also:
PropertyChangeSupport.getPropertyChangeListeners(String)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()
- Specified by:
getPropertyChangeListeners
in interfaceAudioSong
- See Also:
PropertyChangeSupport.getPropertyChangeListeners()
-
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.
-
firePropertyChange
protected void firePropertyChange(String propertyName, Object oldValue, Object value)
-
getDescription
public String getDescription()
Description copied from interface:AudioSong
Description/subtitle of this song.- Specified by:
getDescription
in interfaceAudioSong
- Returns:
- description
-
getMovement
public String getMovement()
Description copied from interface:AudioSong
Classical movement.- Specified by:
getMovement
in interfaceAudioSong
- Returns:
- movement
-
getMovementNumber
public int getMovementNumber()
Description copied from interface:AudioSong
Classical movement number.- Specified by:
getMovementNumber
in interfaceAudioSong
- Returns:
- movement number
-
getMovementCount
public int getMovementCount()
Description copied from interface:AudioSong
Classical movement count.- Specified by:
getMovementCount
in interfaceAudioSong
- Returns:
- count
-
getAlbumArtist
public String getAlbumArtist()
Description copied from interface:AudioSong
Get album artist.- Specified by:
getAlbumArtist
in interfaceAudioSong
- Returns:
- album artist
-
getComposer
public String getComposer()
Description copied from interface:AudioSong
Get composer(s).- Specified by:
getComposer
in interfaceAudioSong
- Returns:
- composer(s)
-
getGrouping
public String getGrouping()
Description copied from interface:AudioSong
Get grouping.- Specified by:
getGrouping
in interfaceAudioSong
- Returns:
- grouping
-
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 fromiTunes Music Library.xml
and may simply benull
for non-iTunes libraries.
-
getSize
public long getSize()
Description copied from interface:AudioSong
File size.
-
getTotalTime
public int getTotalTime()
Description copied from interface:AudioSong
Total length of the song in ms.- Specified by:
getTotalTime
in interfaceAudioSong
- Returns:
- length in ms.
-
getTrackCount
public int getTrackCount()
Description copied from interface:AudioSong
Number of tracks on album/release/recording.- Specified by:
getTrackCount
in interfaceAudioSong
- Returns:
- track count
- See Also:
AudioSong.getTrackNumber()
-
getStartTime
public int getStartTime()
Description copied from interface:AudioSong
Start time of the song in ms.- Specified by:
getStartTime
in interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- stop time in ms.
-
getStart
public float getStart()
Description copied from interface:AudioSong
Start time of the song in seconds.- Specified by:
getStart
in interfaceAudioSong
- Returns:
- start time in seconds.
- See Also:
AudioSong.getStartTime()
-
getFinish
public float getFinish()
Description copied from interface:AudioSong
Stop time of the song in seconds.- Specified by:
getFinish
in interfaceAudioSong
- Returns:
- stop time in seconds.
- See Also:
AudioSong.getStopTime()
-
getTrackNumber
public int getTrackNumber()
Description copied from interface:AudioSong
Get the number of the track on the release/album/recording.- Specified by:
getTrackNumber
in interfaceAudioSong
- Returns:
- track number
-
getDiscNumber
public int getDiscNumber()
Description copied from interface:AudioSong
Get the disc number.- Specified by:
getDiscNumber
in interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- disc count
-
getYear
public int getYear()
Description copied from interface:AudioSong
Release year - (corresponds to id3 TDRC, recording time).- Specified by:
getYear
in interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- date
-
getDateAnalyzed
public Date getDateAnalyzed()
Description copied from interface:AudioSong
Date the song was last analyzed.- Specified by:
getDateAnalyzed
in interfaceAudioSong
- Returns:
- date analyzed
-
getDateAdded
public Date getDateAdded()
Description copied from interface:AudioSong
Get date the song was added to the library.- Specified by:
getDateAdded
in interfaceAudioSong
- Returns:
- date added
-
getBitRate
public int getBitRate()
Description copied from interface:AudioSong
Bit rate.- Specified by:
getBitRate
in interfaceAudioSong
- Returns:
- bit rate
-
getSampleRate
public int getSampleRate()
Description copied from interface:AudioSong
Get sample rate in Hz.- Specified by:
getSampleRate
in interfaceAudioSong
- Returns:
- sample rate in Hz
-
getVolumeAdjustment
public int getVolumeAdjustment()
Description copied from interface:AudioSong
Value between -255 and 255.- Specified by:
getVolumeAdjustment
in interfaceAudioSong
- Returns:
- volume adjustment
-
getComments
public String getComments()
Description copied from interface:AudioSong
Get comments.- Specified by:
getComments
in interfaceAudioSong
- Returns:
- comments
-
getPlayCount
public int getPlayCount()
Description copied from interface:AudioSong
Get the number of times the song was played.- Specified by:
getPlayCount
in interfaceAudioSong
- Returns:
- play count
-
getPlayDate
public long getPlayDate()
Description copied from interface:AudioSong
Get time the song was last played. Returns0
, if it has never been played.- Specified by:
getPlayDate
in 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:AudioSong
Get play date.- Specified by:
getPlayDateUTC
in interfaceAudioSong
- Returns:
- play date
-
getSkipCount
public int getSkipCount()
Description copied from interface:AudioSong
Get skip count.- Specified by:
getSkipCount
in interfaceAudioSong
- Returns:
- skip count
-
getSkipDate
public Date getSkipDate()
Description copied from interface:AudioSong
Get skip date.- Specified by:
getSkipDate
in interfaceAudioSong
- Returns:
- skip date
-
getReleaseDate
public Date getReleaseDate()
Description copied from interface:AudioSong
Release year (corresponds to id3 TDRL).- Specified by:
getReleaseDate
in interfaceAudioSong
- Returns:
- release time
-
getArtworkCount
public int getArtworkCount()
Description copied from interface:AudioSong
Get artwork count.- Specified by:
getArtworkCount
in interfaceAudioSong
- Returns:
- artwork count
-
getRating
public int getRating()
Description copied from interface:AudioSong
Value ranging from 0-100, 100 being best.- Specified by:
getRating
in interfaceAudioSong
- Returns:
- rating
- See Also:
AudioSong.isRatingComputed()
,AudioSong.getAlbumRating()
-
getAlbumRating
public int getAlbumRating()
Description copied from interface:AudioSong
Get album rating.- Specified by:
getAlbumRating
in interfaceAudioSong
- Returns:
- album rating
- See Also:
AudioSong.isAlbumRatingComputed()
-
isRatingComputed
public boolean isRatingComputed()
Description copied from interface:AudioSong
Indicates whether the value returned byAudioSong.getRating()
was computed or set manually.- Specified by:
isRatingComputed
in interfaceAudioSong
- Returns:
true
orfalse
-
isAlbumRatingComputed
public boolean isAlbumRatingComputed()
Description copied from interface:AudioSong
Indicates whether the value returned byAudioSong.getAlbumRating()
was computed or set manually.- Specified by:
isAlbumRatingComputed
in interfaceAudioSong
- Returns:
true
orfalse
-
getLiking
public AudioSong.Liking getLiking()
Description copied from interface:AudioSong
Liking. This is an expression of iTunes' loved and disliked fields.
-
getAlbumLiking
public AudioSong.Liking getAlbumLiking()
Description copied from interface:AudioSong
Is album liked. This is an expression of iTunes' album loved and album disliked fields.- Specified by:
getAlbumLiking
in interfaceAudioSong
- Returns:
- liking
-
getInstrumentation
public AudioSong.Instrumentation getInstrumentation()
Description copied from interface:AudioSong
Indicates whether this song qualifies as "electronic" or "acoustic".- Specified by:
getInstrumentation
in interfaceAudioSong
- Returns:
- instrumentation
-
getInstrumentationAlgorithm
public String getInstrumentationAlgorithm()
Description copied from interface:AudioSong
Returns the name of the instrumentation algorithm. May beEntered
, if the value was entered.- Specified by:
getInstrumentationAlgorithm
in interfaceAudioSong
- Returns:
- instrumentation algorithm
-
getDanceability
public Float getDanceability()
Description copied from interface:AudioSong
Danceability.- Specified by:
getDanceability
in interfaceAudioSong
- Returns:
- normalized positive value (0-1)
-
getDanceabilityAlgorithm
public String getDanceabilityAlgorithm()
Description copied from interface:AudioSong
Returns the name of the danceability algorithm. May beEntered
, if the value was entered.- Specified by:
getDanceabilityAlgorithm
in interfaceAudioSong
- Returns:
- danceability algorithm
-
getShow
public String getShow()
Description copied from interface:AudioSong
Name of a show, suitable for TV shows.
-
getSeason
public int getSeason()
Description copied from interface:AudioSong
Get season number. Suitable for TV-shows.
-
getEpisode
public String getEpisode()
Description copied from interface:AudioSong
Get episode name.- Specified by:
getEpisode
in interfaceAudioSong
- Returns:
- episode name
-
getEpisodeOrder
public int getEpisodeOrder()
Description copied from interface:AudioSong
Episode order.- Specified by:
getEpisodeOrder
in interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
true
orfalse
-
getId
public Long getId()
Description copied from interface:AudioSong
Persistent id. Survives application shutdown.
-
isEnabled
public boolean isEnabled()
Description copied from interface:AudioSong
Indicates whether this song is enabled or checked.
-
isDisabled
public boolean isDisabled()
Description copied from interface:AudioSong
Indicates whether this song is disabled or unchecked.- Specified by:
isDisabled
in interfaceAudioSong
- Returns:
- !
AudioSong.isEnabled()
-
setDisabled
public void setDisabled(boolean disabled)
Description copied from interface:AudioSong
Enables/disables this song.- Specified by:
setDisabled
in interfaceAudioSong
- Parameters:
disabled
-true
orfalse
-
getTrackType
public AudioSong.TrackType getTrackType()
Description copied from interface:AudioSong
Track type. E.g.AudioSong.TrackType.FILE
.- Specified by:
getTrackType
in interfaceAudioSong
- Returns:
- track type
- See Also:
AudioSong.setTrackType(TrackType)
-
getMediaKind
public AudioSong.MediaKind getMediaKind()
Description copied from interface:AudioSong
Media kind of this object.- Specified by:
getMediaKind
in interfaceAudioSong
- Returns:
- kind of media
-
isUnplayed
public boolean isUnplayed()
Description copied from interface:AudioSong
Indicates whether this songs has been played at some point.- Specified by:
isUnplayed
in interfaceAudioSong
- Returns:
true
orfalse
-
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 interfaceAudioSong
- Returns:
true
orfalse
- See Also:
AudioSong.isExplicit()
-
isHasVideo
public boolean isHasVideo()
Description copied from interface:AudioSong
Indicates whether this track has a video.- Specified by:
isHasVideo
in interfaceAudioSong
- Returns:
true
orfalse
-
isProtected
public boolean isProtected()
Description copied from interface:AudioSong
- Specified by:
isProtected
in interfaceAudioSong
- Returns:
true
orfalse
-
getLocation
public String getLocation(boolean refresh)
Description copied from interface:AudioSong
Location of this track. Ifrefresh
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 interfaceAudioSong
- Parameters:
refresh
- refresh from backend- Returns:
- location
- See Also:
AudioSong.getLocation()
,AudioSong.getFile(boolean)
-
isPartOfGaplessAlbum
public boolean isPartOfGaplessAlbum()
Description copied from interface:AudioSong
Indicates whether this songs is part of a gapless album.- Specified by:
isPartOfGaplessAlbum
in interfaceAudioSong
- Returns:
true
orfalse
-
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 interfaceAudioSong
- Returns:
true
orfalse
- See Also:
AudioSong.isClean()
-
isHD
public boolean isHD()
Description copied from interface:AudioSong
Indicates whether this video content is in high definition (HD).
-
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 interfaceAudioSong
- 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 interfaceAudioSong
- 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 interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- sort album artist
-
getSortComposer
public String getSortComposer()
Description copied from interface:AudioSong
Returns the sort composer.- Specified by:
getSortComposer
in interfaceAudioSong
- Returns:
- sort composer
-
getSortShow
public String getSortShow()
Description copied from interface:AudioSong
Returns the sort show.- Specified by:
getSortShow
in interfaceAudioSong
- 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 interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
true
orfalse
-
getPlayFrequency
public double getPlayFrequency()
Description copied from interface:AudioSong
Number of times played per 100 days.- Specified by:
getPlayFrequency
in interfaceAudioSong
- Returns:
- played per 100 days
- See Also:
AudioSong.getRemotePlayFrequency()
-
getPlaySkipRatio
public double getPlaySkipRatio()
Description copied from interface:AudioSong
Play/Skip ratio. Defined asplayCount/(skipCount+1)
.- Specified by:
getPlaySkipRatio
in interfaceAudioSong
- Returns:
- playSkip ratio as defined above
- See Also:
AudioSong.getRemotePlaySkipRatio()
,AudioSong.getPopularity()
-
getPath
public String getPath()
Description copied from interface:AudioSong
Path.- Specified by:
getPath
in 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:AudioSong
Checks whether the file corresponding to this song can in principal be written to.
-
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 interfaceAudioSong
- Returns:
- true, if we know that the file-format is usually protected.
-
getBeatsPerMinute
public float getBeatsPerMinute()
Description copied from interface:AudioSong
Beats per minute (BPM).- Specified by:
getBeatsPerMinute
in interfaceAudioSong
- Returns:
- beats per minute
- See Also:
AudioSong.getTempo()
-
getTempo
public com.tagtraum.audiokern.bpm.Tempo getTempo()
Description copied from interface:AudioSong
Returns tempo.
-
getKey
public Key getKey()
Description copied from interface:AudioSong
Return the tonal key of this song. E.g.,MajorKey.C_MAJOR
.
-
getKeyAlgorithm
public String getKeyAlgorithm()
Description copied from interface:AudioSong
Returns the name of the key algorithm. May beEntered
, if the key value was entered.- Specified by:
getKeyAlgorithm
in interfaceAudioSong
- Returns:
- key algorithm
-
getSpectrum
public com.tagtraum.audiokern.timbre.BarkSpectrum getSpectrum()
Description copied from interface:AudioSong
Returns the bark spectrum.- Specified by:
getSpectrum
in interfaceAudioSong
- Returns:
- bark spectrum
- See Also:
AudioSong.getTempoTimbreColor()
-
getTempoColor
public Color getTempoColor()
Description copied from interface:AudioSong
Projection ofAudioSong.getTempoSpectrum()
to a color.- Specified by:
getTempoColor
in interfaceAudioSong
- Returns:
- color or null
-
getTempoTimbreColor
public Color getTempoTimbreColor()
Description copied from interface:AudioSong
Projection ofAudioSong.getTempoSpectrum()
andAudioSong.getSpectrum()
to a color.- Specified by:
getTempoTimbreColor
in interfaceAudioSong
- Returns:
- color or null
-
getTempoSpectrum
public com.tagtraum.audiokern.bpm.TempoSpectrum getTempoSpectrum()
Description copied from interface:AudioSong
Returns the tempo spectrum.- Specified by:
getTempoSpectrum
in interfaceAudioSong
- Returns:
- tempo spectrum
- See Also:
AudioSong.getTempoColor()
,AudioSong.getTempoTimbreColor()
-
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 interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- ISO 639 three letter language code
-
getFingerprint
public byte[] getFingerprint()
Description copied from interface:AudioSong
Acoustic fingerprint.- Specified by:
getFingerprint
in interfaceAudioSong
- Returns:
- acoustic fingerprint
-
getTimeSignature
public TimeSignature getTimeSignature()
Description copied from interface:AudioSong
The song's time signature.- Specified by:
getTimeSignature
in interfaceAudioSong
- Returns:
- time signature
-
getMoodKeywords
public Set<String> getMoodKeywords()
Description copied from interface:AudioSong
Get raw mood keywords.- Specified by:
getMoodKeywords
in interfaceAudioSong
- Returns:
- mood keywords
-
getBeatsAlgorithm
public String getBeatsAlgorithm()
Description copied from interface:AudioSong
Method the beats were computed with.- Specified by:
getBeatsAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the beats were computed with
-
getSegments
public Segments getSegments()
Description copied from interface:AudioSong
The song's segments.- Specified by:
getSegments
in interfaceAudioSong
- Returns:
- segments
-
getSegmentsAlgorithm
public String getSegmentsAlgorithm()
Description copied from interface:AudioSong
Method the segments were computed with.- Specified by:
getSegmentsAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the segments were computed with
-
getSimilarities
public Similarities getSimilarities()
Description copied from interface:AudioSong
The song's similarities.- Specified by:
getSimilarities
in interfaceAudioSong
- Returns:
- similarities
-
getSimilaritiesAlgorithm
public String getSimilaritiesAlgorithm()
Description copied from interface:AudioSong
Method the similarities were computed with.- Specified by:
getSimilaritiesAlgorithm
in interfaceAudioSong
- 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 interfaceAudioSong
- Returns:
- loudness
-
getMeasuresPerMinute
public float getMeasuresPerMinute()
Description copied from interface:AudioSong
Measures (bars) per minute. This value is computed fromAudioSong.getBeatsPerMinute()
andAudioSong.getTimeSignature()
. In essence BPM is divided by meter (time signature) numerator.- Specified by:
getMeasuresPerMinute
in 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:AudioSong
The method the current tuning was created with.- Specified by:
getTuningAlgorithm
in interfaceAudioSong
- Returns:
- tuning algorithm
-
getMoodAlgorithm
public String getMoodAlgorithm()
Description copied from interface:AudioSong
The method the associated mood value was created with.- Specified by:
getMoodAlgorithm
in interfaceAudioSong
- Returns:
- mood algorithm
-
getTimeSignatureAlgorithm
public String getTimeSignatureAlgorithm()
Description copied from interface:AudioSong
Method the time signature was computed with.- Specified by:
getTimeSignatureAlgorithm
in interfaceAudioSong
- Returns:
- algorithm the time signature was computed with
-
getCustom1
public String getCustom1()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom1
in interfaceAudioSong
- Returns:
- custom field
-
getCustom2
public String getCustom2()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom2
in interfaceAudioSong
- Returns:
- custom field
-
getCustom3
public String getCustom3()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom3
in interfaceAudioSong
- Returns:
- custom field
-
getCustom4
public String getCustom4()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom4
in interfaceAudioSong
- Returns:
- custom field
-
getCustom5
public String getCustom5()
Description copied from interface:AudioSong
Custom field.- Specified by:
getCustom5
in interfaceAudioSong
- Returns:
- custom field
-
getRemoteUpdateDate
public Date getRemoteUpdateDate()
Description copied from interface:AudioSong
Time the remote properties of this song were last updated. Remote are e.g.AudioSong.getRemotePlayFrequency()
orAudioSong.getPopularity()
.- Specified by:
getRemoteUpdateDate
in interfaceAudioSong
- Returns:
- date or
null
, if never
-
getRemoteRating
public int getRemoteRating()
Description copied from interface:AudioSong
Average of other people's ratings.- Specified by:
getRemoteRating
in interfaceAudioSong
- Returns:
- mean of ratings
-
getPopularity
public float getPopularity()
Description copied from interface:AudioSong
Popularity as a value between 0 and 1.- Specified by:
getPopularity
in interfaceAudioSong
- Returns:
- popularity among all users
-
getRemotePlayFrequency
public float getRemotePlayFrequency()
Description copied from interface:AudioSong
Average of play frequencies as reported by users.- Specified by:
getRemotePlayFrequency
in interfaceAudioSong
- Returns:
- play frequency
- See Also:
AudioSong.getPlayFrequency()
-
getRemotePlaySkipRatio
public float getRemotePlaySkipRatio()
Description copied from interface:AudioSong
Play/skip ratio by all users with this song.- Specified by:
getRemotePlaySkipRatio
in interfaceAudioSong
- Returns:
- play/skip ratio
- See Also:
AudioSong.getPlaySkipRatio()
-
getRemoteLoved
public float getRemoteLoved()
Description copied from interface:AudioSong
Indicates, what percentage of people "love" this song. May be much lower than expected.- Specified by:
getRemoteLoved
in interfaceAudioSong
- Returns:
- value between 0 and 1.
- See Also:
AudioSong.getRemoteDisliked()
,AudioSong.getLiking()
-
getRemoteDisliked
public float getRemoteDisliked()
Description copied from interface:AudioSong
Indicates, what percentage of people "dislike" this song. May be much lower than expected.- Specified by:
getRemoteDisliked
in interfaceAudioSong
- Returns:
- value between 0 and 1.
- See Also:
AudioSong.getRemoteLoved()
,AudioSong.getLiking()
-
getRMSMean
public Float getRMSMean()
Description copied from interface:AudioSong
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. 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:
getRMSMean
in 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: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 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:AudioSong
Average 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:
getSpectralCentroidMean
in interfaceAudioSong
- Returns:
- averaged spectral centroid
- See Also:
SpectralFeaturePipelines.createAverageSpectralCentroidPipeline(String, int, int, int)
-
getSpectralSpreadMean
public Float getSpectralSpreadMean()
Description copied from interface:AudioSong
Average 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:
getSpectralSpreadMean
in interfaceAudioSong
- Returns:
- average spectral spread
- See Also:
SpectralFeaturePipelines.createAverageSpectralSpreadPipeline(String, int, int, int)
-
getRelativeSpectralEntropyMean
public Float getRelativeSpectralEntropyMean()
Description copied from interface:AudioSong
Average 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:
getRelativeSpectralEntropyMean
in interfaceAudioSong
- Returns:
- average relative entropy
- See Also:
AggregateFunctions.RELATIVE_ENTROPY
,SpectralFeaturePipelines.createAverageRelativeSpectralEntropyPipeline(String, int, int, int)
-
getSpectralFluctuationPeak
public Float getSpectralFluctuationPeak()
Description copied from interface:AudioSong
Peak 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:
getSpectralFluctuationPeak
in interfaceAudioSong
- Returns:
- peak of an averaged fluctuation spectrum
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluctuationPipeline(String, int)
-
getSpectralVariabilityMean
public Float getSpectralVariabilityMean()
Description copied from interface:AudioSong
Average 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:
getSpectralVariabilityMean
in interfaceAudioSong
- Returns:
- average spectral variability
- See Also:
SpectralFeaturePipelines.createAverageSpectralVariabilityPipeline(String, int, int, int)
-
getSpectralFluxMean
public Float getSpectralFluxMean()
Description copied from interface:AudioSong
Average 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:
getSpectralFluxMean
in interfaceAudioSong
- Returns:
- average spectral flux
- See Also:
SpectralFeaturePipelines.createAverageSpectralFluxPipeline(String, int, int, int)
-
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 interfaceAudioSong
- Returns:
- average spectral novelty
-
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 interfaceAudioSong
- Returns:
- term frequencies
-
getTrackReplayGain
public ReplayGain getTrackReplayGain()
Description copied from interface:AudioSong
Replay gain for this track (not taking other tracks in an album into account).- Specified by:
getTrackReplayGain
in interfaceAudioSong
- Returns:
- replay gain
- See Also:
- "Radio" replay gain
-
getAlbumReplayGain
public ReplayGain getAlbumReplayGain()
Description copied from interface:AudioSong
Replay gain for this album.- Specified by:
getAlbumReplayGain
in 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)
-
-