Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ad_plugin.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. Copyright (C) 2011-2013 Robin Gareus <robin@gareus.org>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser Public License as published by
  5. the Free Software Foundation; either version 2.1, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. */
  15. #ifndef __AD_PLUGIN_H__
  16. #define __AD_PLUGIN_H__
  17. #include <stdint.h>
  18. #include "ad.h"
  19. #define dbg(A, B, ...) ad_debug_printf(__func__, A, B, ##__VA_ARGS__)
  20. #ifndef __PRI64_PREFIX
  21. #if (defined __X86_64__ || defined __LP64__)
  22. # define __PRI64_PREFIX "l"
  23. #else
  24. # define __PRI64_PREFIX "ll"
  25. #endif
  26. #endif
  27. #ifndef PRIu64
  28. # define PRIu64 __PRI64_PREFIX "u"
  29. #endif
  30. #ifndef PRIi64
  31. # define PRIi64 __PRI64_PREFIX "i"
  32. #endif
  33. extern int ad_debug_level;
  34. void ad_debug_printf(const char* func, int level, const char* format, ...);
  35. typedef struct {
  36. int (*eval)(const char *);
  37. void * (*open)(const char *, struct adinfo *);
  38. int (*close)(void *);
  39. int (*info)(void *, struct adinfo *);
  40. int64_t (*seek)(void *, int64_t);
  41. ssize_t (*read)(void *, float *, size_t);
  42. int (*bitrate)(void *);
  43. } ad_plugin;
  44. int ad_eval_null(const char *);
  45. void * ad_open_null(const char *, struct adinfo *);
  46. int ad_close_null(void *);
  47. int ad_info_null(void *, struct adinfo *);
  48. int64_t ad_seek_null(void *, int64_t);
  49. ssize_t ad_read_null(void *, float*, size_t);
  50. int ad_bitrate_null(void *);
  51. /* hardcoded backends */
  52. const ad_plugin * adp_get_sndfile();
  53. const ad_plugin * adp_get_dr_mp3();
  54. const ad_plugin * adp_get_minimp3();
  55. const ad_plugin * adp_get_ffmpeg();
  56. #endif