Mercurial > audlegacy
annotate src/audacious/plugin.h @ 3549:a5b1084e7f38 trunk
C99 initialisers
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Tue, 18 Sep 2007 11:58:09 -0500 |
parents | 95d6cbf21614 |
children | 52745af33257 |
rev | line source |
---|---|
2313 | 1 /* Audacious |
2 * Copyright (C) 2005-2007 Audacious team. | |
3 * | |
4 * BMP - Cross-platform multimedia player | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | |
9 * | |
10 * Redistribution and use in source and binary forms, with or without | |
11 * modification, are permitted provided that the following conditions are | |
12 * met: | |
13 * | |
14 * 1. Redistributions of source code must retain the above copyright | |
15 * notice, this list of conditions and the following disclaimer. | |
16 * | |
17 * 2. Redistributions in binary form must reproduce the above copyright | |
18 * notice, this list of conditions and the following disclaimer in | |
19 * the documentation and/or other materials provided with the | |
20 * distribution. | |
21 * | |
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | |
23 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
25 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | |
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
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 | |
32 * SUCH DAMAGE. | |
33 */ | |
34 | |
35 #ifndef BMP_PLUGIN_H | |
36 #define BMP_PLUGIN_H | |
37 | |
38 #include <glib.h> | |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
39 #include <gtk/gtk.h> |
2313 | 40 #include "audacious/vfs.h" |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
41 #include "audacious/tuple.h" |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
42 #include "audacious/tuple_formatter.h" |
3149
84c44d369969
Add eventqueue interface.
William Pitcock <nenolod@atheme-project.org>
parents:
3126
diff
changeset
|
43 #include "audacious/eventqueue.h" |
2313 | 44 |
2797
f0c1c8b22c88
[svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents:
2796
diff
changeset
|
45 #define PLUGIN(x) ((Plugin *)(x)) |
2313 | 46 #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) |
47 #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) | |
48 #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) | |
49 #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) | |
50 #define VIS_PLUGIN(x) ((VisPlugin *)(x)) | |
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
3181
diff
changeset
|
51 #define DISCOVERY_PLUGIN(x) ((DiscoveryPlugin *)(x)) |
2313 | 52 |
53 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x)) | |
54 | |
55 #define __AUDACIOUS_NEWVFS__ | |
3496 | 56 #define __AUDACIOUS_PLUGIN_API__ 6 |
57 #define __AUDACIOUS_INPUT_PLUGIN_API__ 6 | |
2313 | 58 |
59 typedef enum { | |
60 FMT_U8, | |
61 FMT_S8, | |
62 FMT_U16_LE, | |
63 FMT_U16_BE, | |
64 FMT_U16_NE, | |
65 FMT_S16_LE, | |
66 FMT_S16_BE, | |
67 FMT_S16_NE | |
68 } AFormat; | |
69 | |
70 typedef enum { | |
71 INPUT_VIS_ANALYZER, | |
72 INPUT_VIS_SCOPE, | |
73 INPUT_VIS_VU, | |
74 INPUT_VIS_OFF | |
75 } InputVisType; | |
76 | |
77 | |
78 typedef struct _Plugin Plugin; | |
79 typedef struct _InputPlugin InputPlugin; | |
80 typedef struct _OutputPlugin OutputPlugin; | |
81 typedef struct _EffectPlugin EffectPlugin; | |
82 typedef struct _GeneralPlugin GeneralPlugin; | |
83 typedef struct _VisPlugin VisPlugin; | |
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
3181
diff
changeset
|
84 typedef struct _DiscoveryPlugin DiscoveryPlugin; |
2313 | 85 typedef struct _LowlevelPlugin LowlevelPlugin; |
86 | |
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
87 typedef struct _InputPlayback InputPlayback; |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
88 |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
89 #define PLUGIN_COMMON_FIELDS \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
90 gpointer handle; \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
91 gchar *filename; \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
92 gchar *description; \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
93 void (*init) (void); \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
94 void (*cleanup) (void); \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
95 void (*about) (void); \ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
96 void (*configure) (void); \ |
3436
a630ecae6708
Add "gboolean enabled;" to PLUGIN_COMMON_FIELDS.
William Pitcock <nenolod@atheme.org>
parents:
3435
diff
changeset
|
97 gboolean enabled; |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
98 |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
99 |
2796
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
100 /* |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
101 * The v2 Module header. |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
102 * |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
103 * _list fields contain a null-terminated list of "plugins" to register. |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
104 * A single library can provide multiple plugins. |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
105 * --nenolod |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
106 */ |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
107 typedef struct { |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
108 gint magic; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
109 gint api_version; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
110 gchar *name; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
111 GCallback init; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
112 GCallback fini; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
113 Plugin *priv_assoc; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
114 InputPlugin **ip_list; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
115 OutputPlugin **op_list; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
116 EffectPlugin **ep_list; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
117 GeneralPlugin **gp_list; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
118 VisPlugin **vp_list; |
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
3181
diff
changeset
|
119 DiscoveryPlugin **dp_list; |
2796
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
120 } PluginHeader; |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
121 |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
122 #define PLUGIN_MAGIC 0x8EAC8DE2 |
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
123 |
3233
88f602569477
Make DECLARE_PLUGIN() macro use a __VA_ARGS__ list instead of a static amount of tokens.
William Pitcock <nenolod@atheme-project.org>
parents:
3232
diff
changeset
|
124 #define DECLARE_PLUGIN(name, init, fini, ...) \ |
2802
c799098c396f
[svn] - guard v2 module header with G_BEGIN_DECLS and G_END_DECLS
nenolod
parents:
2797
diff
changeset
|
125 G_BEGIN_DECLS \ |
2796
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
126 static PluginHeader _pluginInfo = { PLUGIN_MAGIC, __AUDACIOUS_PLUGIN_API__, \ |
3234
fb2f3675cbeb
Fix DECLARE_PLUGIN() macro.
William Pitcock <nenolod@atheme-project.org>
parents:
3233
diff
changeset
|
127 (gchar *)#name, init, fini, NULL, __VA_ARGS__ }; \ |
3061
7d858d2b4031
Use G_MODULE_EXPORT to ensure the plugin header is exported.
William Pitcock <nenolod@atheme-project.org>
parents:
3009
diff
changeset
|
128 G_MODULE_EXPORT PluginHeader *get_plugin_info(void) { \ |
2796
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
129 return &_pluginInfo; \ |
2802
c799098c396f
[svn] - guard v2 module header with G_BEGIN_DECLS and G_END_DECLS
nenolod
parents:
2797
diff
changeset
|
130 } \ |
c799098c396f
[svn] - guard v2 module header with G_BEGIN_DECLS and G_END_DECLS
nenolod
parents:
2797
diff
changeset
|
131 G_END_DECLS |
2796
e9af66a1be74
[svn] - add functions for defining the v2 plugin header
nenolod
parents:
2794
diff
changeset
|
132 |
3237
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
133 #define SIMPLE_INPUT_PLUGIN(name, ip_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
134 DECLARE_PLUGIN(name, NULL, NULL, ip_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
135 |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
136 #define SIMPLE_OUTPUT_PLUGIN(name, op_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
137 DECLARE_PLUGIN(name, NULL, NULL, NULL, op_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
138 |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
139 #define SIMPLE_EFFECT_PLUGIN(name, ep_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
140 DECLARE_PLUGIN(name, NULL, NULL, NULL, NULL, ep_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
141 |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
142 #define SIMPLE_GENERAL_PLUGIN(name, gp_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
143 DECLARE_PLUGIN(name, NULL, NULL, NULL, NULL, NULL, gp_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
144 |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
145 #define SIMPLE_VISUAL_PLUGIN(name, vp_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
146 DECLARE_PLUGIN(name, NULL, NULL, NULL, NULL, NULL, NULL, vp_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
147 |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
148 #define SIMPLE_DISCOVER_PLUGIN(name, dp_list) \ |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
149 DECLARE_PLUGIN(name, NULL, NULL, NULL, NULL, NULL, NULL, NULL, dp_list) |
12bc288a7511
add simplified macros to declare plugin. no more excessive NULLs.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3234
diff
changeset
|
150 |
2313 | 151 /* Sadly, this is the most we can generalize out of the disparate |
152 plugin structs usable with typecasts - descender */ | |
153 struct _Plugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
154 PLUGIN_COMMON_FIELDS |
2313 | 155 }; |
156 | |
157 /* | |
158 * LowlevelPlugin is used for lowlevel system services, such as PlaylistContainers, | |
159 * VFSContainers and the like. | |
160 * | |
161 * They are not GUI visible at this time. | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
162 * |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
163 * XXX: Is this still in use in 1.4? --nenolod |
2313 | 164 */ |
165 struct _LowlevelPlugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
166 PLUGIN_COMMON_FIELDS |
2313 | 167 }; |
168 | |
169 struct _OutputPlugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
170 PLUGIN_COMMON_FIELDS |
2313 | 171 |
172 void (*get_volume) (gint * l, gint * r); | |
173 void (*set_volume) (gint l, gint r); | |
174 | |
175 gint (*open_audio) (AFormat fmt, gint rate, gint nch); | |
176 void (*write_audio) (gpointer ptr, gint length); | |
177 void (*close_audio) (void); | |
178 | |
179 void (*flush) (gint time); | |
180 void (*pause) (gshort paused); | |
181 gint (*buffer_free) (void); | |
182 gint (*buffer_playing) (void); | |
183 gint (*output_time) (void); | |
184 gint (*written_time) (void); | |
185 | |
186 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch); | |
187 }; | |
188 | |
189 struct _EffectPlugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
190 PLUGIN_COMMON_FIELDS |
2313 | 191 |
192 gint (*mod_samples) (gpointer * data, gint length, AFormat fmt, gint srate, gint nch); | |
193 void (*query_format) (AFormat * fmt, gint * rate, gint * nch); | |
194 }; | |
195 | |
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
196 struct _InputPlayback { |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
197 gchar *filename; |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
198 InputPlugin *plugin; |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
199 void *data; |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
200 OutputPlugin *output; |
2438
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
201 |
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
202 int playing; |
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
203 gboolean error; |
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
204 gboolean eof; |
3181
1596dcb77acd
Track playback monitor thread in InputPlayback.thread.
William Pitcock <nenolod@atheme-project.org>
parents:
3160
diff
changeset
|
205 |
1596dcb77acd
Track playback monitor thread in InputPlayback.thread.
William Pitcock <nenolod@atheme-project.org>
parents:
3160
diff
changeset
|
206 GThread *thread; |
3319
d4f6507cded3
added a system that allows input plugins to signal to the core (actually, they MUST do it) that they're ready for playback and it's safe to call their stop function; this fixes a nasty race condition that triggered on fast track-switching
Giacomo Lozito <james@develia.org>
parents:
3298
diff
changeset
|
207 |
d4f6507cded3
added a system that allows input plugins to signal to the core (actually, they MUST do it) that they're ready for playback and it's safe to call their stop function; this fixes a nasty race condition that triggered on fast track-switching
Giacomo Lozito <james@develia.org>
parents:
3298
diff
changeset
|
208 GMutex *pb_ready_mutex; |
d4f6507cded3
added a system that allows input plugins to signal to the core (actually, they MUST do it) that they're ready for playback and it's safe to call their stop function; this fixes a nasty race condition that triggered on fast track-switching
Giacomo Lozito <james@develia.org>
parents:
3298
diff
changeset
|
209 GCond *pb_ready_cond; |
d4f6507cded3
added a system that allows input plugins to signal to the core (actually, they MUST do it) that they're ready for playback and it's safe to call their stop function; this fixes a nasty race condition that triggered on fast track-switching
Giacomo Lozito <james@develia.org>
parents:
3298
diff
changeset
|
210 gint pb_ready_val; |
d4f6507cded3
added a system that allows input plugins to signal to the core (actually, they MUST do it) that they're ready for playback and it's safe to call their stop function; this fixes a nasty race condition that triggered on fast track-switching
Giacomo Lozito <james@develia.org>
parents:
3298
diff
changeset
|
211 gint (*set_pb_ready) (InputPlayback*); |
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
212 }; |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
213 |
2313 | 214 struct _InputPlugin { |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
215 PLUGIN_COMMON_FIELDS |
2313 | 216 |
217 gint (*is_our_file) (gchar * filename); | |
218 GList *(*scan_dir) (gchar * dirname); | |
219 | |
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
220 void (*play_file) (InputPlayback * playback); |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
221 void (*stop) (InputPlayback * playback); |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
222 void (*pause) (InputPlayback * playback, gshort paused); |
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
223 void (*seek) (InputPlayback * playback, gint time); |
2313 | 224 |
225 void (*set_eq) (gint on, gfloat preamp, gfloat * bands); | |
226 | |
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
227 gint (*get_time) (InputPlayback * playback); |
2313 | 228 |
2437 | 229 gint (*get_volume) (gint * l, gint * r); |
230 gint (*set_volume) (gint l, gint r); | |
2313 | 231 |
232 InputVisType (*get_vis_type) (void); | |
233 void (*add_vis_pcm) (gint time, AFormat fmt, gint nch, gint length, gpointer ptr); | |
234 | |
235 void (*set_info) (gchar * title, gint length, gint rate, gint freq, gint nch); | |
236 void (*set_info_text) (gchar * text); | |
237 void (*get_song_info) (gchar * filename, gchar ** title, gint * length); | |
238 void (*file_info_box) (gchar * filename); | |
239 | |
2437 | 240 OutputPlugin *output; /* deprecated */ |
2313 | 241 |
242 /* Added in Audacious 1.1.0 */ | |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
243 Tuple *(*get_song_tuple) (gchar * filename); |
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
244 void (*set_song_tuple) (Tuple * tuple); |
2313 | 245 void (*set_status_buffering) (gboolean status); |
246 | |
247 /* Added in Audacious 1.3.0 */ | |
248 gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd); | |
249 gchar **vfs_extensions; | |
2620
6393862824e5
[svn] - add millisecond seek function to InputPlugin API. with this function, cuesheet and encoder plugins can achieve higher accuracy.
yaz
parents:
2473
diff
changeset
|
250 |
6393862824e5
[svn] - add millisecond seek function to InputPlugin API. with this function, cuesheet and encoder plugins can achieve higher accuracy.
yaz
parents:
2473
diff
changeset
|
251 /* Added in Audacious 1.4.0 */ |
6393862824e5
[svn] - add millisecond seek function to InputPlugin API. with this function, cuesheet and encoder plugins can achieve higher accuracy.
yaz
parents:
2473
diff
changeset
|
252 void (*mseek) (InputPlayback * playback, gulong millisecond); |
3298
f985357757e0
audacious-core: convert to tuple-ng, remove titlestring API.
William Pitcock <nenolod@atheme-project.org>
parents:
3295
diff
changeset
|
253 Tuple *(*probe_for_tuple)(gchar *uri, VFSFile *fd); |
2313 | 254 }; |
255 | |
256 struct _GeneralPlugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
257 PLUGIN_COMMON_FIELDS |
2313 | 258 }; |
259 | |
260 struct _VisPlugin { | |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
261 PLUGIN_COMMON_FIELDS |
2313 | 262 |
263 gint num_pcm_chs_wanted; | |
264 gint num_freq_chs_wanted; | |
265 | |
266 void (*disable_plugin) (struct _VisPlugin *); | |
267 void (*playback_start) (void); | |
268 void (*playback_stop) (void); | |
269 void (*render_pcm) (gint16 pcm_data[2][512]); | |
270 void (*render_freq) (gint16 freq_data[2][256]); | |
271 }; | |
272 | |
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
3181
diff
changeset
|
273 struct _DiscoveryPlugin { |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
274 PLUGIN_COMMON_FIELDS |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
275 |
3384
7ac9c5c6b44e
fixed the interface
Cristi Magherusan <majeru@atheme-project.org>
parents:
3237
diff
changeset
|
276 GList *(*get_devices); |
3227
2619f4c62abe
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
3181
diff
changeset
|
277 }; |
2313 | 278 |
3435
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
279 /* undefine the macro -- struct Plugin should be used instead. */ |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
280 #undef PLUGIN_COMMON_FIELDS |
639af8eb6824
Clean up some plugin mess -- this breaks API for plugins which don't do the ".member: value" thing yet. Oh well.
William Pitcock <nenolod@atheme.org>
parents:
3390
diff
changeset
|
281 |
2313 | 282 G_BEGIN_DECLS |
283 | |
284 /* So that input plugins can get the title formatting information */ | |
3334
ea806daf3ef0
rename xmms_get_gentitle_format() to get_gentitle_format().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3319
diff
changeset
|
285 G_CONST_RETURN gchar * get_gentitle_format(void); |
2313 | 286 |
287 /* So that output plugins can communicate with effect plugins */ | |
288 EffectPlugin *get_current_effect_plugin(void); | |
289 gboolean effects_enabled(void); | |
290 gboolean plugin_set_errortext(const gchar * text); | |
291 | |
292 G_END_DECLS | |
293 | |
3009
9976e065e2f5
Mimetype system.
William Pitcock <nenolod@atheme-project.org>
parents:
2841
diff
changeset
|
294 #include "audacious/mime.h" |
3340
a0c93cb34598
Add functions for custom uri support of input plugins
Christian Birchinger <joker@netswarm.net>
parents:
3334
diff
changeset
|
295 #include "audacious/custom_uri.h" |
3009
9976e065e2f5
Mimetype system.
William Pitcock <nenolod@atheme-project.org>
parents:
2841
diff
changeset
|
296 |
2313 | 297 #endif |