Mercurial > audlegacy
annotate audacious/plugin.h @ 2025:73471758fc71 trunk
[svn] - make sure the mainwin is redrawn correctly when doublesized. reported by Tom St. Denis, closes #674.
author | nenolod |
---|---|
date | Wed, 29 Nov 2006 19:49:30 -0800 |
parents | c2a63f41d8c6 |
children | 8d2b17ee266e |
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> | |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
35 #ifdef _AUDACIOUS_CORE |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
36 # include "libaudacious/vfs.h" |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
37 #else |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
38 # include "audacious/vfs.h" |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
39 #endif |
1248
6d9c45d157f9
[svn] - this is a hack until I find a better solution
nenolod
parents:
1231
diff
changeset
|
40 #include "audacious/titlestring.h" |
0 | 41 |
42 #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) | |
43 #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) | |
44 #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) | |
45 #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) | |
46 #define VIS_PLUGIN(x) ((VisPlugin *)(x)) | |
47 | |
1563 | 48 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x)) |
49 | |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
50 #define __AUDACIOUS_NEWVFS__ |
0 | 51 |
52 typedef enum { | |
53 FMT_U8, | |
54 FMT_S8, | |
55 FMT_U16_LE, | |
56 FMT_U16_BE, | |
57 FMT_U16_NE, | |
58 FMT_S16_LE, | |
59 FMT_S16_BE, | |
60 FMT_S16_NE | |
61 } AFormat; | |
62 | |
63 typedef enum { | |
64 INPUT_VIS_ANALYZER, | |
65 INPUT_VIS_SCOPE, | |
66 INPUT_VIS_VU, | |
67 INPUT_VIS_OFF | |
68 } InputVisType; | |
69 | |
70 | |
71 typedef struct _Plugin Plugin; | |
72 typedef struct _InputPlugin InputPlugin; | |
73 typedef struct _OutputPlugin OutputPlugin; | |
74 typedef struct _EffectPlugin EffectPlugin; | |
75 typedef struct _GeneralPlugin GeneralPlugin; | |
76 typedef struct _VisPlugin VisPlugin; | |
77 | |
1563 | 78 typedef struct _LowlevelPlugin LowlevelPlugin; |
79 | |
0 | 80 /* Sadly, this is the most we can generalize out of the disparate |
81 plugin structs usable with typecasts - descender */ | |
82 struct _Plugin { | |
83 gpointer handle; | |
84 gchar *filename; | |
85 }; | |
86 | |
1563 | 87 /* |
88 * LowlevelPlugin is used for lowlevel system services, such as PlaylistContainers, | |
89 * VFSContainers and the like. | |
90 * | |
91 * They are not GUI visible at this time. | |
92 */ | |
93 struct _LowlevelPlugin { | |
94 gpointer handle; | |
95 gchar *filename; | |
96 | |
97 gchar *description; | |
98 | |
99 void (*init) (void); | |
100 void (*cleanup) (void); | |
101 }; | |
102 | |
0 | 103 struct _OutputPlugin { |
104 gpointer handle; | |
105 gchar *filename; | |
106 | |
107 gchar *description; | |
108 | |
109 void (*init) (void); | |
309 | 110 void (*cleanup) (void); |
0 | 111 void (*about) (void); |
112 void (*configure) (void); | |
113 void (*get_volume) (gint * l, gint * r); | |
114 void (*set_volume) (gint l, gint r); | |
115 | |
116 gint (*open_audio) (AFormat fmt, gint rate, gint nch); | |
117 void (*write_audio) (gpointer ptr, gint length); | |
118 void (*close_audio) (void); | |
119 | |
120 void (*flush) (gint time); | |
121 void (*pause) (gshort paused); | |
122 gint (*buffer_free) (void); | |
123 gint (*buffer_playing) (void); | |
124 gint (*output_time) (void); | |
125 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
|
126 |
516 | 127 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch); |
0 | 128 }; |
129 | |
130 struct _EffectPlugin { | |
131 gpointer handle; | |
132 gchar *filename; | |
133 | |
134 gchar *description; | |
135 | |
136 void (*init) (void); | |
137 void (*cleanup) (void); | |
138 void (*about) (void); | |
139 void (*configure) (void); | |
140 | |
141 gint (*mod_samples) (gpointer * data, gint length, AFormat fmt, gint srate, gint nch); | |
142 void (*query_format) (AFormat * fmt, gint * rate, gint * nch); | |
143 }; | |
144 | |
145 struct _InputPlugin { | |
146 gpointer handle; | |
147 gchar *filename; | |
148 | |
149 gchar *description; | |
150 | |
151 void (*init) (void); | |
152 void (*about) (void); | |
153 void (*configure) (void); | |
154 | |
155 gint (*is_our_file) (gchar * filename); | |
156 GList *(*scan_dir) (gchar * dirname); | |
157 | |
158 void (*play_file) (gchar * filename); | |
159 void (*stop) (void); | |
160 void (*pause) (gshort paused); | |
161 void (*seek) (gint time); | |
162 | |
163 void (*set_eq) (gint on, gfloat preamp, gfloat * bands); | |
164 | |
165 gint (*get_time) (void); | |
166 | |
167 void (*get_volume) (gint * l, gint * r); | |
168 void (*set_volume) (gint l, gint r); | |
169 | |
170 void (*cleanup) (void); | |
171 | |
172 InputVisType (*get_vis_type) (void); | |
173 void (*add_vis_pcm) (gint time, AFormat fmt, gint nch, gint length, gpointer ptr); | |
174 | |
175 void (*set_info) (gchar * title, gint length, gint rate, gint freq, gint nch); | |
176 void (*set_info_text) (gchar * text); | |
177 void (*get_song_info) (gchar * filename, gchar ** title, gint * length); | |
178 void (*file_info_box) (gchar * filename); | |
179 | |
180 OutputPlugin *output; | |
1231 | 181 |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
182 /* Added in Audacious 1.1.0 */ |
1231 | 183 TitleInput *(*get_song_tuple) (gchar * filename); |
184 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
|
185 void (*set_status_buffering) (gboolean status); |
1951
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
186 |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
187 /* Added in Audacious 1.2.2 */ |
c2a63f41d8c6
[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take
nenolod
parents:
1563
diff
changeset
|
188 gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd); |
0 | 189 }; |
190 | |
191 struct _GeneralPlugin { | |
192 gpointer handle; | |
193 gchar *filename; | |
194 | |
195 gint xmms_session; | |
196 gchar *description; | |
197 | |
198 void (*init) (void); | |
199 void (*about) (void); | |
200 void (*configure) (void); | |
201 void (*cleanup) (void); | |
202 }; | |
203 | |
204 struct _VisPlugin { | |
205 gpointer handle; | |
206 gchar *filename; | |
207 | |
208 gint xmms_session; | |
209 gchar *description; | |
210 | |
211 gint num_pcm_chs_wanted; | |
212 gint num_freq_chs_wanted; | |
213 | |
214 void (*init) (void); | |
215 void (*cleanup) (void); | |
216 void (*about) (void); | |
217 void (*configure) (void); | |
218 void (*disable_plugin) (struct _VisPlugin *); | |
219 void (*playback_start) (void); | |
220 void (*playback_stop) (void); | |
221 void (*render_pcm) (gint16 pcm_data[2][512]); | |
222 void (*render_freq) (gint16 freq_data[2][256]); | |
223 }; | |
224 | |
225 | |
226 G_BEGIN_DECLS | |
227 | |
228 /* So that input plugins can get the title formatting information */ | |
229 G_CONST_RETURN gchar * xmms_get_gentitle_format(void); | |
230 | |
231 /* So that output plugins can communicate with effect plugins */ | |
232 EffectPlugin *get_current_effect_plugin(void); | |
233 gboolean effects_enabled(void); | |
234 gboolean plugin_set_errortext(const gchar * text); | |
235 | |
236 G_END_DECLS | |
237 | |
238 #endif |