Mercurial > audlegacy
annotate src/audacious/plugin.h @ 2729:643be93d0a30 trunk
[svn] - fix ABI
| author | nenolod |
|---|---|
| date | Thu, 10 May 2007 14:13:20 -0700 |
| parents | c35913222440 |
| children | 637359219e10 |
| 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 /* Please see the BMP Wiki for information about the plugin interface */ | |
| 36 | |
| 37 #ifndef BMP_PLUGIN_H | |
| 38 #define BMP_PLUGIN_H | |
| 39 | |
|
2711
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
40 #ifdef HAVE_CONFIG_H |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
41 # include "config.h" |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
42 #endif |
| 2313 | 43 |
| 44 #include <glib.h> | |
| 45 #include "audacious/vfs.h" | |
| 46 #include "audacious/titlestring.h" | |
| 47 | |
|
2711
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
48 #ifdef USE_DBUS |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
49 #include <dbus/dbus-glib.h> |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
50 #endif |
|
c35913222440
[svn] Initial commit of dbus client library for plugins. Various changes were made to the plugin structure to support dbus.
magma
parents:
2620
diff
changeset
|
51 |
| 2313 | 52 #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) |
| 53 #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) | |
| 54 #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) | |
| 55 #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) | |
| 56 #define VIS_PLUGIN(x) ((VisPlugin *)(x)) | |
| 57 | |
| 58 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x)) | |
| 59 | |
| 60 #define __AUDACIOUS_NEWVFS__ | |
|
2473
119cca341280
[svn] - define __AUDACIOUS_INPUT_PLUGIN_API__ to 2 by request of shd
nenolod
parents:
2453
diff
changeset
|
61 #define __AUDACIOUS_INPUT_PLUGIN_API__ 2 |
| 2313 | 62 |
| 63 typedef enum { | |
| 64 FMT_U8, | |
| 65 FMT_S8, | |
| 66 FMT_U16_LE, | |
| 67 FMT_U16_BE, | |
| 68 FMT_U16_NE, | |
| 69 FMT_S16_LE, | |
| 70 FMT_S16_BE, | |
| 71 FMT_S16_NE | |
| 72 } AFormat; | |
| 73 | |
| 74 typedef enum { | |
| 75 INPUT_VIS_ANALYZER, | |
| 76 INPUT_VIS_SCOPE, | |
| 77 INPUT_VIS_VU, | |
| 78 INPUT_VIS_OFF | |
| 79 } InputVisType; | |
| 80 | |
| 81 | |
| 82 typedef struct _Plugin Plugin; | |
| 83 typedef struct _InputPlugin InputPlugin; | |
| 84 typedef struct _OutputPlugin OutputPlugin; | |
| 85 typedef struct _EffectPlugin EffectPlugin; | |
| 86 typedef struct _GeneralPlugin GeneralPlugin; | |
| 87 typedef struct _VisPlugin VisPlugin; | |
| 88 | |
| 89 typedef struct _LowlevelPlugin LowlevelPlugin; | |
| 90 | |
|
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
91 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
|
92 |
| 2313 | 93 /* Sadly, this is the most we can generalize out of the disparate |
| 94 plugin structs usable with typecasts - descender */ | |
| 95 struct _Plugin { | |
| 96 gpointer handle; | |
| 97 gchar *filename; | |
| 98 }; | |
| 99 | |
| 100 /* | |
| 101 * LowlevelPlugin is used for lowlevel system services, such as PlaylistContainers, | |
| 102 * VFSContainers and the like. | |
| 103 * | |
| 104 * They are not GUI visible at this time. | |
| 105 */ | |
| 106 struct _LowlevelPlugin { | |
| 107 gpointer handle; | |
| 108 gchar *filename; | |
| 109 | |
| 110 gchar *description; | |
| 111 | |
| 112 void (*init) (void); | |
| 113 void (*cleanup) (void); | |
| 114 }; | |
| 115 | |
| 116 struct _OutputPlugin { | |
| 117 gpointer handle; | |
| 118 gchar *filename; | |
| 119 | |
| 120 gchar *description; | |
| 121 | |
| 122 void (*init) (void); | |
| 123 void (*cleanup) (void); | |
| 124 void (*about) (void); | |
| 125 void (*configure) (void); | |
| 126 void (*get_volume) (gint * l, gint * r); | |
| 127 void (*set_volume) (gint l, gint r); | |
| 128 | |
| 129 gint (*open_audio) (AFormat fmt, gint rate, gint nch); | |
| 130 void (*write_audio) (gpointer ptr, gint length); | |
| 131 void (*close_audio) (void); | |
| 132 | |
| 133 void (*flush) (gint time); | |
| 134 void (*pause) (gshort paused); | |
| 135 gint (*buffer_free) (void); | |
| 136 gint (*buffer_playing) (void); | |
| 137 gint (*output_time) (void); | |
| 138 gint (*written_time) (void); | |
| 139 | |
| 140 void (*tell_audio) (AFormat * fmt, gint * rate, gint * nch); | |
| 141 }; | |
| 142 | |
| 143 struct _EffectPlugin { | |
| 144 gpointer handle; | |
| 145 gchar *filename; | |
| 146 | |
| 147 gchar *description; | |
| 148 | |
| 149 void (*init) (void); | |
| 150 void (*cleanup) (void); | |
| 151 void (*about) (void); | |
| 152 void (*configure) (void); | |
| 153 | |
| 154 gint (*mod_samples) (gpointer * data, gint length, AFormat fmt, gint srate, gint nch); | |
| 155 void (*query_format) (AFormat * fmt, gint * rate, gint * nch); | |
| 156 }; | |
| 157 | |
|
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
158 struct _InputPlayback { |
|
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
159 gchar *filename; |
|
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
160 InputPlugin *plugin; |
|
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
161 void *data; |
|
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
162 OutputPlugin *output; |
|
2438
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
163 |
|
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
164 int playing; |
|
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
165 gboolean error; |
|
8750a62abed8
[svn] Provide flags in InputPlayback for common plugin flag needs, and provide a
iabervon
parents:
2437
diff
changeset
|
166 gboolean eof; |
|
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
167 }; |
|
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
168 |
| 2313 | 169 struct _InputPlugin { |
| 170 gpointer handle; | |
| 171 gchar *filename; | |
| 172 | |
| 173 gchar *description; | |
| 174 | |
| 175 void (*init) (void); | |
| 176 void (*about) (void); | |
| 177 void (*configure) (void); | |
| 178 | |
| 179 gint (*is_our_file) (gchar * filename); | |
| 180 GList *(*scan_dir) (gchar * dirname); | |
| 181 | |
|
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
182 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
|
183 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
|
184 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
|
185 void (*seek) (InputPlayback * playback, gint time); |
| 2313 | 186 |
| 187 void (*set_eq) (gint on, gfloat preamp, gfloat * bands); | |
| 188 | |
|
2436
f346d30bf5ab
[svn] Change the input plugin API to use a struct for the currently-playing file.
iabervon
parents:
2313
diff
changeset
|
189 gint (*get_time) (InputPlayback * playback); |
| 2313 | 190 |
| 2437 | 191 gint (*get_volume) (gint * l, gint * r); |
| 192 gint (*set_volume) (gint l, gint r); | |
| 2313 | 193 |
| 194 void (*cleanup) (void); | |
| 195 | |
| 196 InputVisType (*get_vis_type) (void); | |
| 197 void (*add_vis_pcm) (gint time, AFormat fmt, gint nch, gint length, gpointer ptr); | |
| 198 | |
| 199 void (*set_info) (gchar * title, gint length, gint rate, gint freq, gint nch); | |
| 200 void (*set_info_text) (gchar * text); | |
| 201 void (*get_song_info) (gchar * filename, gchar ** title, gint * length); | |
| 202 void (*file_info_box) (gchar * filename); | |
| 203 | |
| 2437 | 204 OutputPlugin *output; /* deprecated */ |
| 2313 | 205 |
| 206 /* Added in Audacious 1.1.0 */ | |
| 207 TitleInput *(*get_song_tuple) (gchar * filename); | |
| 208 void (*set_song_tuple) (TitleInput * tuple); | |
| 209 void (*set_status_buffering) (gboolean status); | |
| 210 | |
| 211 /* Added in Audacious 1.3.0 */ | |
| 212 gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd); | |
| 213 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
|
214 |
|
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
|
215 /* 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
|
216 void (*mseek) (InputPlayback * playback, gulong millisecond); |
| 2313 | 217 }; |
| 218 | |
| 219 struct _GeneralPlugin { | |
| 220 gpointer handle; | |
| 221 gchar *filename; | |
| 222 | |
| 223 gint xmms_session; | |
| 224 gchar *description; | |
| 225 | |
| 226 void (*init) (void); | |
| 227 void (*about) (void); | |
| 228 void (*configure) (void); | |
| 229 void (*cleanup) (void); | |
| 2729 | 230 |
| 231 #ifdef USE_DBUS | |
| 232 DBusGProxy *dbus_proxy; | |
| 233 #endif | |
| 2313 | 234 }; |
| 235 | |
| 236 struct _VisPlugin { | |
| 237 gpointer handle; | |
| 238 gchar *filename; | |
| 239 | |
| 240 gint xmms_session; | |
| 241 gchar *description; | |
| 242 | |
| 243 gint num_pcm_chs_wanted; | |
| 244 gint num_freq_chs_wanted; | |
| 245 | |
| 246 void (*init) (void); | |
| 247 void (*cleanup) (void); | |
| 248 void (*about) (void); | |
| 249 void (*configure) (void); | |
| 250 void (*disable_plugin) (struct _VisPlugin *); | |
| 251 void (*playback_start) (void); | |
| 252 void (*playback_stop) (void); | |
| 253 void (*render_pcm) (gint16 pcm_data[2][512]); | |
| 254 void (*render_freq) (gint16 freq_data[2][256]); | |
| 2729 | 255 |
| 256 #ifdef USE_DBUS | |
| 257 DBusGProxy *dbus_proxy; | |
| 258 #endif | |
| 2313 | 259 }; |
| 260 | |
| 261 | |
| 262 G_BEGIN_DECLS | |
| 263 | |
| 264 /* So that input plugins can get the title formatting information */ | |
| 265 G_CONST_RETURN gchar * xmms_get_gentitle_format(void); | |
| 266 | |
| 267 /* So that output plugins can communicate with effect plugins */ | |
| 268 EffectPlugin *get_current_effect_plugin(void); | |
| 269 gboolean effects_enabled(void); | |
| 270 gboolean plugin_set_errortext(const gchar * text); | |
| 271 | |
| 272 G_END_DECLS | |
| 273 | |
| 274 #endif |
