21 #ifndef AUDACIOUS_PLUGIN_H
22 #define AUDACIOUS_PLUGIN_H
32 #define _AUD_PLUGIN_MAGIC 0x8EAC8DE2
47 #define _AUD_PLUGIN_VERSION_MIN 40
48 #define _AUD_PLUGIN_VERSION 43
96 #define PLUGIN_COMMON_FIELDS \
102 const char * domain; \
103 const char * about_text; \
104 const PluginPreferences * prefs; \
105 bool_t (* init) (void); \
106 void (* cleanup) (void); \
107 int (* take_message) (const char * code, const void * data, int size); \
108 void (* about) (void); \
109 void (* configure) (void); \
231 void (*
process) (
float * * data,
int * samples);
239 void (*
finish) (
float * * data,
int * samples);
304 void (*
set_data) (InputPlayback * p,
void * data);
307 void * (* get_data) (InputPlayback * p);
315 void (*
set_params) (InputPlayback * p,
int bitrate,
int samplerate,
320 void (*
set_tuple) (InputPlayback * playback, Tuple * tuple);
396 void * * data, int64_t * size);
421 void (*
mseek) (InputPlayback * playback,
int time);
427 void (*
stop) (InputPlayback * playback);
443 void * (* get_widget) (void);
463 void * (* get_widget) (void);
491 #undef PLUGIN_COMMON_FIELDS
493 #define AUD_PLUGIN(stype, itype, ...) \
494 AudAPITable * _aud_api_table = NULL; \
495 stype _aud_plugin_self = { \
496 .magic = _AUD_PLUGIN_MAGIC, \
497 .version = _AUD_PLUGIN_VERSION, \
499 .size = sizeof (stype), \
501 stype * get_plugin_info (AudAPITable * table) { \
502 _aud_api_table = table; \
503 return & _aud_plugin_self; \
506 #define AUD_TRANSPORT_PLUGIN(...) AUD_PLUGIN (TransportPlugin, PLUGIN_TYPE_TRANSPORT, __VA_ARGS__)
507 #define AUD_PLAYLIST_PLUGIN(...) AUD_PLUGIN (PlaylistPlugin, PLUGIN_TYPE_PLAYLIST, __VA_ARGS__)
508 #define AUD_INPUT_PLUGIN(...) AUD_PLUGIN (InputPlugin, PLUGIN_TYPE_INPUT, __VA_ARGS__)
509 #define AUD_EFFECT_PLUGIN(...) AUD_PLUGIN (EffectPlugin, PLUGIN_TYPE_EFFECT, __VA_ARGS__)
510 #define AUD_OUTPUT_PLUGIN(...) AUD_PLUGIN (OutputPlugin, PLUGIN_TYPE_OUTPUT, __VA_ARGS__)
511 #define AUD_VIS_PLUGIN(...) AUD_PLUGIN (VisPlugin, PLUGIN_TYPE_VIS, __VA_ARGS__)
512 #define AUD_GENERAL_PLUGIN(...) AUD_PLUGIN (GeneralPlugin, PLUGIN_TYPE_GENERAL, __VA_ARGS__)
513 #define AUD_IFACE_PLUGIN(...) AUD_PLUGIN (IfacePlugin, PLUGIN_TYPE_IFACE, __VA_ARGS__)
515 #define PLUGIN_HAS_FUNC(p, func) \
516 ((p)->size > (char *) & (p)->func - (char *) (p) && (p)->func)