comparison src/audacious/plugin.h @ 2796:e9af66a1be74 trunk

[svn] - add functions for defining the v2 plugin header
author nenolod
date Thu, 24 May 2007 02:03:17 -0700
parents 2685fc11cd9a
children f0c1c8b22c88
comparison
equal deleted inserted replaced
2795:fa6c339cce38 2796:e9af66a1be74
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35 /* Please see the BMP Wiki for information about the plugin interface */
36
37 #ifndef BMP_PLUGIN_H 35 #ifndef BMP_PLUGIN_H
38 #define BMP_PLUGIN_H 36 #define BMP_PLUGIN_H
39
40 37
41 #include <glib.h> 38 #include <glib.h>
42 #include "audacious/vfs.h" 39 #include "audacious/vfs.h"
43 #include "audacious/titlestring.h" 40 #include "audacious/titlestring.h"
44 41
82 79
83 typedef struct _LowlevelPlugin LowlevelPlugin; 80 typedef struct _LowlevelPlugin LowlevelPlugin;
84 81
85 typedef struct _InputPlayback InputPlayback; 82 typedef struct _InputPlayback InputPlayback;
86 83
84 /*
85 * The v2 Module header.
86 *
87 * _list fields contain a null-terminated list of "plugins" to register.
88 * A single library can provide multiple plugins.
89 * --nenolod
90 */
91 typedef struct {
92 gint magic;
93 gint api_version;
94 gchar *name;
95 GCallback init;
96 GCallback fini;
97 Plugin *priv_assoc;
98 InputPlugin **ip_list;
99 OutputPlugin **op_list;
100 EffectPlugin **ep_list;
101 GeneralPlugin **gp_list;
102 VisPlugin **vp_list;
103 } PluginHeader;
104
105 #define PLUGIN_MAGIC 0x8EAC8DE2
106
107 #define DECLARE_PLUGIN(name, init, fini, ip_list, op_list, ep_list, gp_list, vp_list) \
108 static PluginHeader _pluginInfo = { PLUGIN_MAGIC, __AUDACIOUS_PLUGIN_API__, \
109 #name, init, fini, NULL, ip_list, op_list, ep_list, gp_list, \
110 vp_list }; \
111 PluginHeader *get_plugin_info(void) { \
112 return &_pluginInfo; \
113 }
114
87 /* Sadly, this is the most we can generalize out of the disparate 115 /* Sadly, this is the most we can generalize out of the disparate
88 plugin structs usable with typecasts - descender */ 116 plugin structs usable with typecasts - descender */
89 struct _Plugin { 117 struct _Plugin {
90 gpointer handle; 118 gpointer handle;
91 gchar *filename; 119 gchar *filename;