Hi,

When I had a look at the plugin system and it type definition system I
had the idea to change xmms_plugin_type_t from a linear enumeration to
flags. The changed xmms_plugin_type_t would look like that:

typedef enum {
    XMMS_PLUGIN_TYPE_OUTPUT = 1<<0,
    XMMS_PLUGIN_TYPE_XFORM  = 1<<1,
    XMMS_PLUGIN_TYPE_ALL = 0x7FFFFFFF  // <-- Value set assuming xmms2
uses a uint32 or int32 value to store the plugin type
} xmms_plugin_type_t

This would allow to add subtypes like:
XMMS_PLUGIN_TYPE_XFORM
typedef enum {
    XMMS_PLUGIN_TYPE_OUTPUT = 1<<0,
    XMMS_PLUGIN_TYPE_XFORM  = 1<<1,
    // values 1<<2 and 1<<3 left out because there might be some other
kind of basic plugin later
    XMMS_PLUGIN_TYPE_XFORM_DECODER  = 1<<4, // mp3, vorbis,...
    XMMS_PLUGIN_TYPE_XFORM_EFFECT   = 1<<5, // equalizer, normalize,...
    XMMS_PLUGIN_TYPE_XFORM_TRANSPORT = 1<<6 //file, gvfs,...
    XMMS_PLUGIN_TYPE_XFORM_PLAYLIST = 1<<7, // pls, m3u,....
    XMMS_PLUGIN_TYPE_ALL = 0x7FFFFFFF  // <-- Value set assuming xmms2
uses a uint32 or int32 value to store the plugin type
}

The mp3 plugin would then have the type (XMMS_PLUGIN_TYPE_XFORM |
XMMS_PLUGIN_TYPE_XFORM_DECODER)

This would make it possible for clients to request, for example, all
decoder plugins.

If two values are or-ed together, the xmms2d would return the plugins
that match any of the set bits. So requesting all output and decoder
plugins would be done by
xmmsc_plugin_list (conn, XMMS_PLUGIN_TYPE_OUTPUT |
XMMS_PLUGIN_TYPE_XFORM_DECODER)

I'd like to hear your opinions and if there are no objections I'd like
to implement it and make the necessary changes to xmms2d code

--
_______________________________________________
Xmms2-devel mailing list
Xmms2-devel@lists.xmms.se
http://lists.xmms.se/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to