
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 "singit_displayer_plugin.h"

DisplayerPlugin my_dp =
{
	NULL,
	NULL,
	0,

	"My new displayer",

	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,

	NULL,

	NULL,
	NULL,
	NULL,
	NULL,

	NULL,
	NULL
};

DIPSPLAYER_SYMBOL(libdisplayer_my, my_dp)

The first argument 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.

The general way to get informed of song channges is via the set_time callback:

	void (*set_time)(guint, SingitSong*, GList *);

An example implementation, which recognizes song changes, is this code snipnet:

void my_dis_set_time(guint time, SingitSong *cur_song, GList *real_next)
{
	SingitSong* my_song = NULL, *tmp_song;

	my_song = singit_song_attach(cur_song);

	if (my_song != my_dis_status.song)
	{
		// We have a new song
		tmp_song = my_dis_status.song;
		my_dis_status.song = singit_song_attach(my_song);
		singit_song_detach(&tmp_song);
	}

	// Do some other interesting stuff ...
}
