1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
For the plugin development you need at least libtool v1.5 installed.
Every plugin must declare a DiplayerPlugin struct and a funtion
get_dplugin_info(). This can be simplified by including the macro
DIPSPLAYER_SYMBOL. Theroretically you even not need to fill the plugin name.
For an explanation of all the callbacks see the "singit_displayer_plugin.h" header.
The following is a a very basic example:
#include <xmms/singit/singit_displayer_plugin.h>
DisplayerPlugin test_msg_dp =
{
NULL,
NULL,
0,
NULL,
"My new displayer",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
DIPSPLAYER_SYMBOL(libdisplayer_my, my_dp)
The first argument of DIPSPLAYER_SYMBOL is the library name,
the second the declared structure.
It's adviceable to use libtool to build the shared library. The flags should
contain:
-module -avoid-version -export-symbols-regex "lib.*_LTX_get_dplugin_info"
This will garantee, that the library is loadable as a module and just exports
the "get_dplugin_info" symbol to keeps the symbol namespace clear.
All of the included plugins of SingIt implement also a status structure. The
status structure holds several information while the displayer is running, most
important a reference to the current song.
A good start is a look at the test_msg displayer.
|