Mercurial > audlegacy
annotate audacious/plugin.h @ 1557:dc3ae578e7b6 trunk
[svn] - make it compile
author | nenolod |
---|---|
date | Thu, 10 Aug 2006 19:21:37 -0700 |
parents | 3b990c26fc46 |
children | c4640c88942d |
rev | line source |
---|---|
0 | 1 /* BMP - Cross-platform multimedia player |
2 * Copyright (C) 2003-2004 BMP development team. | |
3 * | |
4 * Based on XMMS: | |
5 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies | |
6 * | |
7 * Redistribution and use in source and binary forms, with or without | |
8 * modification, are permitted provided that the following conditions are | |
9 * met: 1. Redistributions of source code must retain the above copyright | |
10 * notice, this list of conditions and the following disclaimer. 2. | |
11 * Redistributions in binary form must reproduce the above copyright notice, | |
12 * this list of conditions and the following disclaimer in the documentation | |
13 * and/or other materials provided with the distribution. | |
14 * | |
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | |
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | |
19 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
22 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 * SUCH DAMAGE. | |
26 */ | |
27 | |
28 /* Please see the BMP Wiki for information about the plugin interface */ | |
29 | |
30 #ifndef BMP_PLUGIN_H | |
31 #define BMP_PLUGIN_H | |
32 | |
33 | |
34 #include <glib.h> | |
1248
6d9c45d157f9
[svn] - this is a hack until I find a better solution
nenolod
parents:
1231
diff
changeset
|
35 #include "audacious/titlestring.h" |
0 | 36 |
37 #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) | |
38 #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) | |
39 #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) | |
40 #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) | |
41 #define VIS_PLUGIN(x) ((VisPlugin *)(x)) | |
42 | |
43 | |
44 typedef enum { | |
45 FMT_U8, | |
46 FMT_S8, | |
47 FMT_U16_LE, | |
48 FMT_U16_BE, | |
49 FMT_U16_NE, | |
50 FMT_S16_LE, | |
51 FMT_S16_BE, | |
52 FMT_S16_NE | |
53 } AFormat; | |
54 | |
55 typedef enum { | |
56 INPUT_VIS_ANALYZER, | |
57 INPUT_VIS_SCOPE, | |
58 INPUT_VIS_VU, | |
59 INPUT_VIS_OFF | |
60 } InputVisType; | |
61 | |
62 | |
63 typedef struct _Plugin Plugin; | |
64 typedef struct _InputPlugin InputPlugin; | |
65 typedef struct _OutputPlugin OutputPlugin; | |
66 typedef struct _EffectPlugin EffectPlugin; | |
67 typedef struct _GeneralPlugin GeneralPlugin; | |
68 typedef struct _VisPlugin VisPlugin; | |
69 | |
70 /* Sadly, this is the most we can generalize out of the disparate | |
71 plugin structs usable with typecasts - descender */ | |
72 struct _Plugin { | |
73 gpointer handle; | |
74 gchar *filename; | |
75 }; | |
76 | |
77 struct _OutputPlugin { | |
78 gpointer handle; | |
79 gchar *filename; | |
80 | |
81 gchar *description; | |
82 | |
83 void (*init) (void); | |
309 | 84 void (*cleanup) (void); |
0 | 85 void (*about) (void); |
86 void (*configure) (void); | |
87 void (*get_volume) (gint * l, gint * r); | |
88 void (*set_volume) (gint l, gint r); | |
89 | |
90 gint (*open_audio) (AFormat fmt, gint rate, gint nch); | |
91 void (*write_audio) (gpointer ptr, gint length); | |
92 void (*close_audio) (void); | |
93 | |
94 void (*flush) (gint time); | |
95 void (*pause) (gshort paused); | |
96 gint (*buffer_free) (void); | |
97 gint (*buffer_playing) (void); | |
98 gint (*output_time) (void); | |
99 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
|
100 |
516 | 101 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch); |
0 | 102 }; |
103 | |
104 struct _EffectPlugin { | |
105 gpointer handle; | |
106 gchar *filename; | |
107 | |
108 gchar *description; | |
109 | |
110 void (*init) (void); | |
111 void (*cleanup) (void); | |
112 void (*about) (void); | |
113 void (*configure) (void); | |
114 | |
115 gint (*mod_samples) (gpointer * data, gint length, AFormat fmt, gint srate, gint nch); | |
116 void (*query_format) (AFormat * fmt, gint * rate, gint * nch); | |
117 }; | |
118 | |
119 struct _InputPlugin { | |
120 gpointer handle; | |
121 gchar *filename; | |
122 | |
123 gchar *description; | |
124 | |
125 void (*init) (void); | |
126 void (*about) (void); | |
127 void (*configure) (void); | |
128 | |
129 gint (*is_our_file) (gchar * filename); | |
130 GList *(*scan_dir) (gchar * dirname); | |
131 | |
132 void (*play_file) (gchar * filename); | |
133 void (*stop) (void); | |
134 void (*pause) (gshort paused); | |
135 void (*seek) (gint time); | |
136 | |
137 void (*set_eq) (gint on, gfloat preamp, gfloat * bands); | |
138 | |
139 gint (*get_time) (void); | |
140 | |
141 void (*get_volume) (gint * l, gint * r); | |
142 void (*set_volume) (gint l, gint r); | |
143 | |
144 void (*cleanup) (void); | |
145 | |
146 InputVisType (*get_vis_type) (void); | |
147 void (*add_vis_pcm) (gint time, AFormat fmt, gint nch, gint length, gpointer ptr); | |
148 | |
149 void (*set_info) (gchar * title, gint length, gint rate, gint freq, gint nch); | |
150 void (*set_info_text) (gchar * text); | |
151 void (*get_song_info) (gchar * filename, gchar ** title, gint * length); | |
152 void (*file_info_box) (gchar * filename); | |
153 | |
154 OutputPlugin *output; | |
1231 | 155 |
156 TitleInput *(*get_song_tuple) (gchar * filename); | |
157 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
|
158 void (*set_status_buffering) (gboolean status); |
0 | 159 }; |
160 | |
161 struct _GeneralPlugin { | |
162 gpointer handle; | |
163 gchar *filename; | |
164 | |
165 gint xmms_session; | |
166 gchar *description; | |
167 | |
168 void (*init) (void); | |
169 void (*about) (void); | |
170 void (*configure) (void); | |
171 void (*cleanup) (void); | |
172 }; | |
173 | |
174 struct _VisPlugin { | |
175 gpointer handle; | |
176 gchar *filename; | |
177 | |
178 gint xmms_session; | |
179 gchar *description; | |
180 | |
181 gint num_pcm_chs_wanted; | |
182 gint num_freq_chs_wanted; | |
183 | |
184 void (*init) (void); | |
185 void (*cleanup) (void); | |
186 void (*about) (void); | |
187 void (*configure) (void); | |
188 void (*disable_plugin) (struct _VisPlugin *); | |
189 void (*playback_start) (void); | |
190 void (*playback_stop) (void); | |
191 void (*render_pcm) (gint16 pcm_data[2][512]); | |
192 void (*render_freq) (gint16 freq_data[2][256]); | |
193 }; | |
194 | |
195 | |
196 G_BEGIN_DECLS | |
197 | |
198 /* So that input plugins can get the title formatting information */ | |
199 G_CONST_RETURN gchar * xmms_get_gentitle_format(void); | |
200 | |
201 /* So that output plugins can communicate with effect plugins */ | |
202 EffectPlugin *get_current_effect_plugin(void); | |
203 gboolean effects_enabled(void); | |
204 gboolean plugin_set_errortext(const gchar * text); | |
205 | |
206 G_END_DECLS | |
207 | |
208 #endif |