Class AmazonSimilarityRule

    • Constructor Detail

      • AmazonSimilarityRule

        public AmazonSimilarityRule()
    • Method Detail

      • isSuitableForSorting

        public boolean isSuitableForSorting()
        Description copied from class: ScoreRule
        Indicates whether this rule can be used for sorting a playlist, meaning whether it is cheap enough for for many invocations for many songs. The rule can still be used efficiently for matching.
        Overrides:
        isSuitableForSorting in class ScoreRule
        Returns:
        by default this returns true, if an implementation is not suitable this may return false and the rule will be ignored when sorting a playlist.
      • isIgnoredWhileQuickMatching

        public boolean isIgnoredWhileQuickMatching()
        Description copied from class: ScoreRule
        Indicates whether this rule should be ignored in the initial matching and only be used to refine the result in a second round of matching.
        Overrides:
        isIgnoredWhileQuickMatching in class ScoreRule
        Returns:
        default implementation always returns false
      • setIgnoredForQuickMatching

        public void setIgnoredForQuickMatching​(boolean ignore)
      • store

        public void store​(nu.xom.Element element)
                   throws ConfigurationException
        Description copied from class: ScoreRule
        Empty impl. Override for adding custom attributes.
        Overrides:
        store in class ScoreRule
        Parameters:
        element - XML element that is named like the id of this score rule. It's value is equals to weight * 10f
        Throws:
        ConfigurationException
      • getId

        public String getId()
        Description copied from class: ScoreRule
        Returns a unique name for this rule.
        Specified by:
        getId in class ScoreRule
        Returns:
        unique name
      • getName

        public String getName()
        Description copied from class: ScoreRule
        Short name, like "Similar BPM"
        Specified by:
        getName in class ScoreRule
        Returns:
        short name
      • getDescription

        public String getDescription()
        Description copied from class: ScoreRule
        Description of how this rule works. May be displayed in tooltips.
        Specified by:
        getDescription in class ScoreRule
        Returns:
        description
      • score

        public float score​(AudioSong song,
                           AudioSong template,
                           Float syncBPM,
                           boolean playMatchAtSyncTempo)
        Description copied from class: ScoreRule
        Returns a score between 0 and 1 for how well the given song matches the given template. A higher score indicates a better match.
        Specified by:
        score in class ScoreRule
        Parameters:
        song - song
        template - template
        syncBPM - sync bpm
        playMatchAtSyncTempo - the given song is meant to be played at the same tempo as the template song
        Returns:
        score between 0.0 and 1.0 as a measure for how well the song matches the template.
      • getMatchFilter

        public SongPropertyFilter getMatchFilter​(AudioSong template,
                                                 Float templateSyncBPM,
                                                 boolean playMatchAtSyncTempo)
        Description copied from class: ScoreRule
        Returns a filter that matches Songs that match this rule at least somewhat. This should be used to find songs that at least somewhat match the rule.
        Specified by:
        getMatchFilter in class ScoreRule
        Parameters:
        template - template song to match
        templateSyncBPM - sync bpm for the template song
        playMatchAtSyncTempo - the given song is meant to be played at the same tempo as the template song
        Returns:
        a filter (set) that matches this rule or null, if all songs match this rule.