comparison src/audacious/plugin.h @ 2313:3149d4b1a9a9 trunk

[svn] - objective-make autodepend fixes - move all sourcecode into src/ and adjust Makefiles accordingly
author nenolod
date Fri, 12 Jan 2007 11:43:40 -0800
parents
children f346d30bf5ab
comparison
equal deleted inserted replaced
2312:e1a5a66fb9cc 2313:3149d4b1a9a9
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 /* 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>
42 #include "audacious/vfs.h"
43 #include "audacious/titlestring.h"
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
51 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x))
52
53 #define __AUDACIOUS_NEWVFS__
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
81 typedef struct _LowlevelPlugin LowlevelPlugin;
82
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
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
106 struct _OutputPlugin {
107 gpointer handle;
108 gchar *filename;
109
110 gchar *description;
111
112 void (*init) (void);
113 void (*cleanup) (void);
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);
129
130 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch);
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;
184
185 /* Added in Audacious 1.1.0 */
186 TitleInput *(*get_song_tuple) (gchar * filename);
187 void (*set_song_tuple) (TitleInput * tuple);
188 void (*set_status_buffering) (gboolean status);
189
190 /* Added in Audacious 1.3.0 */
191 gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd);
192 gchar **vfs_extensions;
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