22 #ifndef AUDACIOUS_PLUGIN_H
23 #define AUDACIOUS_PLUGIN_H
33 #define _AUD_PLUGIN_MAGIC 0x8EAC8DE2
48 #define _AUD_PLUGIN_VERSION_MIN 38
49 #define _AUD_PLUGIN_VERSION 38
97 #define PLUGIN_COMMON_FIELDS \
103 bool_t (* init) (void); \
104 void (* cleanup) (void); \
105 int (* take_message) (const char * code, const void * data, int size); \
106 void (* about) (void); \
107 void (* configure) (void); \
108 PluginPreferences * settings;
309 void * (* get_data) (InputPlayback * p);
317 void (*
set_params) (InputPlayback * p,
int bitrate,
int samplerate,
322 void (*
set_tuple) (InputPlayback * playback, Tuple * tuple);
398 void * *
data, int64_t * size);
423 void (*
mseek) (InputPlayback * playback,
int time);
429 void (*
stop) (InputPlayback * playback);
445 void * (* get_widget) (void);
465 void * (* get_widget) (void);
495 #undef PLUGIN_COMMON_FIELDS
497 #define AUD_PLUGIN(stype, itype, ...) \
498 AudAPITable * _aud_api_table = NULL; \
499 stype _aud_plugin_self = { \
500 .magic = _AUD_PLUGIN_MAGIC, \
501 .version = _AUD_PLUGIN_VERSION, \
503 .size = sizeof (stype), \
505 stype * get_plugin_info (AudAPITable * table) { \
506 _aud_api_table = table; \
507 return & _aud_plugin_self; \
510 #define AUD_TRANSPORT_PLUGIN(...) AUD_PLUGIN (TransportPlugin, PLUGIN_TYPE_TRANSPORT, __VA_ARGS__)
511 #define AUD_PLAYLIST_PLUGIN(...) AUD_PLUGIN (PlaylistPlugin, PLUGIN_TYPE_PLAYLIST, __VA_ARGS__)
512 #define AUD_INPUT_PLUGIN(...) AUD_PLUGIN (InputPlugin, PLUGIN_TYPE_INPUT, __VA_ARGS__)
513 #define AUD_EFFECT_PLUGIN(...) AUD_PLUGIN (EffectPlugin, PLUGIN_TYPE_EFFECT, __VA_ARGS__)
514 #define AUD_OUTPUT_PLUGIN(...) AUD_PLUGIN (OutputPlugin, PLUGIN_TYPE_OUTPUT, __VA_ARGS__)
515 #define AUD_VIS_PLUGIN(...) AUD_PLUGIN (VisPlugin, PLUGIN_TYPE_VIS, __VA_ARGS__)
516 #define AUD_GENERAL_PLUGIN(...) AUD_PLUGIN (GeneralPlugin, PLUGIN_TYPE_GENERAL, __VA_ARGS__)
517 #define AUD_IFACE_PLUGIN(...) AUD_PLUGIN (IfacePlugin, PLUGIN_TYPE_IFACE, __VA_ARGS__)
519 #define PLUGIN_HAS_FUNC(p, func) \
520 ((p)->size > (char *) & (p)->func - (char *) (p) && (p)->func)