annotate libvisual/lv_plugin.h @ 25:66610fc7de2d trunk

[svn] Remove queue.png from build.list. *grumble*
author nenolod
date Tue, 25 Oct 2005 17:50:25 -0700
parents 0db4a1dc75c4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
1 /* Libvisual - The audio visualisation framework.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
2 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
3 * Copyright (C) 2004, 2005 Dennis Smit <ds@nerds-incorporated.org>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
4 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
5 * Authors: Dennis Smit <ds@nerds-incorporated.org>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
6 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
7 * $Id:
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
8 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
10 * it under the terms of the GNU Lesser General Public License as
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
11 * published by the Free Software Foundation; either version 2.1
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
12 * of the License, or (at your option) any later version.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
13 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
17 * GNU Lesser General Public License for more details.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
18 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU Lesser General Public License
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
22 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
23
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
24 #ifndef _LV_PLUGIN_H
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
25 #define _LV_PLUGIN_H
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
26
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
27 #include <libvisual/lv_video.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
28 #include <libvisual/lv_audio.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
29 #include <libvisual/lv_palette.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
30 #include <libvisual/lv_list.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
31 #include <libvisual/lv_songinfo.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
32 #include <libvisual/lv_event.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
33 #include <libvisual/lv_param.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
34 #include <libvisual/lv_ui.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
35 #include <libvisual/lv_random.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
36 #include <libvisual/lv_types.h>
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
37
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
38 #ifdef __cplusplus
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
39 extern "C" {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
40 #endif /* __cplusplus */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
41
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
42 #define VISUAL_PLUGINREF(obj) (VISUAL_CHECK_CAST ((obj), 0, VisPluginRef))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
43 #define VISUAL_PLUGININFO(obj) (VISUAL_CHECK_CAST ((obj), 0, VisPluginInfo))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
44 #define VISUAL_PLUGINDATA(obj) (VISUAL_CHECK_CAST ((obj), 0, VisPluginData))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
45 #define VISUAL_PLUGINENVIRON(obj) (VISUAL_CHECK_CAST ((obj), 0, VisPluginEnviron))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
46
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
47 #define VISUAL_PLUGIN_ACTOR(obj) (VISUAL_CHECK_CAST ((obj), VISUAL_PLUGIN_TYPE_ACTOR_ENUM, VisActorPlugin))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
48 #define VISUAL_PLUGIN_INPUT(obj) (VISUAL_CHECK_CAST ((obj), VISUAL_PLUGIN_TYPE_INPUT_ENUM, VisInputPlugin))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
49 #define VISUAL_PLUGIN_MORPH(obj) (VISUAL_CHECK_CAST ((obj), VISUAL_PLUGIN_TYPE_MORPH_ENUM, VisMorphPlugin))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
50 #define VISUAL_PLUGIN_TRANSFORM(obj) (VISUAL_CHECK_CAST ((obj), VISUAL_PLUGIN_TYPE_TRANSFORM_ENUM, VisTransformPlugin))
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
51
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
52 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
53 * Indicates at which version the plugin API is.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
54 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
55 #define VISUAL_PLUGIN_API_VERSION 2
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
56
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
57 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
58 * Type defination that should be used in plugins to set the plugin type for a NULL plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
59 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
60 #define VISUAL_PLUGIN_TYPE_NULL "Libvisual:core:null"
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
61 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
62 * Type defination that should be used in plugins to set the plugin type for an actor plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
63 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
64 #define VISUAL_PLUGIN_TYPE_ACTOR "Libvisual:core:actor"
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
65 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
66 * Type defination that should be used in plugins to set the plugin type for an input plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
67 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
68 #define VISUAL_PLUGIN_TYPE_INPUT "Libvisual:core:input"
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
69 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
70 * Type defination that should be used in plugins to set the plugin type for a morph plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
71 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
72 #define VISUAL_PLUGIN_TYPE_MORPH "Libvisual:core:morph"
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
73 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
74 * Type defination that should be used in plugins to set the plugin type for a transform plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
75 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
76 #define VISUAL_PLUGIN_TYPE_TRANSFORM "Libvisual:core:transform"
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
77
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
78 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
79 * Enumerate to define the plugin type. Especially used
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
80 * within the VisPlugin system and for type checking within the core library itself.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
81 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
82 * For plugin type defination use the VISUAL_PLUGIN_TYPE_NULL, VISUAL_PLUGIN_TYPE_ACTOR
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
83 * VISUAL_PLUGIN_TYPE_INPUT or VISUAL_PLUGIN_TYPE_MORPH defines that contain the domain string.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
84 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
85 * There are three different plugins being:
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
86 * -# Actor plugins: These are the actual
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
87 * visualisation plugins.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
88 * -# Input plugins: These can be used to obtain
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
89 * PCM data through, for example different sound servers.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
90 * -# Morph plugins: These are capable of morphing
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
91 * between different plugins.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
92 * -# Transform plugins: These are capable of transforming a video or palette
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
93 * into something new.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
94 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
95 typedef enum {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
96 VISUAL_PLUGIN_TYPE_NULL_ENUM, /**< Used when there is no plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
97 VISUAL_PLUGIN_TYPE_ACTOR_ENUM, /**< Used when the plugin is an actor plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
98 VISUAL_PLUGIN_TYPE_INPUT_ENUM, /**< Used when the plugin is an input plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
99 VISUAL_PLUGIN_TYPE_MORPH_ENUM, /**< Used when the plugin is a morph plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
100 VISUAL_PLUGIN_TYPE_TRANSFORM_ENUM /**< Used when the plugin is a transform plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
101 } VisPluginType;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
102
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
103 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
104 * Enumerate to define the plugin flags. Plugin flags can be used to
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
105 * define some of the plugin it's behavior.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
106 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
107 typedef enum {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
108 VISUAL_PLUGIN_FLAG_NONE = 0, /**< Used to set no flags. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
109 VISUAL_PLUGIN_FLAG_NOT_REENTRANT = 1, /**< Used to tell the plugin loader that this plugin
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
110 * is not reentrant, and can be loaded only once. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
111 VISUAL_PLUGIN_FLAG_SPECIAL = 2 /**< Used to tell the plugin loader that this plugin has
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
112 * special purpose, like the GdkPixbuf plugin, or a webcam
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
113 * plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
114 } VisPluginFlags;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
115
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
116 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
117 * Enumerate to check the depth of the type wildcard/defination used, used together with the visual_plugin_type functions.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
118 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
119 typedef enum {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
120 VISUAL_PLUGIN_TYPE_DEPTH_NONE = 0, /**< No type found.*/
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
121 VISUAL_PLUGIN_TYPE_DEPTH_DOMAIN = 1, /**< Only domain in type. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
122 VISUAL_PLUGIN_TYPE_DEPTH_PACKAGE = 2, /**< Domain and package in type. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
123 VISUAL_PLUGIN_TYPE_DEPTH_TYPE = 3, /**< Domain, package and type found in type. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
124 } VisPluginTypeDepth;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
125
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
126 typedef struct _VisPluginRef VisPluginRef;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
127 typedef struct _VisPluginInfo VisPluginInfo;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
128 typedef struct _VisPluginData VisPluginData;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
129 typedef struct _VisPluginEnviron VisPluginEnviron;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
130
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
131 typedef struct _VisActorPlugin VisActorPlugin;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
132 typedef struct _VisInputPlugin VisInputPlugin;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
133 typedef struct _VisMorphPlugin VisMorphPlugin;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
134 typedef struct _VisTransformPlugin VisTransformPlugin;
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
135
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
136 /* Actor plugin methods */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
137
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
138 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
139 * An actor plugin needs this signature for the requisition function. The requisition function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
140 * is used to determine the size required by the plugin for a given width/height value.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
141 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
142 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
143 * @arg width Pointer to an int containing the width requested, will be altered to the nearest
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
144 * supported width.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
145 * @arg height Pointer to an int containing the height requested, will be altered to the nearest
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
146 * supported height.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
147 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
148 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
149 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
150 typedef int (*VisPluginActorRequisitionFunc)(VisPluginData *plugin, int *width, int *height);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
151
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
152 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
153 * An actor plugin needs this signature for the palette function. The palette function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
154 * is used to retrieve the desired palette from the plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
155 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
156 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
157 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
158 * @return Pointer to the VisPalette used by the plugin, this should be a VisPalette with 256
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
159 * VisColor entries, NULL is also allowed to be returned.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
160 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
161 typedef VisPalette *(*VisPluginActorPaletteFunc)(VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
162
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
163 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
164 * An actor plugin needs this signature for the render function. The render function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
165 * is used to render the frame for the visualisation.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
166 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
167 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
168 * @arg video Pointer to the VisVideo containing all information about the display surface.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
169 * Params like height and width won't suddenly change, this is always notified as an event
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
170 * so the plugin can adjust to the new dimension.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
171 * @arg audio Pointer to the VisAudio containing all the data regarding the current audio sample.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
172 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
173 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
174 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
175 typedef int (*VisPluginActorRenderFunc)(VisPluginData *plugin, VisVideo *video, VisAudio *audio);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
176
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
177 /* Input plugin methods */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
178
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
179 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
180 * An input plugin needs this signature for the sample upload function. The sample upload function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
181 * is used to retrieve sample information when a input is being used to retrieve the
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
182 * audio sample.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
183 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
184 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
185 * @arg audio Pointer to the VisAudio in which the new sample data is set.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
186 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
187 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
188 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
189 typedef int (*VisPluginInputUploadFunc)(VisPluginData *plugin, VisAudio *audio);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
190
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
191 /* Morph plugin methods */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
192
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
193 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
194 * A morph plugin needs this signature for the palette function. The palette function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
195 * is used to give a palette for the morph. The palette function isn't mandatory and the
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
196 * VisMorph system will interpolate between the two palettes in VISUAL_VIDEO_DEPTH_8BIT when
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
197 * a palette function isn't set.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
198 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
199 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
200 * @arg rate A float between 0.0 and 1.0 that tells how far the morph has proceeded.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
201 * @arg audio Pointer to the VisAudio containing all the data regarding the current audio sample.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
202 * @arg pal A pointer to the target VisPalette in which the morph between the two palettes is saved. Should have
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
203 * 256 VisColor entries.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
204 * @arg src1 A pointer to the first VisVideo source.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
205 * @arg src2 A pointer to the second VisVideo source.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
206 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
207 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
208 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
209 typedef int (*VisPluginMorphPaletteFunc)(VisPluginData *plugin, float rate, VisAudio *audio, VisPalette *pal,
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
210 VisVideo *src1, VisVideo *src2);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
211
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
212 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
213 * A morph plugin needs this signature for the apply function. The apply function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
214 * is used to execute a morph between two VisVideo sources. It's the 'render' function of
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
215 * the morph plugin and here is the morphing done.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
216 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
217 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
218 * @arg rate A float between 0.0 and 1.0 that tells how far the morph has proceeded.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
219 * @arg audio Pointer to the VisAudio containing all the data regarding the current audio sample.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
220 * @arg src1 A pointer to the first VisVideo source.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
221 * @arg src2 A pointer to the second VisVideo source.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
222 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
223 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
224 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
225 typedef int (*VisPluginMorphApplyFunc)(VisPluginData *plugin, float rate, VisAudio *audio, VisVideo *dest,
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
226 VisVideo *src1, VisVideo *src2);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
227
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
228 /* Transform plugin methodes */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
229
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
230 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
231 * A transform plugin needs this signature to transform VisPalettes.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
232 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
233 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
234 * @arg pal Pointer to the VisPalette that is to be morphed.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
235 * Only 256 entry VisPalettes have to be supported.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
236 * @arg audio Optionally a pointer to the VisAudio, when requested.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
237 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
238 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
239 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
240 typedef int (*VisPluginTransformPaletteFunc)(VisPluginData *plugin, VisPalette *pal, VisAudio *audio);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
241
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
242 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
243 * A transform plugin needs this signature to transform VisVideos.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
244 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
245 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
246 * @arg video Pointer to the VisVideo that needs to be transformed.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
247 * @arg audio Optionally a pointer to the VisAudio, when requested.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
248 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
249 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
250 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
251 typedef int (*VisPluginTransformVideoFunc)(VisPluginData *plugin, VisVideo *video, VisAudio *audio);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
252
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
253 /* Plugin standard get_plugin_info method */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
254 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
255 * This is the signature for the 'get_plugin_info' function every libvisual plugin needs to have. The
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
256 * 'get_plugin_info' function provides libvisual plugin data and all the detailed information regarding
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
257 * the plugin. This function is compulsory without it libvisual won't load the plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
258 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
259 * @arg count An int pointer in which the number of VisPluginData entries within the plugin. Plugins can have
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
260 * multiple 'features' and thus the count is needed.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
261 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
262 * @return Pointer to the VisPluginInfo array which contains information about the plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
263 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
264 typedef const VisPluginInfo *(*VisPluginGetInfoFunc)(int *count);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
265
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
266 /* Standard plugin methods */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
267
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
268 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
269 * Every libvisual plugin that is loaded by the libvisual plugin loader needs this signature for it's
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
270 * intialize function.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
271 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
272 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
273 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
274 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
275 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
276 typedef int (*VisPluginInitFunc)(VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
277
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
278 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
279 * Every libvisual plugin that is loaded by the libvisual plugin loader needs this signature for it's
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
280 * cleanup function.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
281 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
282 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
283 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
284 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
285 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
286 typedef int (*VisPluginCleanupFunc)(VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
287
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
288 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
289 * This is the signature for the event handler within libvisual plugins. An event handler is not mandatory because
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
290 * it has no use in some plugin classes but some plugin types require it nonetheless.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
291 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
292 * @arg plugin Pointer to the VisPluginData instance structure.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
293 * @arg events Pointer to the VisEventQueue that might contain events that need to be handled.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
294 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
295 * @return 0 on succes -1 on error.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
296 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
297 typedef int (*VisPluginEventsFunc)(VisPluginData *plugin, VisEventQueue *events);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
298
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
299 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
300 * The VisPluginRef data structure contains information about the plugins
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
301 * and does refcounting. It is also used as entries in the plugin registry.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
302 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
303 struct _VisPluginRef {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
304 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
305
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
306 char *file; /**< The file location of the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
307 int index; /**< Contains the index number for the entry in the VisPluginInfo table. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
308 int usecount; /**< The use count, this indicates how many instances are loaded. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
309 VisPluginInfo *info; /**< A copy of the VisPluginInfo structure. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
310 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
311
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
312 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
313 * The VisPluginInfo data structure contains information about a plugin
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
314 * and is filled within the plugin itself.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
315 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
316 struct _VisPluginInfo {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
317 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
318
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
319 uint32_t struct_size; /**< Struct size, should always be set for compatability checks. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
320 uint32_t api_version; /**< API version, compile plugins always with .api_version = VISUAL_PLUGIN_API_VERSION. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
321 char *type; /**< Plugin type, in the format of "domain:package:type", as example,
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
322 * this could be "Libvisual:core:actor". It's adviced to use the defination macros here
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
323 * instead of filling in the string yourself. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
324 char *plugname; /**< The plugin name as it's saved in the registry. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
325
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
326 char *name; /**< Long name */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
327 char *author; /**< Author */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
328 char *version; /**< Version */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
329 char *about; /**< About */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
330 char *help; /**< Help */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
331
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
332 VisPluginInitFunc init; /**< The standard init function, every plugin has to implement this. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
333 VisPluginCleanupFunc cleanup; /**< The standard cleanup function, every plugin has to implement this. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
334 VisPluginEventsFunc events; /**< The standard event function, implementation is optional. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
335
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
336 int flags; /**< Plugin flags from the VisPluginFlags enumerate. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
337
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
338 VisObject *plugin; /**< Pointer to the plugin specific data structures. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
339 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
340
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
341 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
342 * The VisPluginData structure is the main plugin structure, every plugin
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
343 * is encapsulated in this.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
344 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
345 struct _VisPluginData {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
346 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
347
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
348 VisPluginRef *ref; /**< Pointer to the plugin references corresponding to this VisPluginData. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
349
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
350 VisPluginInfo *info; /**< Pointer to the VisPluginInfo that is obtained from the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
351
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
352 VisEventQueue eventqueue; /**< The plugin it's VisEventQueue for queueing events. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
353 VisParamContainer *params; /**< The plugin it's VisParamContainer in which VisParamEntries can be placed. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
354 VisUIWidget *userinterface; /**< The plugin it's top level VisUIWidget, this acts as the container for the
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
355 * rest of the user interface. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
356
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
357 int plugflags; /**< Plugin flags, currently unused but will be used in the future. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
358
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
359 VisRandomContext random; /**< Pointer to the plugin it's private random context. It's highly adviced to use
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
360 * the plugin it's randomize functions. The reason is so more advanced apps can
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
361 * semi reproduce visuals. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
362
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
363 int realized; /**< Flag that indicates if the plugin is realized. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
364 void *handle; /**< The dlopen handle */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
365 VisList environ; /**< Misc environment specific data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
366 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
367
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
368 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
369 * The VisPluginEnviron is used to setup a pre realize/init environment for plugins.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
370 * Some types of plugins might need this internally and thus this system provides this function.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
371 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
372 struct _VisPluginEnviron {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
373 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
374 const char *type; /**< Almost the same as _VisPluginInfo.type. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
375 VisObject *environ; /**< VisObject that contains environ specific data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
376 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
377
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
378 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
379 * The VisActorPlugin structure is the main data structure
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
380 * for the actor (visualisation) plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
381 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
382 * The actor plugin is the visualisation plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
383 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
384 struct _VisActorPlugin {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
385 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
386 VisPluginActorRequisitionFunc requisition; /**< The requisition function. This is used to
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
387 * get the desired VisVideo surface size of the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
388 VisPluginActorPaletteFunc palette; /**< Used to retrieve the desired palette from the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
389 VisPluginActorRenderFunc render; /**< The main render loop. This is called to draw a frame. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
390
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
391 VisSongInfo songinfo; /**< Pointer to VisSongInfo that contains information about
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
392 *the current playing song. This can be NULL. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
393
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
394 int depth; /**< The depth flag for the VisActorPlugin. This contains an ORred
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
395 * value of depths that are supported by the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
396 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
397
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
398 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
399 * The VisInputPlugin structure is the main data structure
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
400 * for the input plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
401 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
402 * The input plugin is used to retrieve PCM samples from
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
403 * certain sources.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
404 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
405 struct _VisInputPlugin {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
406 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
407 VisPluginInputUploadFunc upload; /**< The sample upload function. This is the main function
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
408 * of the plugin which uploads sample data into
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
409 * libvisual. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
410 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
411
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
412 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
413 * The VisMorphPlugin structure is the main data structure
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
414 * for the morph plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
415 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
416 * The morph plugin is capable of morphing between two VisVideo
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
417 * sources, and thus is capable of morphing between two
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
418 * VisActors.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
419 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
420 struct _VisMorphPlugin {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
421 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
422 VisPluginMorphPaletteFunc palette; /**< The plugin's palette function. This can be used
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
423 * to obtain a palette for VISUAL_VIDEO_DEPTH_8BIT surfaces.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
424 * However the function may be set to NULL. In this case the
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
425 * VisMorph system morphs between palettes itself. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
426 VisPluginMorphApplyFunc apply; /**< The plugin it's main function. This is used to morph
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
427 * between two VisVideo sources. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
428 int depth; /**< The depth flag for the VisMorphPlugin. This contains an ORred
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
429 * value of depths that are supported by the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
430 int requests_audio;/**< When set on TRUE this will indicate that the Morph plugin
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
431 * requires an VisAudio context in order to render properly. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
432 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
433
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
434 /**
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
435 * The VisTransformPlugin structure is the main data structure
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
436 * for the transform plugin.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
437 *
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
438 * The transform plugin is used to transform videos and palettes
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
439 * and can be used in visualisation pipelines.
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
440 */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
441 struct _VisTransformPlugin {
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
442 VisObject object; /**< The VisObject data. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
443 VisPluginTransformPaletteFunc palette; /**< Used to transform a VisPalette. Writes directly into the source. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
444 VisPluginTransformVideoFunc video; /**< Used to transform a VisVideo. Writes directly into the source. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
445
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
446 int depth; /**< The depth flag for the VisActorPlugin. This contains an ORred
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
447 * value of depths that are supported by the plugin. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
448 int requests_audio;/**< When set on TRUE this will indicate that the Morph plugin
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
449 * requires an VisAudio context in order to render properly. */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
450 };
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
451
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
452
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
453 /* prototypes */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
454 VisPluginInfo *visual_plugin_info_new (void);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
455 int visual_plugin_info_copy (VisPluginInfo *dest, VisPluginInfo *src);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
456
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
457 int visual_plugin_events_pump (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
458 VisEventQueue *visual_plugin_get_eventqueue (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
459 int visual_plugin_set_userinterface (VisPluginData *plugin, VisUIWidget *widget);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
460 VisUIWidget *visual_plugin_get_userinterface (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
461
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
462 VisPluginInfo *visual_plugin_get_info (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
463
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
464 VisParamContainer *visual_plugin_get_params (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
465
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
466 VisRandomContext *visual_plugin_get_random_context (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
467
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
468 void *visual_plugin_get_specific (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
469
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
470 VisPluginRef *visual_plugin_ref_new (void);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
471
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
472 VisPluginData *visual_plugin_new (void);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
473
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
474 VisList *visual_plugin_get_registry (void);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
475 VisList *visual_plugin_registry_filter (VisList *pluglist, const char *domain);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
476
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
477 const char *visual_plugin_get_next_by_name (VisList *list, const char *name);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
478 const char *visual_plugin_get_prev_by_name (VisList *list, const char *name);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
479
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
480 int visual_plugin_unload (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
481 VisPluginData *visual_plugin_load (VisPluginRef *ref);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
482 int visual_plugin_realize (VisPluginData *plugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
483
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
484 VisPluginRef **visual_plugin_get_references (const char *pluginpath, int *count);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
485 VisList *visual_plugin_get_list (const char **paths);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
486
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
487 VisPluginRef *visual_plugin_find (VisList *list, const char *name);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
488
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
489 int visual_plugin_get_api_version (void);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
490
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
491 VisSongInfo *visual_plugin_actor_get_songinfo (VisActorPlugin *actplugin);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
492
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
493 const char *visual_plugin_type_get_domain (const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
494 const char *visual_plugin_type_get_package (const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
495 const char *visual_plugin_type_get_type (const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
496 VisPluginTypeDepth visual_plugin_type_get_depth (const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
497 int visual_plugin_type_member_of (const char *domain, const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
498
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
499 VisPluginEnviron *visual_plugin_environ_new (const char *type, VisObject *environ);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
500 int visual_plugin_environ_add (VisPluginData *plugin, VisPluginEnviron *penve);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
501 int visual_plugin_environ_remove (VisPluginData *plugin, const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
502 VisObject *visual_plugin_environ_get (VisPluginData *plugin, const char *type);
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
503
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
504
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
505 #ifdef __cplusplus
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
506 }
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
507 #endif /* __cplusplus */
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
508
0db4a1dc75c4 [svn] libvisual.
nenolod
parents:
diff changeset
509 #endif /* _LV_PLUGIN_H */