# HG changeset patch # User nenolod # Date 1155267310 25200 # Node ID c4640c88942d8430cc7bf5657ba5b005dbb67716 # Parent 71c91ebdb55c42d020074dbaaf6f89d31460cd20 [svn] - lowlevel plugin stuff diff -r 71c91ebdb55c -r c4640c88942d ChangeLog --- a/ChangeLog Thu Aug 10 20:20:39 2006 -0700 +++ b/ChangeLog Thu Aug 10 20:35:10 2006 -0700 @@ -1,3 +1,12 @@ +2006-08-11 03:20:39 +0000 William Pitcock + revision [2038] + - further progress + + + Changes: Modified: + +8 -0 trunk/configure.ac + + 2006-08-11 03:13:57 +0000 William Pitcock revision [2036] - bootstrap for ContainerPlugin dir stuff diff -r 71c91ebdb55c -r c4640c88942d audacious/plugin.h --- a/audacious/plugin.h Thu Aug 10 20:20:39 2006 -0700 +++ b/audacious/plugin.h Thu Aug 10 20:35:10 2006 -0700 @@ -40,6 +40,8 @@ #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) #define VIS_PLUGIN(x) ((VisPlugin *)(x)) +#define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x)) + typedef enum { FMT_U8, @@ -67,6 +69,8 @@ typedef struct _GeneralPlugin GeneralPlugin; typedef struct _VisPlugin VisPlugin; +typedef struct _LowlevelPlugin LowlevelPlugin; + /* Sadly, this is the most we can generalize out of the disparate plugin structs usable with typecasts - descender */ struct _Plugin { @@ -74,6 +78,22 @@ gchar *filename; }; +/* + * LowlevelPlugin is used for lowlevel system services, such as PlaylistContainers, + * VFSContainers and the like. + * + * They are not GUI visible at this time. + */ +struct _LowlevelPlugin { + gpointer handle; + gchar *filename; + + gchar *description; + + void (*init) (void); + void (*cleanup) (void); +}; + struct _OutputPlugin { gpointer handle; gchar *filename; diff -r 71c91ebdb55c -r c4640c88942d audacious/pluginenum.c --- a/audacious/pluginenum.c Thu Aug 10 20:20:39 2006 -0700 +++ b/audacious/pluginenum.c Thu Aug 10 20:35:10 2006 -0700 @@ -49,6 +49,7 @@ }; GHashTable *plugin_matrix = NULL; +GList *lowlevel_list = NULL; static gint inputlist_compare_func(gconstpointer a, gconstpointer b) @@ -113,6 +114,10 @@ if (!strcmp(basename, g_basename(VIS_PLUGIN(l->data)->filename))) return TRUE; + for (l = lowlevel_list; l; l = g_list_next(l)) + if (!strcmp(basename, g_basename(VIS_PLUGIN(l->data)->filename))) + return TRUE; + return FALSE; } @@ -172,6 +177,12 @@ vp_data.vis_list = g_list_append(vp_data.vis_list, p); } +static void +lowlevel_plugin_init(Plugin * plugin) +{ + LowlevelPlugin *p = LOWLEVEL_PLUGIN(plugin); + lowlevel_list = g_list_append(lowlevel_list, p); +} /* FIXME: Placed here (hopefully) temporarily - descender */ @@ -187,6 +198,7 @@ { "effect" , "get_eplugin_info", effect_plugin_init }, { "general" , "get_gplugin_info", general_plugin_init }, { "visualization", "get_vplugin_info", vis_plugin_init }, + { "lowlevel" , "get_lplugin_info", lowlevel_plugin_init }, { NULL, NULL, NULL } }; @@ -354,6 +366,7 @@ EffectPlugin *ep; GeneralPlugin *gp; VisPlugin *vp; + LowlevelPlugin *lp; GList *node; g_message("Shutting down plugin system"); @@ -457,4 +470,18 @@ if (vp_data.vis_list) g_list_free(vp_data.vis_list); + + for (node = lowlevel_list; node; node = g_list_next(node)) { + lp = LOWLEVEL_PLUGIN(node->data); + if (lp && lp->cleanup) { + lp->cleanup(); + GDK_THREADS_LEAVE(); + while (g_main_iteration(FALSE)); + GDK_THREADS_ENTER(); + } + g_module_close(lp->handle); + } + + if (lowlevel_list) + g_list_free(lowlevel_list); }