Sitemap | Impressum | Contact

Creating Filter Plugins

You can add custom filter groups by extending the class YassFilter in the package yass.filter.

public class YassFilter {
    // filter id is used when retrieving property 'group-[id]'
    public String getID();
    // filter label in the group combo box
    public String getLabel();

    // called once when creating a filter
    public static void init();
    // called in filter creation when occuring the generic keyword
    public String[] getGenericRules(Vector songs);

    // each refresh first calls start, then accept for each song, finally stop
    public void start(Vector songs);
    public boolean accept(YassSong s);
    public void stop();

    // extra line displayed in songlist; default: none (3)
    public int getExtraInfo();

    // count songs when refreshing filter; default: false
    public boolean count();
   
    // refresh counters after a drop event; default: false
    public boolean refreshCounters();

    // support drag-over or drop event; default: false
    public boolean allowDrop(String s);
    public boolean allowCoverDrop(String s);
    public void drop(String rule, YassSong s);

    // shows confirmation dialog; default: false
    public boolean confirm();
    String getConfirmString(String rule);

    // access to preferences
    public Properties getProperties();
    public void setProperties(Properties p);
}

Examples:

Add the class file to an archive called yass-plugins.jar. Put the archive in the same directory as the Yass executable.

In the preferences, add the filter's name to the Grouping plugins. Further you must set the property group-[id], where [id] is the filter ID, in the file [user_home]/.yass/user.xml. The filter should appear in the group combobox after restarting Yass.

Please understand that I won't give programming support. Contact me if you think your plugin should be included in the download section or directly in the Yass executable.