Mercurial > audlegacy
annotate audacious/plugin.h @ 2225:a14a871be06b trunk
[svn] More eq stuff, from external contributor Michael Faerber <01mf02 -at- gmail.com>.
author | kiyoshi |
---|---|
date | Sat, 30 Dec 2006 13:15:44 -0800 |
parents | e0e50e151bab |
children |
rev | line source |
---|---|
2107
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
1 /* Audacious |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
2 * Copyright (C) 2005-2007 Audacious team. |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
3 * |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
4 * BMP - Cross-platform multimedia player |
0 | 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 | |
2107
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
12 * met: |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
13 * |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
14 * 1. Redistributions of source code must retain the above copyright |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
15 * notice, this list of conditions and the following disclaimer. |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
16 * |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
17 * 2. Redistributions in binary form must reproduce the above copyright |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
18 * notice, this list of conditions and the following disclaimer in |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
19 * the documentation and/or other materials provided with the |
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
20 * distribution. |
0 | 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 /* Please see the BMP Wiki for information about the plugin interface */ | |
36 | |
37 #ifndef BMP_PLUGIN_H | |
38 #define BMP_PLUGIN_H | |
39 | |
40 | |
41 #include <glib.h> | |
2146
e0e50e151bab
[svn] - move vfs from libaudacious to main audacious
nenolod
parents:
2111
diff
changeset
|
42 #include "audacious/vfs.h" |
1248
6d9c45d157f9
[svn] - this is a hack until I find a better solution
nenolod
parents:
1231
diff
changeset
|
43 #include "audacious/titlestring.h" |
0 | 44 |
45 #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) | |
46 #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) | |
47 #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) | |
48 #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) | |
49 #define VIS_PLUGIN(x) ((VisPlugin *)(x)) | |
50 | |
1563 | 51 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x)) |
52 | |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
53 #define __AUDACIOUS_NEWVFS__ |
0 | 54 |
55 typedef enum { | |
56 FMT_U8, | |
57 FMT_S8, | |
58 FMT_U16_LE, | |
59 FMT_U16_BE, | |
60 FMT_U16_NE, | |
61 FMT_S16_LE, | |
62 FMT_S16_BE, | |
63 FMT_S16_NE | |
64 } AFormat; | |
65 | |
66 typedef enum { | |
67 INPUT_VIS_ANALYZER, | |
68 INPUT_VIS_SCOPE, | |
69 INPUT_VIS_VU, | |
70 INPUT_VIS_OFF | |
71 } InputVisType; | |
72 | |
73 | |
74 typedef struct _Plugin Plugin; | |
75 typedef struct _InputPlugin InputPlugin; | |
76 typedef struct _OutputPlugin OutputPlugin; | |
77 typedef struct _EffectPlugin EffectPlugin; | |
78 typedef struct _GeneralPlugin GeneralPlugin; | |
79 typedef struct _VisPlugin VisPlugin; | |
80 | |
1563 | 81 typedef struct _LowlevelPlugin LowlevelPlugin; |
82 | |
0 | 83 /* Sadly, this is the most we can generalize out of the disparate |
84 plugin structs usable with typecasts - descender */ | |
85 struct _Plugin { | |
86 gpointer handle; | |
87 gchar *filename; | |
88 }; | |
89 | |
1563 | 90 /* |
91 * LowlevelPlugin is used for lowlevel system services, such as PlaylistContainers, | |
92 * VFSContainers and the like. | |
93 * | |
94 * They are not GUI visible at this time. | |
95 */ | |
96 struct _LowlevelPlugin { | |
97 gpointer handle; | |
98 gchar *filename; | |
99 | |
100 gchar *description; | |
101 | |
102 void (*init) (void); | |
103 void (*cleanup) (void); | |
104 }; | |
105 | |
0 | 106 struct _OutputPlugin { |
107 gpointer handle; | |
108 gchar *filename; | |
109 | |
110 gchar *description; | |
111 | |
112 void (*init) (void); | |
309 | 113 void (*cleanup) (void); |
0 | 114 void (*about) (void); |
115 void (*configure) (void); | |
116 void (*get_volume) (gint * l, gint * r); | |
117 void (*set_volume) (gint l, gint r); | |
118 | |
119 gint (*open_audio) (AFormat fmt, gint rate, gint nch); | |
120 void (*write_audio) (gpointer ptr, gint length); | |
121 void (*close_audio) (void); | |
122 | |
123 void (*flush) (gint time); | |
124 void (*pause) (gshort paused); | |
125 gint (*buffer_free) (void); | |
126 gint (*buffer_playing) (void); | |
127 gint (*output_time) (void); | |
128 gint (*written_time) (void); | |
515
802a8ed87f67
[svn] Add support for tell_audio(), an output plugin accessor which will give us the information the input plugin passed to
nenolod
parents:
309
diff
changeset
|
129 |
516 | 130 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch); |
0 | 131 }; |
132 | |
133 struct _EffectPlugin { | |
134 gpointer handle; | |
135 gchar *filename; | |
136 | |
137 gchar *description; | |
138 | |
139 void (*init) (void); | |
140 void (*cleanup) (void); | |
141 void (*about) (void); | |
142 void (*configure) (void); | |
143 | |
144 gint (*mod_samples) (gpointer * data, gint length, AFormat fmt, gint srate, gint nch); | |
145 void (*query_format) (AFormat * fmt, gint * rate, gint * nch); | |
146 }; | |
147 | |
148 struct _InputPlugin { | |
149 gpointer handle; | |
150 gchar *filename; | |
151 | |
152 gchar *description; | |
153 | |
154 void (*init) (void); | |
155 void (*about) (void); | |
156 void (*configure) (void); | |
157 | |
158 gint (*is_our_file) (gchar * filename); | |
159 GList *(*scan_dir) (gchar * dirname); | |
160 | |
161 void (*play_file) (gchar * filename); | |
162 void (*stop) (void); | |
163 void (*pause) (gshort paused); | |
164 void (*seek) (gint time); | |
165 | |
166 void (*set_eq) (gint on, gfloat preamp, gfloat * bands); | |
167 | |
168 gint (*get_time) (void); | |
169 | |
170 void (*get_volume) (gint * l, gint * r); | |
171 void (*set_volume) (gint l, gint r); | |
172 | |
173 void (*cleanup) (void); | |
174 | |
175 InputVisType (*get_vis_type) (void); | |
176 void (*add_vis_pcm) (gint time, AFormat fmt, gint nch, gint length, gpointer ptr); | |
177 | |
178 void (*set_info) (gchar * title, gint length, gint rate, gint freq, gint nch); | |
179 void (*set_info_text) (gchar * text); | |
180 void (*get_song_info) (gchar * filename, gchar ** title, gint * length); | |
181 void (*file_info_box) (gchar * filename); | |
182 | |
183 OutputPlugin *output; | |
1231 | 184 |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
185 /* Added in Audacious 1.1.0 */ |
1231 | 186 TitleInput *(*get_song_tuple) (gchar * filename); |
187 void (*set_song_tuple) (TitleInput * tuple); | |
1273
3b990c26fc46
[svn] - Support for the buffer indicator in playpaus.png that was apparently
nhjm449
parents:
1248
diff
changeset
|
188 void (*set_status_buffering) (gboolean status); |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
189 |
2107
8d2b17ee266e
[svn] - add gchar **vfs_extensions to InputPlugin struct, adding support for
nenolod
parents:
1951
diff
changeset
|
190 /* Added in Audacious 1.3.0 */ |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
191 gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd); |
2111 | 192 gchar **vfs_extensions; |
0 | 193 }; |
194 | |
195 struct _GeneralPlugin { | |
196 gpointer handle; | |
197 gchar *filename; | |
198 | |
199 gint xmms_session; | |
200 gchar *description; | |
201 | |
202 void (*init) (void); | |
203 void (*about) (void); | |
204 void (*configure) (void); | |
205 void (*cleanup) (void); | |
206 }; | |
207 | |
208 struct _VisPlugin { | |
209 gpointer handle; | |
210 gchar *filename; | |
211 | |
212 gint xmms_session; | |
213 gchar *description; | |
214 | |
215 gint num_pcm_chs_wanted; | |
216 gint num_freq_chs_wanted; | |
217 | |
218 void (*init) (void); | |
219 void (*cleanup) (void); | |
220 void (*about) (void); | |
221 void (*configure) (void); | |
222 void (*disable_plugin) (struct _VisPlugin *); | |
223 void (*playback_start) (void); | |
224 void (*playback_stop) (void); | |
225 void (*render_pcm) (gint16 pcm_data[2][512]); | |
226 void (*render_freq) (gint16 freq_data[2][256]); | |
227 }; | |
228 | |
229 | |
230 G_BEGIN_DECLS | |
231 | |
232 /* So that input plugins can get the title formatting information */ | |
233 G_CONST_RETURN gchar * xmms_get_gentitle_format(void); | |
234 | |
235 /* So that output plugins can communicate with effect plugins */ | |
236 EffectPlugin *get_current_effect_plugin(void); | |
237 gboolean effects_enabled(void); | |
238 gboolean plugin_set_errortext(const gchar * text); | |
239 | |
240 G_END_DECLS | |
241 | |
242 #endif |